aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0634-Fix-PlayerDropItemEvent-using-wrong-item.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0634-Fix-PlayerDropItemEvent-using-wrong-item.patch')
-rw-r--r--patches/server/0634-Fix-PlayerDropItemEvent-using-wrong-item.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/patches/server/0634-Fix-PlayerDropItemEvent-using-wrong-item.patch b/patches/server/0634-Fix-PlayerDropItemEvent-using-wrong-item.patch
new file mode 100644
index 0000000000..20cc2dfe64
--- /dev/null
+++ b/patches/server/0634-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 c126bdaf557ae4a95e7111e0cc8a7f97f722e86c..dc134bfac4fb2bef6d99c7c88cb680d87808a5f7 100644
+--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
++++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
+@@ -2294,7 +2294,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
+ }
+
+ 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 b3634a1d92182c746948862fc64b2e47d11320ba..8f604924b47ed4027f4212007530b6d0c39f73a9 100644
+--- a/src/main/java/net/minecraft/world/entity/player/Player.java
++++ b/src/main/java/net/minecraft/world/entity/player/Player.java
+@@ -724,6 +724,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);