aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0584-Fix-PlayerDropItemEvent-using-wrong-item.patch
diff options
context:
space:
mode:
authormaxcom1 <[email protected]>2024-03-23 22:26:17 +0100
committerGitHub <[email protected]>2024-03-23 17:26:17 -0400
commitb6001403e9703cadaa6e8c8558e732b91c3c6d6e (patch)
treea8c57bbc334a8ad48d4ad2b43db335667b142bee /patches/server/0584-Fix-PlayerDropItemEvent-using-wrong-item.patch
parent9ec7dfcbc41c6e625de0050b6997160a75df9f44 (diff)
downloadPaper-b6001403e9703cadaa6e8c8558e732b91c3c6d6e.tar.gz
Paper-b6001403e9703cadaa6e8c8558e732b91c3c6d6e.zip
Add methods to change entity physics (#10334)
Diffstat (limited to 'patches/server/0584-Fix-PlayerDropItemEvent-using-wrong-item.patch')
-rw-r--r--patches/server/0584-Fix-PlayerDropItemEvent-using-wrong-item.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/patches/server/0584-Fix-PlayerDropItemEvent-using-wrong-item.patch b/patches/server/0584-Fix-PlayerDropItemEvent-using-wrong-item.patch
new file mode 100644
index 0000000000..e0ef67f1e5
--- /dev/null
+++ b/patches/server/0584-Fix-PlayerDropItemEvent-using-wrong-item.patch
@@ -0,0 +1,35 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Spottedleaf <[email protected]>
+Date: Sun, 20 Jun 2021 21:55:59 -0700
+Subject: [PATCH] Fix PlayerDropItemEvent using wrong item
+
+
+diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
+index a09ef51e94a0bf9f51bf358e7cf77dd5d272aab2..d0369b9db86dc3436e6a016f138f2ffe91da6ed4 100644
+--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
++++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
+@@ -2342,7 +2342,7 @@ public class ServerPlayer extends Player {
+
+ if (retainOwnership) {
+ if (!itemstack1.isEmpty()) {
+- this.awardStat(Stats.ITEM_DROPPED.get(itemstack1.getItem()), stack.getCount());
++ this.awardStat(Stats.ITEM_DROPPED.get(itemstack1.getItem()), itemstack1.getCount()); // Paper - Fix PlayerDropItemEvent using wrong item
+ }
+
+ this.awardStat(Stats.DROP);
+diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
+index 8ab62f37c9e1eb1582fba4adc02c3404bebc80f4..4d967016ac34d21161f10217db494f5bb537bd07 100644
+--- a/src/main/java/net/minecraft/world/entity/player/Player.java
++++ b/src/main/java/net/minecraft/world/entity/player/Player.java
+@@ -727,6 +727,11 @@ public abstract class Player extends LivingEntity {
+ }
+
+ double d0 = this.getEyeY() - 0.30000001192092896D;
++ // Paper start
++ ItemStack tmp = itemstack.copy();
++ itemstack.setCount(0);
++ itemstack = tmp;
++ // Paper end
+ ItemEntity entityitem = new ItemEntity(this.level(), this.getX(), d0, this.getZ(), itemstack);
+
+ entityitem.setPickUpDelay(40);