Add BlockPreDispenseEvent

This commit is contained in:
Madeline Miller
2021-01-17 13:16:09 +10:00
parent cd4969468c
commit b69f8fb10b
3 changed files with 12 additions and 2 deletions

View File

@@ -2132,5 +2132,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 = 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();
}
// Paper end
}