mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-18 14:24:17 +08:00
SPIGOT-4194: Call BlockFadeEvent for coral
This commit is contained in:
parent
e013bf4323
commit
5cfa68387f
14
nms-patches/BlockCoral.patch
Normal file
14
nms-patches/BlockCoral.patch
Normal file
@ -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);
|
||||||
|
}
|
||||||
|
|
14
nms-patches/BlockCoralFan.patch
Normal file
14
nms-patches/BlockCoralFan.patch
Normal file
@ -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);
|
||||||
|
}
|
||||||
|
|
14
nms-patches/BlockCoralFanWall.patch
Normal file
14
nms-patches/BlockCoralFanWall.patch
Normal file
@ -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);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user