PaperMC/CraftBukkit-Patches/0042-Call-EntityChangeBlockEvent-for-Fire-Arrows-hitting-.patch
Zach Brown c7f1eed0bf Update from upstream SpigotMC
3beb7729816
a77ed5758a7
52c130fc6d9
2014-12-20 19:09:49 -06:00

26 lines
1.2 KiB
Diff

From 77f83517725bbe81f918b968045d2f319a7fea82 Mon Sep 17 00:00:00 2001
From: BlackHole <black-hole@live.com>
Date: Tue, 16 Jul 2013 22:34:50 +0200
Subject: [PATCH] Call EntityChangeBlockEvent for Fire Arrows hitting TNT
Adds BUKKIT-4355
diff --git a/src/main/java/net/minecraft/server/BlockTNT.java b/src/main/java/net/minecraft/server/BlockTNT.java
index cc61759..7443873 100644
--- a/src/main/java/net/minecraft/server/BlockTNT.java
+++ b/src/main/java/net/minecraft/server/BlockTNT.java
@@ -77,6 +77,11 @@ public class BlockTNT extends Block {
EntityArrow entityarrow = (EntityArrow) entity;
if (entityarrow.isBurning()) {
+ // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entityarrow, blockposition.getX(), blockposition.getY(), blockposition.getZ(), 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);
}
--
2.1.0