diff --git a/nms-patches/BlockTurtleEgg.patch b/nms-patches/BlockTurtleEgg.patch index b56a20026d..13b7e6144f 100644 --- a/nms-patches/BlockTurtleEgg.patch +++ b/nms-patches/BlockTurtleEgg.patch @@ -33,7 +33,28 @@ this.a(world, blockposition, world.getType(blockposition)); } -@@ -70,7 +89,7 @@ +@@ -57,9 +76,19 @@ + int i = (Integer) iblockdata.get(BlockTurtleEgg.a); + + if (i < 2) { ++ // CraftBukkit start - Call BlockGrowEvent ++ if (!CraftEventFactory.handleBlockGrowEvent(world, blockposition, iblockdata.set(BlockTurtleEgg.a, i + 1), 2)) { ++ return; ++ } ++ // CraftBukkit end + world.a((EntityHuman) null, blockposition, SoundEffects.ENTITY_TURTLE_EGG_CRACK, SoundCategory.BLOCKS, 0.7F, 0.9F + random.nextFloat() * 0.2F); +- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockTurtleEgg.a, i + 1), 2); ++ // world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockTurtleEgg.a, i + 1), 2); // CraftBukkit - handled above + } else { ++ // CraftBukkit start - Call BlockFadeEvent ++ if (CraftEventFactory.callBlockFadeEvent(world, blockposition, Blocks.AIR.getBlockData()).isCancelled()) { ++ return; ++ } ++ // CraftBukkit end + world.a((EntityHuman) null, blockposition, SoundEffects.ENTITY_TURTLE_EGG_HATCH, SoundCategory.BLOCKS, 0.7F, 0.9F + random.nextFloat() * 0.2F); + world.setAir(blockposition); + if (!world.isClientSide) { +@@ -70,7 +99,7 @@ entityturtle.setAgeRaw(-24000); entityturtle.g(blockposition); entityturtle.setPositionRotation((double) blockposition.getX() + 0.3D + (double) j * 0.2D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.3D, 0.0F, 0.0F);