Fixed EntityDamageByEntityEvent to call for every attackable entity. Fixes BUKKIT-1129, Fixes BUKKIT-1054 and Fixes BUKKIT-147.

This commit is contained in:
feildmaster
2012-03-12 17:55:02 -05:00
committed by EvilSeph
parent c625d00351
commit 4503167283
11 changed files with 72 additions and 185 deletions

View File

@@ -23,13 +23,11 @@ public class EntityEgg extends EntityProjectile {
}
protected void a(MovingObjectPosition movingobjectposition) {
// CraftBukkit start
if (movingobjectposition.entity != null) {
if (org.bukkit.craftbukkit.event.CraftEventFactory.handleProjectileEvent((org.bukkit.entity.Projectile) this.getBukkitEntity(), movingobjectposition.entity, DamageSource.projectile(this, this.shooter), 0)) {
; // Original code does nothing *yet*
}
if (movingobjectposition.entity != null && movingobjectposition.entity.damageEntity(DamageSource.projectile(this, this.shooter), 0)) {
;
}
// CraftBukkit start
boolean hatching = !this.world.isStatic && this.random.nextInt(8) == 0;
int numHatching = (this.random.nextInt(32) == 0) ? 4 : 1;
if (!hatching) {