mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 03:47:27 +00:00
CloneAllTagsShort for Quicker Server Interaction
This commit is contained in:
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);
|
||||
|
||||
Reference in new issue
Block a user