diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java index 22b8c20538..23ad759bcf 100644 --- a/src/main/java/net/minecraft/server/EntityArrow.java +++ b/src/main/java/net/minecraft/server/EntityArrow.java @@ -3,7 +3,6 @@ package net.minecraft.server; import java.util.List; // CraftBukkit start -import org.bukkit.craftbukkit.entity.CraftLivingEntity; import org.bukkit.entity.Projectile; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageEvent; @@ -190,15 +189,11 @@ public class EntityArrow extends Entity { if (entity instanceof EntityLiving) { org.bukkit.Server server = this.world.getServer(); - // TODO decide if we should create DamageCause.ARROW, DamageCause.PROJECTILE - // or leave as DamageCause.ENTITY_ATTACK org.bukkit.entity.Entity damagee = movingobjectposition.entity.getBukkitEntity(); Projectile projectile = (Projectile) this.getBukkitEntity(); - // TODO deal with arrows being fired from a non-entity EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(projectile, damagee, EntityDamageEvent.DamageCause.PROJECTILE, l); server.getPluginManager().callEvent(event); - this.shooter = (projectile.getShooter() == null) ? null : ((CraftLivingEntity) projectile.getShooter()).getHandle(); if (event.isCancelled()) { stick = !projectile.doesBounce(); diff --git a/src/main/java/net/minecraft/server/EntityEgg.java b/src/main/java/net/minecraft/server/EntityEgg.java index 8bc865617f..5211e2e377 100644 --- a/src/main/java/net/minecraft/server/EntityEgg.java +++ b/src/main/java/net/minecraft/server/EntityEgg.java @@ -35,7 +35,6 @@ public class EntityEgg extends EntityProjectile { org.bukkit.entity.Entity damagee = movingobjectposition.entity.getBukkitEntity(); Projectile projectile = (Projectile) this.getBukkitEntity(); - // TODO @see EntityArrow#162 EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(projectile, damagee, EntityDamageEvent.DamageCause.PROJECTILE, 0); this.world.getServer().getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/EntityFireball.java b/src/main/java/net/minecraft/server/EntityFireball.java index ab68bf4cbf..481c9af7a0 100644 --- a/src/main/java/net/minecraft/server/EntityFireball.java +++ b/src/main/java/net/minecraft/server/EntityFireball.java @@ -191,12 +191,9 @@ public class EntityFireball extends Entity { org.bukkit.entity.Entity damagee = movingobjectposition.entity.getBukkitEntity(); Projectile projectile = (Projectile) this.getBukkitEntity(); - // TODO @see EntityArrow#162 EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(projectile, damagee, EntityDamageEvent.DamageCause.PROJECTILE, 0); this.world.getServer().getPluginManager().callEvent(event); - this.shooter = (projectile.getShooter() == null) ? null : ((CraftLivingEntity) projectile.getShooter()).getHandle(); - if (event.isCancelled()) { stick = !projectile.doesBounce(); } else { diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java index 7a60dac000..18467068be 100644 --- a/src/main/java/net/minecraft/server/EntityFishingHook.java +++ b/src/main/java/net/minecraft/server/EntityFishingHook.java @@ -190,13 +190,11 @@ public class EntityFishingHook extends Entity { if (movingobjectposition != null) { if (movingobjectposition.entity != null) { // CraftBukkit start - // TODO add EntityDamagedByProjectileEvent : fishing hook? boolean stick; if (movingobjectposition.entity instanceof EntityLiving) { org.bukkit.entity.Entity damagee = movingobjectposition.entity.getBukkitEntity(); Projectile projectile = (Projectile) this.getBukkitEntity(); - // TODO @see EntityArrow#162 EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(projectile, damagee, EntityDamageEvent.DamageCause.PROJECTILE, 0); this.world.getServer().getPluginManager().callEvent(event); @@ -204,7 +202,7 @@ public class EntityFishingHook extends Entity { stick = !projectile.doesBounce(); } else { // this function returns if the fish should stick in or not, i.e. !bounce - stick = movingobjectposition.entity.damageEntity(DamageSource.projectile((Entity) this, this.owner), event.getDamage()); + stick = movingobjectposition.entity.damageEntity(DamageSource.projectile(this, this.owner), event.getDamage()); } } else { stick = movingobjectposition.entity.damageEntity(DamageSource.projectile(this, this.owner), 0); diff --git a/src/main/java/net/minecraft/server/EntitySnowball.java b/src/main/java/net/minecraft/server/EntitySnowball.java index a586127207..fd82264b81 100644 --- a/src/main/java/net/minecraft/server/EntitySnowball.java +++ b/src/main/java/net/minecraft/server/EntitySnowball.java @@ -39,7 +39,6 @@ public class EntitySnowball extends EntityProjectile { org.bukkit.entity.Entity damagee = movingobjectposition.entity.getBukkitEntity(); Projectile projectile = (Projectile) this.getBukkitEntity(); - // TODO @see EntityArrow#162 EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(projectile, damagee, EntityDamageEvent.DamageCause.PROJECTILE, b0); this.world.getServer().getPluginManager().callEvent(event); this.shooter = (projectile.getShooter() == null) ? null : ((CraftLivingEntity) projectile.getShooter()).getHandle();