File tree Expand file tree Collapse file tree
nms/v1_20_R4/src/main/java/kr/toxicity/libraries/datacomponent/nms/v1_20_R4 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ final class CodecImpl<T> implements kr.toxicity.libraries.datacomponent.api.Code
3131
3232 private static final RegistryOps <JsonElement > OPS = RegistryAccess .fromRegistryOfRegistries (BuiltInRegistries .REGISTRY ).createSerializationContext (JsonOps .INSTANCE );
3333
34- static final CodecImpl <Component > COMPONENT = of (ComponentSerialization .CODEC , t -> t .getContents () instanceof PlainTextContents textContents ? new JsonPrimitive (textContents .text ()) : new JsonObject ());
34+ static final CodecImpl <Component > COMPONENT = of (ComponentSerialization .CODEC , t -> t .stream (). count () == 1 && t . getStyle (). isEmpty () && t . getContents () instanceof PlainTextContents textContents ? new JsonPrimitive (textContents .text ()) : new JsonObject ());
3535 static final CodecImpl <ItemLore > ITEM_LORE = of (ItemLore .CODEC , t -> new JsonArray ());
3636 static final CodecImpl <Rarity > RARITY = of (Rarity .CODEC , t -> new JsonPrimitive (t .name ().toLowerCase ()));
3737 static final CodecImpl <Unit > UNIT = of (Codec .unit (Unit .INSTANCE ), t -> new JsonPrimitive (true ));
You can’t perform that action at this time.
0 commit comments