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
|
2022-11-10 00:05:46 +00:00
|
|
|
index f033a1a2bb3e44d30107bf1494b315cdc0c94b56..5bbc8f5f1f5c66ae6d1128d87fb7dde0b546387e 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
|
2022-11-10 00:05:46 +00:00
|
|
|
@@ -2202,7 +2202,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
|
2022-07-27 21:19:52 +00:00
|
|
|
index a6bd94ed379ef1ab0ffe71183aef3cf3061fd092..92a5aadef076cb905962dab86f32d4ff253fef93 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
|
2022-07-27 21:19:52 +00:00
|
|
|
@@ -723,6 +723,11 @@ public abstract class Player extends LivingEntity {
|
2021-06-21 05:12:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
double d0 = this.getEyeY() - 0.30000001192092896D;
|
|
|
|
+ // Paper start
|
2022-03-13 07:47:54 +00:00
|
|
|
+ ItemStack tmp = itemstack.copy();
|
|
|
|
+ itemstack.setCount(0);
|
|
|
|
+ itemstack = tmp;
|
2021-06-21 05:12:04 +00:00
|
|
|
+ // Paper end
|
2022-03-13 07:47:54 +00:00
|
|
|
ItemEntity entityitem = new ItemEntity(this.level, this.getX(), d0, this.getZ(), itemstack);
|
2021-06-21 05:12:04 +00:00
|
|
|
|
|
|
|
entityitem.setPickUpDelay(40);
|