SPIGOT-4361: BlockFadeEvent for regular coral

This commit is contained in:
md_5 2018-09-10 08:30:13 +10:00
parent 3123a069bf
commit 022b8c350a

View file

@ -0,0 +1,14 @@
--- a/net/minecraft/server/BlockCoralPlant.java
+++ b/net/minecraft/server/BlockCoralPlant.java
@@ -18,6 +18,11 @@
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) {
if (!b_(iblockdata, world, blockposition)) {
+ // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world, blockposition, this.c.getBlockData().set(BlockCoralPlant.b, Boolean.valueOf(false))).isCancelled()) {
+ return;
+ }
+ // CraftBukkit end
world.setTypeAndData(blockposition, (IBlockData) this.c.getBlockData().set(BlockCoralPlant.b, Boolean.valueOf(false)), 2);
}