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-04-12 21:14:06 +02:00
|
|
|
index 28baa63b9b750a7f03da364d9c1fe691d3ce1706..c917b271fb6325840bb791566e9dec607bdd819a 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
|
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
|
|
|
index 8ab62f37c9e1eb1582fba4adc02c3404bebc80f4..4d967016ac34d21161f10217db494f5bb537bd07 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
|
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
|
|
|
@@ -727,6 +727,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);
|