aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0681-Fix-PlayerDropItemEvent-using-wrong-item.patch
diff options
context:
space:
mode:
authorJason <[email protected]>2022-01-02 11:06:08 -0800
committerGitHub <[email protected]>2022-01-02 11:06:08 -0800
commit79dd62ae620c082646b2f376451cceb52d3b4618 (patch)
tree78cd480e874b2f56f7999b5cefccc4461487970d /patches/server/0681-Fix-PlayerDropItemEvent-using-wrong-item.patch
parent19bc61248328208d0ab0ca43258e958c645637b5 (diff)
downloadPaper-79dd62ae620c082646b2f376451cceb52d3b4618.tar.gz
Paper-79dd62ae620c082646b2f376451cceb52d3b4618.zip
Use AreaMap for per-player mob spawning (#7235)
Diffstat (limited to 'patches/server/0681-Fix-PlayerDropItemEvent-using-wrong-item.patch')
-rw-r--r--patches/server/0681-Fix-PlayerDropItemEvent-using-wrong-item.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/patches/server/0681-Fix-PlayerDropItemEvent-using-wrong-item.patch b/patches/server/0681-Fix-PlayerDropItemEvent-using-wrong-item.patch
new file mode 100644
index 0000000000..48d78de6bd
--- /dev/null
+++ b/patches/server/0681-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 77ba7fe43ceffcb816d209da45ab0c5de2112ee3..6f5be46ae4c4f53695cdc5954352a2589842ede6 100644
+--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
++++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
+@@ -2176,7 +2176,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 ec44db1e6a6c92d8aff241b5f9acf743d3088fea..ef18f69b54b68da84f6ab9f70aa47e2f716cf9a5 100644
+--- a/src/main/java/net/minecraft/world/entity/player/Player.java
++++ b/src/main/java/net/minecraft/world/entity/player/Player.java
+@@ -703,6 +703,11 @@ public abstract class Player extends LivingEntity {
+ }
+
+ double d0 = this.getEyeY() - 0.30000001192092896D;
++ // Paper start
++ ItemStack tmp = stack.copy();
++ stack.setCount(0);
++ stack = tmp;
++ // Paper end
+ ItemEntity entityitem = new ItemEntity(this.level, this.getX(), d0, this.getZ(), stack);
+
+ entityitem.setPickUpDelay(40);