#1529: Fix excess slot updates

This commit is contained in:
AJ Ferguson 2025-01-06 20:31:00 +11:00 committed by md_5
parent fa10c5029f
commit df01cf867a
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

@ -153,7 +153,7 @@
slot.setChanged(); slot.setChanged();
+ // CraftBukkit start - Make sure the client has the right slot contents + // CraftBukkit start - Make sure the client has the right slot contents
+ if (entityhuman instanceof EntityPlayer && slot.getMaxStackSize() != 64) { + if (entityhuman instanceof EntityPlayer && slot.getMaxStackSize() != IInventory.MAX_STACK) {
+ ((EntityPlayer) entityhuman).connection.send(new PacketPlayOutSetSlot(this.containerId, this.incrementStateId(), slot.index, slot.getItem())); + ((EntityPlayer) entityhuman).connection.send(new PacketPlayOutSetSlot(this.containerId, this.incrementStateId(), slot.index, slot.getItem()));
+ // Updating a crafting inventory makes the client reset the result slot, have to send it again + // Updating a crafting inventory makes the client reset the result slot, have to send it again
+ if (this.getBukkitView().getType() == InventoryType.WORKBENCH || this.getBukkitView().getType() == InventoryType.CRAFTING) { + if (this.getBukkitView().getType() == InventoryType.WORKBENCH || this.getBukkitView().getType() == InventoryType.CRAFTING) {