mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-30 19:40:37 +01:00
Fire BlockPreDispenseEvent for droppers (#10226)
This commit is contained in:
parent
e8e83aefff
commit
1ba0d87cba
1 changed files with 12 additions and 0 deletions
|
@ -16,6 +16,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/DropperBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/DropperBlock.java
|
||||
@@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
|
|
Loading…
Add table
Reference in a new issue