From 6d09b1847925b680107e574b10228eb9d0a717c2 Mon Sep 17 00:00:00 2001 From: sk89q Date: Tue, 30 Oct 2012 09:24:10 -0700 Subject: [PATCH] Check for both LARGE_FIREBALL and FIREBALL for the EntityType in the entity listener. This is to counteract a breaking Bukkit change. --- .../worldguard/bukkit/WorldGuardEntityListener.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java index c5ea72d2..b223aee1 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java @@ -89,6 +89,7 @@ public class WorldGuardEntityListener implements Listener { private WorldGuardPlugin plugin; + private EntityType fireballEntityType; /** * Construct the object; @@ -97,6 +98,12 @@ public class WorldGuardEntityListener implements Listener { */ public WorldGuardEntityListener(WorldGuardPlugin plugin) { this.plugin = plugin; + + try { + fireballEntityType = EntityType.valueOf("LARGE_FIREBALL"); + } catch (IllegalArgumentException e) { + fireballEntityType = EntityType.valueOf("FIREBALL"); + } } /** @@ -637,7 +644,7 @@ else if (event.getEntityType() == EntityType.WITHER_SKULL) { return; } } - else if (event.getEntityType() == EntityType.LARGE_FIREBALL) { + else if (event.getEntityType() == fireballEntityType) { if (wcfg.blockFireballExplosions) { event.setCancelled(true); return;