Snowmen no longer melt. Thanks to ACStache.

This commit is contained in:
garbagemule 2012-03-30 03:31:31 +02:00
parent 7ad0964f3d
commit 08b19e7b8e
2 changed files with 6 additions and 0 deletions

Binary file not shown.

View File

@ -18,6 +18,7 @@ import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile; import org.bukkit.entity.Projectile;
import org.bukkit.entity.Slime; import org.bukkit.entity.Slime;
import org.bukkit.entity.Snowman;
import org.bukkit.entity.TNTPrimed; import org.bukkit.entity.TNTPrimed;
import org.bukkit.entity.ThrownPotion; import org.bukkit.entity.ThrownPotion;
import org.bukkit.entity.Wolf; import org.bukkit.entity.Wolf;
@ -45,6 +46,7 @@ import org.bukkit.event.entity.EntityTargetEvent;
import org.bukkit.event.entity.EntityTeleportEvent; import org.bukkit.event.entity.EntityTeleportEvent;
import org.bukkit.event.entity.FoodLevelChangeEvent; import org.bukkit.event.entity.FoodLevelChangeEvent;
import org.bukkit.event.entity.PotionSplashEvent; import org.bukkit.event.entity.PotionSplashEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
import org.bukkit.event.entity.EntityTargetEvent.TargetReason; import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.entity.PlayerDeathEvent;
@ -448,6 +450,10 @@ public class ArenaListener
else if (damagee instanceof Player) { else if (damagee instanceof Player) {
onPlayerDamage(event, (Player) damagee, damager); onPlayerDamage(event, (Player) damagee, damager);
} }
// Snowman
else if (damagee instanceof Snowman && event.getCause() == DamageCause.MELTING) {
event.setCancelled(true);
}
// Boss // Boss
else if (monsters.getBossMonsters().contains(damagee)) { else if (monsters.getBossMonsters().contains(damagee)) {
onBossDamage(event, (LivingEntity) damagee, damager); onBossDamage(event, (LivingEntity) damagee, damager);