--- a/net/minecraft/world/level/block/BlockCrops.java +++ b/net/minecraft/world/level/block/BlockCrops.java @@ -18,6 +18,8 @@ import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShapeCollision; +import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit + public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement { public static final BlockStateInteger AGE = BlockProperties.ai; @@ -72,7 +74,7 @@ float f = a((Block) this, (IBlockAccess) worldserver, blockposition); if (random.nextInt((int) (25.0F / f) + 1) == 0) { - worldserver.setTypeAndData(blockposition, this.setAge(i + 1), 2); + CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, this.setAge(i + 1), 2); // CraftBukkit } } } @@ -87,7 +89,7 @@ i = j; } - world.setTypeAndData(blockposition, this.setAge(i), 2); + CraftEventFactory.handleBlockGrowEvent(world, blockposition, this.setAge(i), 2); // CraftBukkit } protected int a(World world) { @@ -145,7 +147,7 @@ @Override public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) { - if (entity instanceof EntityRavager && world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { + if (entity instanceof EntityRavager && !CraftEventFactory.callEntityChangeBlockEvent(entity, blockposition, Blocks.AIR.getBlockData(), !world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)).isCancelled()) { // CraftBukkit world.a(blockposition, true, entity); }