Check for both LARGE_FIREBALL and FIREBALL for the EntityType in the entity listener.

This is to counteract a breaking Bukkit change.
This commit is contained in:
sk89q 2012-10-30 09:24:10 -07:00
parent 08ce207636
commit 6d09b18479

View File

@ -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;