Check for lore length, not component length

This commit is contained in:
Nassim Jahnke 2024-04-23 23:53:24 +02:00
parent ebbe1b6da2
commit b78f9d350b
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F
1 changed files with 2 additions and 1 deletions

View File

@ -989,10 +989,11 @@ public class ComponentRewriter1_20_5 extends ComponentRewriter<ClientboundPacket
}
protected ListTag<StringTag> convertComponents(final Tag[] value, final int maxLength) {
checkIntRange(0, maxLength, value.length);
final ListTag<StringTag> listTag = new ListTag<>(StringTag.class);
for (final Tag tag : value) {
final String json = serializerVersion().toString(serializerVersion().toComponent(tag));
listTag.add(new StringTag(checkStringRange(0, maxLength, json)));
listTag.add(new StringTag(json));
}
return listTag;
}