summaryrefslogtreecommitdiffstats
path: root/nms-patches/BlockTNT.patch
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2016-07-08 11:20:15 +1000
committermd_5 <git@md-5.net>2016-07-08 11:20:15 +1000
commite3b4dd3d9a663d5e76a9c9fdd026cbf9f199dc38 (patch)
tree277a0fd57807dacbae0a2d47838b189f9da00e94 /nms-patches/BlockTNT.patch
parentd7c257e120996eab1eab7d2bc5a31749ccbe274a (diff)
downloadcraftbukkit-e3b4dd3d9a663d5e76a9c9fdd026cbf9f199dc38.tar
craftbukkit-e3b4dd3d9a663d5e76a9c9fdd026cbf9f199dc38.tar.gz
craftbukkit-e3b4dd3d9a663d5e76a9c9fdd026cbf9f199dc38.tar.lz
craftbukkit-e3b4dd3d9a663d5e76a9c9fdd026cbf9f199dc38.tar.xz
craftbukkit-e3b4dd3d9a663d5e76a9c9fdd026cbf9f199dc38.zip
Call EntityChangeBlockEvent for Fire Arrows hitting TNT
Diffstat (limited to 'nms-patches/BlockTNT.patch')
-rw-r--r--nms-patches/BlockTNT.patch14
1 files changed, 14 insertions, 0 deletions
diff --git a/nms-patches/BlockTNT.patch b/nms-patches/BlockTNT.patch
new file mode 100644
index 00000000..ef5838b9
--- /dev/null
+++ b/nms-patches/BlockTNT.patch
@@ -0,0 +1,14 @@
+--- a/net/minecraft/server/BlockTNT.java
++++ b/net/minecraft/server/BlockTNT.java
+@@ -75,6 +75,11 @@
+ EntityArrow entityarrow = (EntityArrow) entity;
+
+ if (entityarrow.isBurning()) {
++ // CraftBukkit start
++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entityarrow, blockposition, Blocks.AIR, 0).isCancelled()) {
++ return;
++ }
++ // CraftBukkit end
+ this.a(world, blockposition, world.getType(blockposition).set(BlockTNT.EXPLODE, Boolean.valueOf(true)), entityarrow.shooter instanceof EntityLiving ? (EntityLiving) entityarrow.shooter : null);
+ world.setAir(blockposition);
+ }