From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Spottedleaf 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 e4c6bff2a1e601266d889cc0532827d0c8885ece..d9cacc372e1d40e6b2b5d83c88a01121b7f3f101 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -2221,7 +2221,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 eb0f9c2e54d75ee80bcc421d1042d1eea7c57a16..997b2458a3e14296437e76737b837d90d4936072 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java @@ -722,6 +722,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);