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-10-05 03:14:11 +00:00
|
|
|
index d309e2c460654c2fa7a6668e9f31d330e8e35967..3833c0c863c49c2ff5552030e7a0799cf2ec0614 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-09-25 19:06:37 +00:00
|
|
|
@@ -2161,7 +2161,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-10-05 03:14:11 +00:00
|
|
|
index 3e462d68ce5fa37735c5328997767fa1ef3b869d..fb66da46d2b3a46fe4b8d43f99a1a60f768f5f19 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-07-07 06:52:40 +00:00
|
|
|
@@ -705,6 +705,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);
|