diff --git a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java index 19a5f139..8892019e 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java @@ -41,6 +41,8 @@ import org.bukkit.entity.TNTPrimed; import org.bukkit.entity.Tameable; import org.bukkit.entity.ThrownPotion; +import org.bukkit.entity.Wither; +import org.bukkit.entity.WitherSkull; import org.bukkit.entity.Wolf; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -533,7 +535,7 @@ public void onEntityExplode(EntityExplodeEvent event) { // Not all explosions come from an entity if (ent != null) { - if (ent.getType() == witherType) { + if (ent instanceof Wither) { if (wcfg.blockWitherBlockDamage) { event.blockList().clear(); event.setCancelled(true); @@ -546,7 +548,7 @@ public void onEntityExplode(EntityExplodeEvent event) { } } - if (ent.getType() == witherSkullType) { + if (ent instanceof WitherSkull) { if (wcfg.blockWitherSkullBlockDamage) { event.blockList().clear(); event.setCancelled(true); @@ -625,7 +627,7 @@ public void onEntityExplode(EntityExplodeEvent event) { } } } - } else if (ent instanceof Fireball) { + } else if (ent instanceof Fireball && !(ent instanceof WitherSkull)) { if (wcfg.blockFireballBlockDamage) { event.blockList().clear(); event.setCancelled(true);