From 373afd1b22a3c2195be82d3f4f465288d417771e Mon Sep 17 00:00:00 2001 From: EvilSeph Date: Wed, 14 Mar 2012 01:26:23 -0400 Subject: [PATCH] Made snowmen melting fire EntityDamage events with DamageCause FIRE_TICK. Fixes BUKKIT-1164 --- src/main/java/net/minecraft/server/EntitySnowman.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraft/server/EntitySnowman.java b/src/main/java/net/minecraft/server/EntitySnowman.java index 59fe5a0c5c..c7d618d8df 100644 --- a/src/main/java/net/minecraft/server/EntitySnowman.java +++ b/src/main/java/net/minecraft/server/EntitySnowman.java @@ -5,6 +5,7 @@ import java.util.List; import org.bukkit.block.BlockState; import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.event.block.EntityBlockFormEvent; +import org.bukkit.event.entity.EntityDamageEvent; // CraftBukkit end public class EntitySnowman extends EntityGolem { @@ -39,7 +40,12 @@ public class EntitySnowman extends EntityGolem { int j = MathHelper.floor(this.locZ); if (this.world.getBiome(i, j).h() > 1.0F) { - this.damageEntity(DamageSource.BURN, 1); + EntityDamageEvent event = new EntityDamageEvent(this.getBukkitEntity(), EntityDamageEvent.DamageCause.FIRE_TICK, 1); + this.world.getServer().getPluginManager().callEvent(event); + + if (!event.isCancelled()) { + this.damageEntity(DamageSource.BURN, event.getDamage()); + } } for (i = 0; i < 4; ++i) {