aboutsummaryrefslogtreecommitdiffhomepage
path: root/paper-server/patches/unapplied/net/minecraft/world/item/ItemUtils.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'paper-server/patches/unapplied/net/minecraft/world/item/ItemUtils.java.patch')
-rw-r--r--paper-server/patches/unapplied/net/minecraft/world/item/ItemUtils.java.patch19
1 files changed, 19 insertions, 0 deletions
diff --git a/paper-server/patches/unapplied/net/minecraft/world/item/ItemUtils.java.patch b/paper-server/patches/unapplied/net/minecraft/world/item/ItemUtils.java.patch
new file mode 100644
index 0000000000..163c53a0d4
--- /dev/null
+++ b/paper-server/patches/unapplied/net/minecraft/world/item/ItemUtils.java.patch
@@ -0,0 +1,19 @@
+--- a/net/minecraft/world/item/ItemUtils.java
++++ b/net/minecraft/world/item/ItemUtils.java
+@@ -41,7 +41,15 @@
+ public static void onContainerDestroyed(ItemEntity itemEntity, Iterable<ItemStack> contents) {
+ Level level = itemEntity.level();
+ if (!level.isClientSide) {
+- contents.forEach(stack -> level.addFreshEntity(new ItemEntity(level, itemEntity.getX(), itemEntity.getY(), itemEntity.getZ(), stack)));
++ // Paper start - call EntityDropItemEvent
++ contents.forEach(stack -> {
++ ItemEntity droppedItem = new ItemEntity(level, itemEntity.getX(), itemEntity.getY(), itemEntity.getZ(), stack);
++ org.bukkit.event.entity.EntityDropItemEvent event = new org.bukkit.event.entity.EntityDropItemEvent(itemEntity.getBukkitEntity(), (org.bukkit.entity.Item) droppedItem.getBukkitEntity());
++ if (event.callEvent()) {
++ level.addFreshEntity(droppedItem);
++ }
++ });
++ // Paper end - call EntityDropItemEvent
+ }
+ }
+ }