Fix sign nbt on 1.20 client (#3436)

This commit is contained in:
riku6460 2023-09-24 12:02:31 +09:00 committed by GitHub
parent 8a0e187621
commit f91e6a83f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -172,17 +172,19 @@ public final class InventoryPackets extends ItemRewriter<ClientboundPackets1_19_
final ListTag messages = new ListTag(StringTag.class);
for (int i = 1; i < 5; i++) {
final Tag text = tag.get("Text" + i);
final Tag text = tag.remove("Text" + i);
messages.add(text != null ? text : new StringTag(ChatRewriter.emptyComponentString()));
}
frontText.put("messages", messages);
final ListTag filteredMessages = new ListTag(StringTag.class);
for (int i = 1; i < 5; i++) {
final Tag text = tag.get("FilteredText" + i);
filteredMessages.add(text != null ? text : new StringTag(ChatRewriter.emptyComponentString()));
final Tag text = tag.remove("FilteredText" + i);
filteredMessages.add(text != null ? text : messages.get(i - 1));
}
if (!filteredMessages.equals(messages)) {
frontText.put("filtered_messages", filteredMessages);
}
frontText.put("filtered_messages", filteredMessages);
final Tag color = tag.remove("Color");
if (color != null) {