[Bleeding] Call EntityTargetEvent in many new places.

Adds BUKKIT-5388, BUKKIT-5387, BUKKIT-5386, BUKKIT-5483, BUKKIT-5484.
Fixes BUKKIT-5389.
This commit is contained in:
GJ
2014-02-05 11:56:37 -05:00
committed by Travis Watkins
parent 3abba82315
commit 890a4af12f
6 changed files with 48 additions and 11 deletions

View File

@@ -63,7 +63,12 @@ public class EntityIronGolem extends EntityGolem {
protected void o(Entity entity) {
if (entity instanceof IMonster && this.aH().nextInt(20) == 0) {
this.setGoalTarget((EntityLiving) entity);
// CraftBukkit start
org.bukkit.event.entity.EntityTargetLivingEntityEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTargetLivingEvent(this, (EntityLiving) entity, org.bukkit.event.entity.EntityTargetEvent.TargetReason.COLLISION);
if (!event.isCancelled()) {
this.setGoalTarget(((org.bukkit.craftbukkit.entity.CraftLivingEntity) event.getTarget()).getHandle());
}
// CraftBukkit end
}
super.o(entity);