port PaperMC/Paper#12654, closes #1665

This commit is contained in:
granny
2025-06-13 21:53:25 -07:00
parent 293e28a048
commit 452bb319db

View File

@@ -8,3 +8,12 @@
// CraftBukkit start
public boolean checkReachable = true;
public abstract org.bukkit.inventory.InventoryView getBukkitView();
@@ -552,7 +_,7 @@
slot.setChanged();
// CraftBukkit start - Make sure the client has the right slot contents
- if (player instanceof ServerPlayer serverPlayer && slot.getMaxStackSize() != 64) {
+ if (player instanceof ServerPlayer serverPlayer && slot.getMaxStackSize() != net.minecraft.world.Container.MAX_STACK) { // Purpur - PaperPR#12654
serverPlayer.connection.send(new net.minecraft.network.protocol.game.ClientboundContainerSetSlotPacket(this.containerId, this.incrementStateId(), slot.index, slot.getItem()));
// Updating a crafting inventory makes the client reset the result slot, have to send it again
if (this.getBukkitView().getType() == org.bukkit.event.inventory.InventoryType.WORKBENCH || this.getBukkitView().getType() == org.bukkit.event.inventory.InventoryType.CRAFTING) {