mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 07:59:08 +00:00
Fixed custom gui with slot update synchronisation
This commit is contained in:
1 parent
37c8c8addc
commit
79a15fe1e8
2 files changed
+4
-4
No files matched your search
@@ -39,10 +39,9 @@ public class ContainerCustomGui extends Container {
|
||||
this.addPlayerInventory(player, this.customGui.getPlayerInvX(), this.customGui.getPlayerInvY());
|
||||
}
|
||||
|
||||
Iterator var3 = this.customGui.getSlots().iterator();
|
||||
|
||||
while(var3.hasNext()) {
|
||||
IItemSlot slot = (IItemSlot)var3.next();
|
||||
slotCount=0;
|
||||
inventorySlots.clear();
|
||||
for (IItemSlot slot : this.customGui.getSlots()) {
|
||||
if (slot.hasStack()) {
|
||||
this.addSlot(player, slot.getPosX(), slot.getPosY(), slot, slot.getStack().getMCItemStack(), player.worldObj.isRemote);
|
||||
} else {
|
||||
|
||||
@@ -32,6 +32,7 @@ public class CustomGuiController {
|
||||
|
||||
public static boolean updateGui(IPlayer player, ScriptGui gui) {
|
||||
if (((EntityPlayerMP)player.getMCEntity()).openContainer instanceof ContainerCustomGui) {
|
||||
((ContainerCustomGui)((EntityPlayerMP)player.getMCEntity()).openContainer).setGui(gui, (EntityPlayer)player.getMCEntity());
|
||||
Server.sendDataChecked((EntityPlayerMP)player.getMCEntity(), EnumPacketClient.GUI_DATA, new Object[]{gui.toNBT()});
|
||||
return true;
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user