Updates to all Entities to use getBukkitEntity() any time an event is

raised.
Similar update to CraftVehicle and CraftLivingEntity
This commit is contained in:
Andrew Ardill
2011-01-17 08:53:42 +08:00
committed by Dinner Bone
parent 3400eafaf1
commit 5f2c8108b7
14 changed files with 34 additions and 70 deletions

View File

@@ -72,10 +72,8 @@ public class EntityMobs extends EntityCreature implements IMobs {
// CraftBukkit start
if(entity instanceof EntityLiving) {
CraftServer server = ((WorldServer) l).getServer();
CraftEntity damagee = new CraftLivingEntity(server, (EntityLiving) entity);
CraftEntity damager = new CraftLivingEntity(server, this);
EntityDamageByEntityEvent edbee = new EntityDamageByEntityEvent(damager, damagee, EntityDamageEvent.DamageCause.ENTITY_ATTACK, c);
EntityDamageByEntityEvent edbee = new EntityDamageByEntityEvent(entity.getBukkitEntity(), this.getBukkitEntity(), EntityDamageEvent.DamageCause.ENTITY_ATTACK, c);
server.getPluginManager().callEvent(edbee);
if (!edbee.isCancelled()){