mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-27 21:15:57 +01:00
Updated mob spawn control flags
This commit is contained in:
parent
40299eeea4
commit
423f0199d0
@ -313,11 +313,6 @@ public void onCreatureSpawn(CreatureSpawnEvent event) {
|
||||
case CHICKEN: if (plugin.blockCreatureSpawn.contains("chicken")) { cancelEvent = true; } creaName = "chicken"; break;
|
||||
}
|
||||
|
||||
if (cancelEvent) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (plugin.useRegions && creaName != "") {
|
||||
Vector pt = toVector(event.getEntity().getLocation());
|
||||
RegionManager mgr = plugin.getGlobalRegionManager().getRegionManager(event.getEntity().getWorld().getName());
|
||||
@ -326,12 +321,18 @@ public void onCreatureSpawn(CreatureSpawnEvent event) {
|
||||
.getBooleanAreaFlag("creaturespawn", creaName, true, null);
|
||||
if (flagValue != null) {
|
||||
if (!flagValue) {
|
||||
cancelEvent = true;
|
||||
} else {
|
||||
cancelEvent = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (cancelEvent) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find a position for the player to stand that is not inside a block.
|
||||
|
Loading…
Reference in New Issue
Block a user