From ccd47a503a73a68cf0b45ff0f0277601ebd1b3f6 Mon Sep 17 00:00:00 2001 From: Brokkonaut Date: Thu, 14 Nov 2019 23:48:57 +0100 Subject: [PATCH] SPIGOT-5395: Call BlockFadeEvent for Scaffolding --- nms-patches/BlockScaffolding.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 nms-patches/BlockScaffolding.patch diff --git a/nms-patches/BlockScaffolding.patch b/nms-patches/BlockScaffolding.patch new file mode 100644 index 0000000000..5b249485c3 --- /dev/null +++ b/nms-patches/BlockScaffolding.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/server/BlockScaffolding.java ++++ b/net/minecraft/server/BlockScaffolding.java +@@ -78,7 +78,7 @@ + int i = a((IBlockAccess) world, blockposition); + IBlockData iblockdata1 = (IBlockData) ((IBlockData) iblockdata.set(BlockScaffolding.a, i)).set(BlockScaffolding.c, this.a(world, blockposition, i)); + +- if ((Integer) iblockdata1.get(BlockScaffolding.a) == 7) { ++ if ((Integer) iblockdata1.get(BlockScaffolding.a) == 7 && !org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world, blockposition, Blocks.AIR.getBlockData()).isCancelled()) { // CraftBukkit - BlockFadeEvent + if ((Integer) iblockdata.get(BlockScaffolding.a) == 7) { + world.addEntity(new EntityFallingBlock(world, (double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, (IBlockData) iblockdata1.set(BlockScaffolding.b, false))); + } else {