Updated mob spawn control flags

This commit is contained in:
DarkLiKally 2011-02-24 16:36:47 +01:00
parent 40299eeea4
commit 423f0199d0

View File

@ -313,11 +313,6 @@ public void onCreatureSpawn(CreatureSpawnEvent event) {
case CHICKEN: if (plugin.blockCreatureSpawn.contains("chicken")) { cancelEvent = true; } creaName = "chicken"; break; case CHICKEN: if (plugin.blockCreatureSpawn.contains("chicken")) { cancelEvent = true; } creaName = "chicken"; break;
} }
if (cancelEvent) {
event.setCancelled(true);
return;
}
if (plugin.useRegions && creaName != "") { if (plugin.useRegions && creaName != "") {
Vector pt = toVector(event.getEntity().getLocation()); Vector pt = toVector(event.getEntity().getLocation());
RegionManager mgr = plugin.getGlobalRegionManager().getRegionManager(event.getEntity().getWorld().getName()); RegionManager mgr = plugin.getGlobalRegionManager().getRegionManager(event.getEntity().getWorld().getName());
@ -326,11 +321,17 @@ public void onCreatureSpawn(CreatureSpawnEvent event) {
.getBooleanAreaFlag("creaturespawn", creaName, true, null); .getBooleanAreaFlag("creaturespawn", creaName, true, null);
if (flagValue != null) { if (flagValue != null) {
if (!flagValue) { if (!flagValue) {
event.setCancelled(true); cancelEvent = true;
return; } else {
cancelEvent = false;
} }
} }
} }
if (cancelEvent) {
event.setCancelled(true);
return;
}
} }
/** /**