Fix ITEM_DROPPED stat not working properly (#6331)
This commit is contained in:
parent
020f18aaa6
commit
c815948b6d
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue