SPIGOT-2942: give command fires PlayerDropItemEvent, cancelling it causes Item Duplication

By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
CraftBukkit/Spigot
2022-03-11 21:47:13 +01:00
parent 1a135e792f
commit 06bac38719
2 changed files with 50 additions and 22 deletions

View File

@@ -0,0 +1,11 @@
--- a/net/minecraft/server/commands/CommandGive.java
+++ b/net/minecraft/server/commands/CommandGive.java
@@ -59,7 +59,7 @@
if (flag && itemstack.isEmpty()) {
itemstack.setCount(1);
- entityitem = entityplayer.drop(itemstack, false);
+ entityitem = entityplayer.drop(itemstack, false, false, false); // SPIGOT-2942: Add boolean to call event
if (entityitem != null) {
entityitem.makeFakeItem();
}