mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-28 05:25:20 +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;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user