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
|
2024-01-24 22:13:08 +01:00
|
|
|
index 895c2cd385622fcc426e9e920ff35109f444b569..12d3809792384643e550b34e59c58d49869ec05d 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
|
2024-01-24 22:13:08 +01:00
|
|
|
@@ -2342,7 +2342,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());
|
2024-01-19 13:22:30 +01:00
|
|
|
+ this.awardStat(Stats.ITEM_DROPPED.get(itemstack1.getItem()), itemstack1.getCount()); // Paper - Fix PlayerDropItemEvent using wrong item
|
2021-08-06 18:46:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
2024-01-24 11:45:17 +01:00
|
|
|
index caa71993f3ee344151a3e053ba527b868c13251b..b113c886b81d9ac77f16aa5acf7e1d9e61854b9f 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
|
2024-01-24 11:45:17 +01:00
|
|
|
@@ -723,6 +723,11 @@ public abstract class Player extends LivingEntity {
|
2021-06-21 07:12:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
double d0 = this.getEyeY() - 0.30000001192092896D;
|
|
|
|
+ // Paper start
|
2022-03-13 08:47:54 +01:00
|
|
|
+ ItemStack tmp = itemstack.copy();
|
|
|
|
+ itemstack.setCount(0);
|
|
|
|
+ itemstack = tmp;
|
2021-06-21 07:12:04 +02:00
|
|
|
+ // Paper end
|
2023-06-08 04:04:01 +02:00
|
|
|
ItemEntity entityitem = new ItemEntity(this.level(), this.getX(), d0, this.getZ(), itemstack);
|
2021-06-21 07:12:04 +02:00
|
|
|
|
|
|
|
entityitem.setPickUpDelay(40);
|