mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-16 22:15:06 +00:00
Backported GUI features and necessary classes from 1.12.
This commit is contained in:
1 parent
8b6e84a8d4
commit
95d2814651
46 files changed
+3675
-520
No files matched your search
@@ -106,6 +106,8 @@ public class PacketHandlerServer{
|
||||
clonePackets(type, buffer, player);
|
||||
else if(item.getItem() == CustomItems.teleporter)
|
||||
featherPackets(type, buffer, player);
|
||||
else if(type == EnumPacketServer.ScriptPlayerGet && type == EnumPacketServer.ScriptPlayerSave)
|
||||
playerScriptPackets(type, buffer, player, npc);
|
||||
else if(item.getItem() == CustomItems.scripter)
|
||||
scriptPackets(type, buffer, player, npc);
|
||||
else if(item.getItem() == Item.getItemFromBlock(CustomItems.waypoint) || item.getItem() == Item.getItemFromBlock(CustomItems.border) || item.getItem() == Item.getItemFromBlock(CustomItems.redstoneBlock))
|
||||
@@ -128,6 +130,17 @@ public class PacketHandlerServer{
|
||||
}
|
||||
}
|
||||
|
||||
private void playerScriptPackets(EnumPacketServer type, ByteBuf buffer, EntityPlayerMP player, EntityNPCInterface npc) throws Exception {
|
||||
NBTTagCompound compound;
|
||||
if (type == EnumPacketServer.ScriptPlayerGet) {
|
||||
compound = ScriptController.Instance.playerScripts.writeToNBT(new NBTTagCompound());
|
||||
compound.setTag("Languages", ScriptController.Instance.nbtLanguages());
|
||||
Server.sendData(player, EnumPacketClient.GUI_DATA, new Object[]{compound});
|
||||
} else if (type == EnumPacketServer.ScriptPlayerSave) {
|
||||
ScriptController.Instance.setPlayerScripts(Server.readNBT(buffer));
|
||||
}
|
||||
}
|
||||
|
||||
private void featherPackets(EnumPacketServer type, ByteBuf buffer, EntityPlayerMP player) throws IOException {
|
||||
if(type == EnumPacketServer.DimensionsGet){
|
||||
HashMap<String,Integer> map = new HashMap<String,Integer>();
|
||||
|
||||
Reference in new issue
Block a user