2021-06-21 07:12:04 +02: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 18:46:25 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
2021-08-26 04:16:27 +02:00
|
|
|
index 0406d7fc88a0d42f0085d6736f54ff699f11e99d..0b648abb4e7a116912b327641a810b4ec574baff 100644
|
2021-08-06 18:46:25 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
2021-08-26 04:16:27 +02:00
|
|
|
@@ -2163,7 +2163,7 @@ public class ServerPlayer extends Player {
|
2021-08-06 18:46:25 +02: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 07:12:04 +02: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-08-06 18:46:25 +02:00
|
|
|
index 503c4e296d6f59c6480f6fb9ff5fed47b25d6102..d8780f06efc261a42389e466573a0bcf10c333f6 100644
|
2021-06-21 07:12:04 +02: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 08:52:40 +02:00
|
|
|
@@ -705,6 +705,11 @@ public abstract class Player extends LivingEntity {
|
2021-06-21 07:12:04 +02: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);
|