11package gregtech .api .mui .serialize ;
22
3- import com .cleanroommc .modularui .drawable .text .FormattingState ;
4- import it .unimi .dsi .fastutil .objects .Object2ObjectOpenHashMap ;
5-
63import net .minecraft .util .text .TextFormatting ;
74
85import com .cleanroommc .modularui .api .drawable .IKey ;
96import com .cleanroommc .modularui .drawable .text .CompoundKey ;
107import com .cleanroommc .modularui .drawable .text .DynamicKey ;
8+ import com .cleanroommc .modularui .drawable .text .FormattingState ;
119import com .cleanroommc .modularui .drawable .text .LangKey ;
1210import com .cleanroommc .modularui .drawable .text .StringKey ;
1311import com .google .gson .JsonDeserializationContext ;
1412import com .google .gson .JsonElement ;
1513import com .google .gson .JsonObject ;
1614import com .google .gson .JsonParseException ;
1715import com .google .gson .JsonSerializationContext ;
16+ import it .unimi .dsi .fastutil .objects .Object2ObjectOpenHashMap ;
1817import org .apache .commons .lang3 .ArrayUtils ;
1918
2019import java .util .Map ;
@@ -37,7 +36,8 @@ public IKey deserialize(JsonElement json, JsonDeserializationContext context)
3736 return IKey .str (object .get ("string" ).getAsString ());
3837 } else if (object .has ("lang" )) {
3938 String lang = context .deserialize (object .get ("lang" ), String .class );
40- TextFormatting [] formatting = deserializeArray (object .getAsJsonArray ("format" ), context , TextFormatting []::new );
39+ TextFormatting [] formatting = deserializeArray (object .getAsJsonArray ("format" ), context ,
40+ TextFormatting []::new );
4141 Object [] args = deserializeArray (
4242 object .getAsJsonArray ("args" ), context , Object []::new );
4343 return IKey .lang (lang , args ).style (formatting );
@@ -59,7 +59,7 @@ public JsonElement serialize(IKey src, JsonSerializationContext context) {
5959 } else if (src instanceof LangKey langKey ) {
6060 obj .add ("lang" , context .serialize (langKey .getKeySupplier ().get ()));
6161 TextFormatting [] formattings = convert (langKey .getFormatting ());
62- obj .add ("format" , serializeArray (formattings , context ));
62+ obj .add ("format" , serializeArray (formattings , context ));
6363 Object [] args = langKey .getArgsSupplier ().get ();
6464 if (!ArrayUtils .isEmpty (args ))
6565 obj .add ("args" , serializeArray (args , context ));
0 commit comments