From 2a4167d8a5a70ecc0585cb761dfb0067020bc90d Mon Sep 17 00:00:00 2001 From: EvilSeph Date: Wed, 14 Mar 2012 01:29:02 -0400 Subject: [PATCH] Made snowmen in rain or water fire EntityDamage events with DamageCause DROWNING. Fixes BUKKIT-1165 --- src/main/java/net/minecraft/server/EntitySnowman.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraft/server/EntitySnowman.java b/src/main/java/net/minecraft/server/EntitySnowman.java index c7d618d8df..4c441b004c 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);