diff options
author | EvilSeph <evilseph@gmail.com> | 2012-03-14 01:29:02 -0400 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-03-14 01:29:02 -0400 |
commit | 2a4167d8a5a70ecc0585cb761dfb0067020bc90d (patch) | |
tree | 8a8571c392c1dc2d8db971b4b2341e36a7a9a8de /src/main | |
parent | 373afd1b22a3c2195be82d3f4f465288d417771e (diff) | |
download | craftbukkit-2a4167d8a5a70ecc0585cb761dfb0067020bc90d.tar craftbukkit-2a4167d8a5a70ecc0585cb761dfb0067020bc90d.tar.gz craftbukkit-2a4167d8a5a70ecc0585cb761dfb0067020bc90d.tar.lz craftbukkit-2a4167d8a5a70ecc0585cb761dfb0067020bc90d.tar.xz craftbukkit-2a4167d8a5a70ecc0585cb761dfb0067020bc90d.zip |
Made snowmen in rain or water fire EntityDamage events with DamageCause DROWNING. Fixes BUKKIT-1165
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/net/minecraft/server/EntitySnowman.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/EntitySnowman.java b/src/main/java/net/minecraft/server/EntitySnowman.java index c7d618d8..4c441b00 100644 --- a/src/main/java/net/minecraft/server/EntitySnowman.java +++ b/src/main/java/net/minecraft/server/EntitySnowman.java @@ -33,7 +33,12 @@ public class EntitySnowman extends EntityGolem { public void e() { super.e(); 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); |