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

36 lines
1.6 KiB
Diff
Raw Normal View History

2013-12-09 08:00:58 +01:00
From 8586adc42e4b3692d487b365faa21596f20509f2 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
2013-12-01 06:17:16 +01:00
index 6d5090b..50e2fa0 100644
--- a/src/main/java/net/minecraft/server/BlockTNT.java
+++ b/src/main/java/net/minecraft/server/BlockTNT.java
@@ -54,7 +54,7 @@ public class BlockTNT extends Block {
public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman, int l, float f, float f1, float f2) {
2013-12-01 05:13:58 +01:00
if (entityhuman.bD() != null && entityhuman.bD().getItem() == Items.FLINT_AND_STEEL) {
- this.a(world, i, j, k, 1, entityhuman);
+ this.a(world, i, j, k, 1, (EntityLiving) entityhuman); // Spigot - Fix decompile error!
world.setAir(i, j, k);
2013-12-01 05:13:58 +01:00
entityhuman.bD().damage(1, entityhuman);
return true;
@@ -68,6 +68,11 @@ public class BlockTNT extends Block {
EntityArrow entityarrow = (EntityArrow) entity;
if (entityarrow.isBurning()) {
+ // CraftBukkit start
2013-12-01 06:17:16 +01:00
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entityarrow, i, j, k, Blocks.AIR, 0).isCancelled()) {
+ return;
+ }
+ // CraftBukkit end
this.a(world, i, j, k, 1, entityarrow.shooter instanceof EntityLiving ? (EntityLiving) entityarrow.shooter : null);
world.setAir(i, j, k);
}
--
2013-12-01 04:40:53 +01:00
1.8.3.2