This repository was archived by the owner on Nov 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +22
-9
lines changed
1.8.9/src/main/java/io/github/axolotlclient/mixin Expand file tree Collapse file tree 1 file changed +22
-9
lines changed Original file line number Diff line number Diff line change @@ -100,16 +100,29 @@ private static Formatting byCodeOfFirstChar(String code) {
100100
101101 @ Unique
102102 private static Text format (Text text ) {
103- var reformatted = formatFromCodes (text .getStyle ().asString ()+text .getContent ());
104- var s = text .getStyle ();
105- var rS = reformatted .getStyle ();
106- rS .setClickEvent (s .getClickEvent ());
107- rS .setHoverEvent (s .getHoverEvent ());
108- rS .setInsertion (s .getInsertion ());
109- for (Text sib : text .getSiblings ()) {
110- reformatted .append (format (sib ));
103+ Text n = null ;
104+ for (var t : text ) {
105+ if (!t .getContent ().contains ("§" )) {
106+ var r = new LiteralText (t .getContent ());
107+ r .setStyle (t .getStyle ());
108+ if (n == null ) {
109+ n = r ;
110+ } else {
111+ n .append (r );
112+ t .getStyle ().setParent (n .getStyle ());
113+ }
114+ } else {
115+ var formatted = formatFromCodes (t .getContent ());
116+ formatted .setStyle (t .getStyle ());
117+ if (n == null ) {
118+ n = formatted ;
119+ } else {
120+ n .append (formatted );
121+ formatted .getStyle ().setParent (n .getStyle ());
122+ }
123+ }
111124 }
112- return reformatted ;
125+ return n ;
113126 }
114127
115128 @ Unique
You can’t perform that action at this time.
0 commit comments