From c815948b6d934a2b995a213422680a290a5a4f36 Mon Sep 17 00:00:00 2001 From: Noah van der Aa Date: Fri, 6 Aug 2021 18:46:25 +0200 Subject: [PATCH] Fix ITEM_DROPPED stat not working properly (#6331) --- ...Fix-PlayerDropItemEvent-using-wrong-item.patch | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/patches/server/0713-Fix-PlayerDropItemEvent-using-wrong-item.patch b/patches/server/0713-Fix-PlayerDropItemEvent-using-wrong-item.patch index 4802171670..e0e095444b 100644 --- a/patches/server/0713-Fix-PlayerDropItemEvent-using-wrong-item.patch +++ b/patches/server/0713-Fix-PlayerDropItemEvent-using-wrong-item.patch @@ -4,8 +4,21 @@ 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 5b2b6747768e638423c86ce13a419f5a3f63d30d..764ce055a28f355a205c67f60632cac1bd8eb182 100644 +--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java ++++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +@@ -2161,7 +2161,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 d197a63bac1238020cd6cacf209bc7c1b463040d..19980b2d627eb3cacf8d0c3e6785ad2206910fbc 100644 +index 503c4e296d6f59c6480f6fb9ff5fed47b25d6102..d8780f06efc261a42389e466573a0bcf10c333f6 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java @@ -705,6 +705,11 @@ public abstract class Player extends LivingEntity {