2021-06-21 05:12:04 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
|
|
|
Date: Sun, 20 Jun 2021 21:55:59 -0700
|
|
|
|
Subject: [PATCH] Fix PlayerDropItemEvent using wrong item
|
|
|
|
|
|
|
|
|
2021-08-06 16:46:25 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
2021-11-25 11:20:13 +00:00
|
|
|
index b6230ce81d50da84b2db9446232c83bde3632a91..df0b08628d736b7f75120f1b9840784f6c472853 100644
|
2021-08-06 16:46:25 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
2021-11-25 11:20:13 +00:00
|
|
|
@@ -2176,7 +2176,7 @@ public class ServerPlayer extends Player {
|
2021-08-06 16:46:25 +00:00
|
|
|
|
|
|
|
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);
|
2021-06-21 05:12:04 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
2021-11-29 11:55:13 +00:00
|
|
|
index a67a04cbb94edd02918809d5654399952d2597a2..56110f0022c99dad562e9398f4f34b993eda4923 100644
|
2021-06-21 05:12:04 +00:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
2021-11-24 23:26:29 +00:00
|
|
|
@@ -703,6 +703,11 @@ public abstract class Player extends LivingEntity {
|
2021-06-21 05:12:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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);
|