Made snowmen in rain or water fire EntityDamage events with DamageCause DROWNING. Fixes BUKKIT-1165

This commit is contained in:
EvilSeph 2012-03-14 01:29:02 -04:00
parent 373afd1b22
commit 2a4167d8a5

View File

@ -33,7 +33,12 @@ public class EntitySnowman extends EntityGolem {
public void e() { public void e() {
super.e(); super.e();
if (this.aS()) { if (this.aS()) {
this.damageEntity(DamageSource.DROWN, 1); EntityDamageEvent event = new EntityDamageEvent(this.getBukkitEntity(), EntityDamageEvent.DamageCause.DROWNING, 1);
this.world.getServer().getPluginManager().callEvent(event);
if (!event.isCancelled()) {
this.damageEntity(DamageSource.DROWN, event.getDamage());
}
} }
int i = MathHelper.floor(this.locX); int i = MathHelper.floor(this.locX);