Send ServerTag Map through packet

This commit is contained in:
KAMKEEL committed 2023-03-22 16:07:09 -04:00
1 parent 2c349cb34c
commit 69154bec24
1 file changed
+2 -21
@@ -1078,28 +1078,9 @@ public class PacketHandlerServer{
else if (type == EnumPacketServer.CloneTagList) {
int tab = buffer.readInt();
List<String> cloneNames = ServerCloneController.Instance.getClones(tab);
NBTTagList cloneTags = new NBTTagList();
for (String name : cloneNames) {
NBTTagCompound compound = ServerCloneController.Instance.getCloneData(null, name, tab);
if (compound.hasKey("TagUUIDs")) {
NBTTagCompound tagCompound = new NBTTagCompound();
tagCompound.setString("Name",name);
NBTTagList uuidList = compound.getTagList("TagUUIDs",8);
NBTTagList tags = new NBTTagList();
for (int i = 0; i < uuidList.tagCount(); i++) {
String uuidString = uuidList.getStringTagAt(i);
NBTTagCompound tagNBT = new NBTTagCompound();
TagController.getInstance().getTagFromUUID(UUID.fromString(uuidString)).writeNBT(tagNBT);
tags.appendTag(tagNBT);
}
tagCompound.setTag("Tags",tags);
cloneTags.appendTag(tagCompound);
}
}
TagMap tagMap = ServerTagMapController.Instance.getTagMap(tab);
NBTTagCompound compound = new NBTTagCompound();
compound.setTag("CloneTags", cloneTags);
compound.setTag("CloneTags", tagMap.writeNBT());
Server.sendData(player, EnumPacketClient.GUI_DATA, compound);
}
else