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,12 +321,18 @@ 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) {
|
||||||
|
cancelEvent = true;
|
||||||
|
} else {
|
||||||
|
cancelEvent = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cancelEvent) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find a position for the player to stand that is not inside a block.
|
* Find a position for the player to stand that is not inside a block.
|
||||||
|
Loading…
Reference in New Issue
Block a user