From 452bb319db2549a3c2584606943c105b278aa9ba Mon Sep 17 00:00:00 2001 From: granny Date: Fri, 13 Jun 2025 21:53:25 -0700 Subject: [PATCH] port PaperMC/Paper#12654, closes #1665 --- .../world/inventory/AbstractContainerMenu.java.patch | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/inventory/AbstractContainerMenu.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/inventory/AbstractContainerMenu.java.patch index bca7321cd..f1681845d 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/inventory/AbstractContainerMenu.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/inventory/AbstractContainerMenu.java.patch @@ -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) {