Paper/CraftBukkit-Patches/0041-Call-EntityChangeBlockEvent-for-Fire-Arrows-hitting-.patch

27 lines
1.2 KiB
Diff
Raw Normal View History

2015-05-25 14:05:40 +02:00
From 91a59b2aec6c0edbab9254c6e0aa0aa3e7fef12c Mon Sep 17 00:00:00 2001
2014-11-28 02:17:45 +01:00
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
2015-02-28 12:36:22 +01:00
index f15b199..40c0a87 100644
2014-11-28 02:17:45 +01:00
--- 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);
}
--
2015-05-09 22:23:26 +02:00
2.1.4
2014-11-28 02:17:45 +01:00