3
0
KCauldronX/patches/net/minecraft/entity/ai/EntityAIArrowAttack.java.patch
2015-03-22 20:38:04 +03:00

26 lines
1011 B
Diff

--- ../src-base/minecraft/net/minecraft/entity/ai/EntityAIArrowAttack.java
+++ ../src-work/minecraft/net/minecraft/entity/ai/EntityAIArrowAttack.java
@@ -5,6 +5,11 @@
import net.minecraft.entity.IRangedAttackMob;
import net.minecraft.util.MathHelper;
+// CraftBukkit start
+import net.minecraft.entity.Entity;
+import org.bukkit.event.entity.EntityTargetEvent;
+// CraftBukkit end
+
public class EntityAIArrowAttack extends EntityAIBase
{
private final EntityLiving entityHost;
@@ -67,6 +72,10 @@
public void resetTask()
{
+ // CraftBukkit start
+ EntityTargetEvent.TargetReason reason = this.attackTarget.isEntityAlive() ? EntityTargetEvent.TargetReason.FORGOT_TARGET : EntityTargetEvent.TargetReason.TARGET_DIED;
+ org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTargetEvent((Entity) rangedAttackEntityHost, null, reason);
+ // CraftBukkit end
this.attackTarget = null;
this.field_75318_f = 0;
this.rangedAttackTime = -1;