mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-16 21:05:06 +00:00
Separate GUI Data from PartyData so that overwrites don't consistently occur to GUI Page
This commit is contained in:
1 parent
32dc6e86e2
commit
1cbd306c50
6 files changed
+30
-9
No files matched your search
@@ -400,5 +400,19 @@ public class PacketHandlerClient extends PacketHandlerServer{
|
||||
ItemStack stack = ItemStack.loadItemStackFromNBT(Server.readNBT(buffer));
|
||||
npc.inventory.weapons.put(weaponSlotIndex,stack);
|
||||
}
|
||||
else if(type == EnumPacketClient.PARTY_DATA){
|
||||
GuiScreen gui = Minecraft.getMinecraft().currentScreen;
|
||||
if(gui == null)
|
||||
return;
|
||||
|
||||
if(gui instanceof GuiNPCInterface && ((GuiNPCInterface)gui).hasSubGui()){
|
||||
gui = (GuiScreen) ((GuiNPCInterface)gui).getSubGui();
|
||||
}
|
||||
else if(gui instanceof GuiContainerNPCInterface && ((GuiContainerNPCInterface)gui).hasSubGui()){
|
||||
gui = (GuiScreen) ((GuiContainerNPCInterface)gui).getSubGui();
|
||||
}
|
||||
if(gui instanceof IPartyData)
|
||||
((IPartyData)gui).setPartyData(Server.readNBT(buffer));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user