Compare commits

...
Author SHA1 Message Date
Florian Reuth da7cc933d7 Fix SignText hashing
Signed-off-by: Florian Reuth <git@florianreuth.de>
2026-09-29 10:29:50 +02:00
2 changed files with 5 additions and 4 deletions

No files matched your search

@@ -52,10 +52,10 @@ public record SignText(Tag[] messages, Tag @Nullable [] filteredMessages, int co
@Override
public void write(final Ops ops, final SignText value) {
ops.writeMap(map -> map
.write("messages", Types.SIGN_TEXT, value.messages)
.writeOptional("filtered_messages", Types.SIGN_TEXT, value.filteredMessages)
.write("color", Types.VAR_INT, value.color, 15)
.write("has_glowing_text", Types.BOOLEAN, value.hasGlowingText, false));
.write("messages", Types.TEXT_COMPONENT_TAG_ARRAY, value.messages)
.writeOptional("filtered_messages", Types.TEXT_COMPONENT_TAG_ARRAY, value.filteredMessages)
.write("color", EnumTypes.DYE_COLOR, value.color)
.write("has_glowing_text", Types.BOOLEAN, value.hasGlowingText));
}
};
}
@@ -227,6 +227,7 @@ public final class Types {
public static final Type<Tag[]> TAG_ARRAY = new ArrayType<>(TAG);
public static final Type<Tag> OPTIONAL_TAG = TagType.OptionalTagType.type();
public static final Type<Tag> TEXT_COMPONENT_TAG = new TextComponentTagType(); // only strictly needed for hashing
public static final Type<Tag[]> TEXT_COMPONENT_TAG_ARRAY = new ArrayType<>(Types.TEXT_COMPONENT_TAG);
public static final Type<Tag> CUSTOM_CLICK_ACTION_TAG = new LengthPrefixedTagType(65536);
public static final FixedLengthArrayType<Tag> SIGN_TEXT = new FixedLengthArrayType<>(TAG, 4);