From 0b1e13c1f4050b0db323b20afa59c6af603b0396 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Wed, 15 Mar 2023 11:19:34 -0400 Subject: [PATCH] Read all resource locations in UpdateTagsPacket --- .../clientbound/ClientboundUpdateTagsPacket.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/github/steveice10/mc/protocol/packet/ingame/clientbound/ClientboundUpdateTagsPacket.java b/src/main/java/com/github/steveice10/mc/protocol/packet/ingame/clientbound/ClientboundUpdateTagsPacket.java index 80b28af3..050cd7fe 100644 --- a/src/main/java/com/github/steveice10/mc/protocol/packet/ingame/clientbound/ClientboundUpdateTagsPacket.java +++ b/src/main/java/com/github/steveice10/mc/protocol/packet/ingame/clientbound/ClientboundUpdateTagsPacket.java @@ -19,14 +19,14 @@ import java.util.Map; public class ClientboundUpdateTagsPacket implements MinecraftPacket { private final @NonNull Map> tags = new HashMap<>(); - public ClientboundUpdateTagsPacket(ByteBuf in, MinecraftCodecHelper helper) throws IOException { + public ClientboundUpdateTagsPacket(ByteBuf in, MinecraftCodecHelper helper) { int totalTagCount = helper.readVarInt(in); for (int i = 0; i < totalTagCount; i++) { Map tag = new HashMap<>(); - String tagName = Identifier.formalize(helper.readString(in)); + String tagName = helper.readResourceLocation(in); int tagsCount = helper.readVarInt(in); for (int j = 0; j < tagsCount; j++) { - String name = helper.readString(in); + String name = helper.readResourceLocation(in); int entriesCount = helper.readVarInt(in); int[] entries = new int[entriesCount]; for (int index = 0; index < entriesCount; index++) { @@ -40,13 +40,13 @@ public class ClientboundUpdateTagsPacket implements MinecraftPacket { } @Override - public void serialize(ByteBuf out, MinecraftCodecHelper helper) throws IOException { + public void serialize(ByteBuf out, MinecraftCodecHelper helper) { helper.writeVarInt(out, tags.size()); for (Map.Entry> tagSet : tags.entrySet()) { - helper.writeString(out, tagSet.getKey()); + helper.writeResourceLocation(out, tagSet.getKey()); helper.writeVarInt(out, tagSet.getValue().size()); for (Map.Entry tag : tagSet.getValue().entrySet()) { - helper.writeString(out, tag.getKey()); + helper.writeResourceLocation(out, tag.getKey()); helper.writeVarInt(out, tag.getValue().length); for (int id : tag.getValue()) { helper.writeVarInt(out, id);