aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0802-Fix-HumanEntity-drop-not-updating-the-client-inv.patch
diff options
context:
space:
mode:
authorSpottedleaf <[email protected]>2024-07-17 10:24:53 -0700
committerSpottedleaf <[email protected]>2024-07-17 10:28:32 -0700
commit00b949f1bbbf444e2b5e7b8de7c9b14fbd2133c6 (patch)
tree82639515bc5e9ae00c1e639e72137ed51e1ac688 /patches/server/0802-Fix-HumanEntity-drop-not-updating-the-client-inv.patch
parent967f98aa81da851740aeb429778e46159fd188df (diff)
downloadPaper-00b949f1bbbf444e2b5e7b8de7c9b14fbd2133c6.tar.gz
Paper-00b949f1bbbf444e2b5e7b8de7c9b14fbd2133c6.zip
Remove Moonrise utils to MCUtils, remove duplicated/unused utils
Diffstat (limited to 'patches/server/0802-Fix-HumanEntity-drop-not-updating-the-client-inv.patch')
-rw-r--r--patches/server/0802-Fix-HumanEntity-drop-not-updating-the-client-inv.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/patches/server/0802-Fix-HumanEntity-drop-not-updating-the-client-inv.patch b/patches/server/0802-Fix-HumanEntity-drop-not-updating-the-client-inv.patch
new file mode 100644
index 0000000000..99130d8f1a
--- /dev/null
+++ b/patches/server/0802-Fix-HumanEntity-drop-not-updating-the-client-inv.patch
@@ -0,0 +1,30 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jake Potrebic <[email protected]>
+Date: Sun, 10 Oct 2021 18:18:01 -0700
+Subject: [PATCH] Fix HumanEntity#drop not updating the client inv
+
+== AT ==
+public net.minecraft.server.level.ServerPlayer containerSynchronizer
+
+diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+index 9ab3fc287480aedcb4033801d4f092719e933454..12ab8f7cde88cd6ce3ad474fe2843d5d30c3c0d7 100644
+--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+@@ -751,8 +751,15 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
+ // Paper end
+ @Override
+ public boolean dropItem(boolean dropAll) {
+- if (!(this.getHandle() instanceof ServerPlayer)) return false;
+- return ((ServerPlayer) this.getHandle()).drop(dropAll);
++ // Paper start - Fix HumanEntity#drop not updating the client inv
++ if (!(this.getHandle() instanceof ServerPlayer player)) return false;
++ boolean success = player.drop(dropAll);
++ if (!success) return false;
++ final net.minecraft.world.entity.player.Inventory inv = player.getInventory();
++ final java.util.OptionalInt optionalSlot = player.containerMenu.findSlot(inv, inv.selected);
++ optionalSlot.ifPresent(slot -> player.containerSynchronizer.sendSlotChange(player.containerMenu, slot, inv.getSelected()));
++ return true;
++ // Paper end - Fix HumanEntity#drop not updating the client inv
+ }
+
+ @Override