diff options
Diffstat (limited to 'patches/server/0504-Add-BlockPreDispenseEvent.patch')
-rw-r--r-- | patches/server/0504-Add-BlockPreDispenseEvent.patch | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/patches/server/0504-Add-BlockPreDispenseEvent.patch b/patches/server/0504-Add-BlockPreDispenseEvent.patch index 9e6a751723..5b8cf80cf5 100644 --- a/patches/server/0504-Add-BlockPreDispenseEvent.patch +++ b/patches/server/0504-Add-BlockPreDispenseEvent.patch @@ -17,16 +17,16 @@ index 5593a0aa9e618071b6521b213dde0f628348c3dc..644e64850479cea20a98b8a65503ccf3 tileentitydispenser.setItem(i, idispensebehavior.dispense(sourceblock, itemstack)); } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 0887f8102b703ede1e528345851e48f786dc7c58..1e45ca6c042fe86785ac36645e1ce2f5a85a8d23 100644 +index 6a95328293e3600b7a560074a0e6083db9cd3e1f..456c1df6b5956b521e8f379b9020ed53f66a365b 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -2047,5 +2047,11 @@ public class CraftEventFactory { +@@ -2079,5 +2079,11 @@ public class CraftEventFactory { io.papermc.paper.event.block.BlockFailedDispenseEvent event = new io.papermc.paper.event.block.BlockFailedDispenseEvent(block); return event.callEvent(); } + + public static boolean handleBlockPreDispenseEvent(ServerLevel serverLevel, BlockPos pos, ItemStack itemStack, int slot) { -+ org.bukkit.block.Block block = serverLevel.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ()); ++ org.bukkit.block.Block block = CraftBlock.at(serverLevel, pos); + io.papermc.paper.event.block.BlockPreDispenseEvent event = new io.papermc.paper.event.block.BlockPreDispenseEvent(block, org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemStack), slot); + return event.callEvent(); + } |