aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorEmilia Kond <[email protected]>2024-02-10 23:19:22 +0200
committerGitHub <[email protected]>2024-02-10 22:19:22 +0100
commit4b58a85158689c1c6f05f5c58b75211aa296d4a2 (patch)
tree37c36f5d5d9fd3278966b49b7659366b8e1a3c5e
parente6a521514ef812eeaa3a381933b06eb0d10d0151 (diff)
downloadPaper-4b58a85158689c1c6f05f5c58b75211aa296d4a2.tar.gz
Paper-4b58a85158689c1c6f05f5c58b75211aa296d4a2.zip
Fire BlockPreDispenseEvent for droppers (#10226)
-rw-r--r--patches/server/0504-Add-BlockPreDispenseEvent.patch12
1 files changed, 12 insertions, 0 deletions
diff --git a/patches/server/0504-Add-BlockPreDispenseEvent.patch b/patches/server/0504-Add-BlockPreDispenseEvent.patch
index 5b8cf80cf5..3a245d3a03 100644
--- a/patches/server/0504-Add-BlockPreDispenseEvent.patch
+++ b/patches/server/0504-Add-BlockPreDispenseEvent.patch
@@ -16,6 +16,18 @@ index 5593a0aa9e618071b6521b213dde0f628348c3dc..644e64850479cea20a98b8a65503ccf3
DispenserBlock.eventFired = false; // CraftBukkit - reset event status
tileentitydispenser.setItem(i, idispensebehavior.dispense(sourceblock, itemstack));
}
+diff --git a/src/main/java/net/minecraft/world/level/block/DropperBlock.java b/src/main/java/net/minecraft/world/level/block/DropperBlock.java
+index 1d13f8a1009d6eda351c697052d499d594a6aaa8..9a8a0fb958e8ec782111507bae957f854b2aac72 100644
+--- a/src/main/java/net/minecraft/world/level/block/DropperBlock.java
++++ b/src/main/java/net/minecraft/world/level/block/DropperBlock.java
+@@ -70,6 +70,7 @@ public class DropperBlock extends DispenserBlock {
+ ItemStack itemstack1;
+
+ if (iinventory == null) {
++ if (!org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockPreDispenseEvent(world, pos, itemstack, i)) return; // Paper - Add BlockPreDispenseEvent
+ itemstack1 = DropperBlock.DISPENSE_BEHAVIOUR.dispense(sourceblock, itemstack);
+ } else {
+ // CraftBukkit start - Fire event when pushing items into other inventories
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 6a95328293e3600b7a560074a0e6083db9cd3e1f..456c1df6b5956b521e8f379b9020ed53f66a365b 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java