CloneAllTagsShort for Quicker Server Interaction

This commit is contained in:
Kam committed 2023-05-08 23:46:38 -04:00
1 parent e6786a985e
commit adec63c763
3 files changed
+25 -2

No files matched your search

@@ -1048,7 +1048,10 @@ public class PacketHandlerServer{
PlayerData data = PlayerDataController.instance.getPlayerData(player);
if(data.cloned == null)
return;
ServerCloneController.Instance.addClone(data.cloned, Server.readString(buffer), buffer.readInt());
String name = Server.readString(buffer);
int tab = buffer.readInt();
NBTTagCompound tagExtra = Server.readNBT(buffer);
ServerCloneController.Instance.addClone(data.cloned, name, tab, tagExtra);
}
else if(type == EnumPacketServer.CloneRemove){
int tab = buffer.readInt();
@@ -1104,6 +1107,18 @@ public class PacketHandlerServer{
compound.setTag("AllTags", validTagList);
Server.sendData(player, EnumPacketClient.GUI_DATA, compound);
}
else if (type == EnumPacketServer.CloneAllTagsShort) {
NBTTagCompound compound = new NBTTagCompound();
HashSet<Tag> validTags = TagController.getInstance().getAllTags();
NBTTagList validTagList = new NBTTagList();
for(Tag tag : validTags){
NBTTagCompound tagCompound = new NBTTagCompound();
tag.writeShortNBT(tagCompound);
validTagList.appendTag(tagCompound);
}
compound.setTag("ShortTags", validTagList);
Server.sendData(player, EnumPacketClient.GUI_DATA, compound);
}
else if (type == EnumPacketServer.TagSet) {
EntityNPCInterface npc = NoppesUtilServer.getEditingNpc(player);
this.setTags(npc,buffer);