summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-07-31 10:17:43 +1000
committermd_5 <git@md-5.net>2018-07-31 10:17:43 +1000
commit5cfa68387f8b4befb06c212cdc77c23e37855ff1 (patch)
tree4a5b96916c0c0e93d7b7131c392d73438446ee24
parente013bf4323f22fe27da23bf77c22e3cd15921590 (diff)
downloadcraftbukkit-5cfa68387f8b4befb06c212cdc77c23e37855ff1.tar
craftbukkit-5cfa68387f8b4befb06c212cdc77c23e37855ff1.tar.gz
craftbukkit-5cfa68387f8b4befb06c212cdc77c23e37855ff1.tar.lz
craftbukkit-5cfa68387f8b4befb06c212cdc77c23e37855ff1.tar.xz
craftbukkit-5cfa68387f8b4befb06c212cdc77c23e37855ff1.zip
SPIGOT-4194: Call BlockFadeEvent for coral
-rw-r--r--nms-patches/BlockCoral.patch14
-rw-r--r--nms-patches/BlockCoralFan.patch14
-rw-r--r--nms-patches/BlockCoralFanWall.patch14
3 files changed, 42 insertions, 0 deletions
diff --git a/nms-patches/BlockCoral.patch b/nms-patches/BlockCoral.patch
new file mode 100644
index 00000000..6b5b5afc
--- /dev/null
+++ b/nms-patches/BlockCoral.patch
@@ -0,0 +1,14 @@
+--- a/net/minecraft/server/BlockCoral.java
++++ b/net/minecraft/server/BlockCoral.java
+@@ -14,6 +14,11 @@
+
+ public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) {
+ if (!this.a((IBlockAccess) world, blockposition)) {
++ // CraftBukkit start
++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world, blockposition, this.a.getBlockData()).isCancelled()) {
++ return;
++ }
++ // CraftBukkit end
+ world.setTypeAndData(blockposition, this.a.getBlockData(), 2);
+ }
+
diff --git a/nms-patches/BlockCoralFan.patch b/nms-patches/BlockCoralFan.patch
new file mode 100644
index 00000000..6214c646
--- /dev/null
+++ b/nms-patches/BlockCoralFan.patch
@@ -0,0 +1,14 @@
+--- a/net/minecraft/server/BlockCoralFan.java
++++ b/net/minecraft/server/BlockCoralFan.java
+@@ -17,6 +17,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.b.getBlockData().set(BlockCoralFan.a, Boolean.valueOf(false))).isCancelled()) {
++ return;
++ }
++ // CraftBukkit end
+ world.setTypeAndData(blockposition, (IBlockData) this.b.getBlockData().set(BlockCoralFan.a, Boolean.valueOf(false)), 2);
+ }
+
diff --git a/nms-patches/BlockCoralFanWall.patch b/nms-patches/BlockCoralFanWall.patch
new file mode 100644
index 00000000..6c2adc68
--- /dev/null
+++ b/nms-patches/BlockCoralFanWall.patch
@@ -0,0 +1,14 @@
+--- a/net/minecraft/server/BlockCoralFanWall.java
++++ b/net/minecraft/server/BlockCoralFanWall.java
+@@ -17,6 +17,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(BlockCoralFanWall.a, Boolean.valueOf(false)).set(BlockCoralFanWall.b, iblockdata.get(BlockCoralFanWall.b))).isCancelled()) {
++ return;
++ }
++ // CraftBukkit end
+ world.setTypeAndData(blockposition, (IBlockData) ((IBlockData) this.c.getBlockData().set(BlockCoralFanWall.a, Boolean.valueOf(false))).set(BlockCoralFanWall.b, iblockdata.get(BlockCoralFanWall.b)), 2);
+ }
+