private static final boolean DEBUG = Boolean.parseBoolean(System.getProperty("forge.debugBlockEvent", "false"));
@@ -80,17 +85,18 @@
super(x, y, z, world, block, blockMetadata);
this.player = player;
- if (block == null || !ForgeHooks.canHarvestBlock(block, player, blockMetadata) || // Handle empty block or player unable to break block scenario
- block.canSilkHarvest(world, player, x, y, z, blockMetadata) && EnchantmentHelper.getSilkTouchModifier(player)) // If the block is being silk harvested, the exp dropped is 0
+ // Cauldron start - handle event on bukkit side
+ org.bukkit.event.block.BlockBreakEvent bukkitEvent = CraftEventFactory.callBlockBreakEvent(world, x, y, z, block, blockMetadata,
+ (EntityPlayerMP) player);
+ if (bukkitEvent.isCancelled())
{
- this.exp = 0;
+ this.setCanceled(true);
}
else
{
- int meta = block.getDamageValue(world, x, y, z);
- int bonusLevel = EnchantmentHelper.getFortuneModifier(player);