mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-01-12 03:13:40 +01:00
Added MOB_SPAWNING state flag.
This commit is contained in:
parent
7038f49a1a
commit
28c44e0b2f
@ -374,6 +374,18 @@ public void onCreatureSpawn(CreatureSpawnEvent event) {
|
||||
cancelEvent = true;
|
||||
}
|
||||
|
||||
Location eventLoc = event.getLocation();
|
||||
|
||||
if (wcfg.useRegions) {
|
||||
Vector pt = toVector(eventLoc);
|
||||
RegionManager mgr = plugin.getGlobalRegionManager().get(eventLoc.getWorld());
|
||||
ApplicableRegionSet set = mgr.getApplicableRegions(pt);
|
||||
|
||||
if (!set.allows(DefaultFlag.MOB_SPAWNING)) {
|
||||
cancelEvent = true;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Monsters and stuff
|
||||
/*
|
||||
if (wcfg.useRegions) {
|
||||
|
@ -29,6 +29,7 @@ public final class DefaultFlag {
|
||||
public static final StateFlag BUILD = new StateFlag("build", 'b', true);
|
||||
public static final StateFlag PVP = new StateFlag("pvp", 'p', true);
|
||||
public static final StateFlag MOB_DAMAGE = new StateFlag("mob-damage", 'm', true);
|
||||
public static final StateFlag MOB_SPAWNING = new StateFlag("mob-spawning", 'M', true);
|
||||
public static final StateFlag CREEPER_EXPLOSION = new StateFlag("creeper-explosion", 'c', true);
|
||||
public static final StateFlag TNT = new StateFlag("tnt", 't', true);
|
||||
public static final StateFlag LIGHTER = new StateFlag("lighter", 'l', true);
|
||||
@ -54,7 +55,7 @@ public final class DefaultFlag {
|
||||
public static final DoubleFlag PRICE = new DoubleFlag("price");
|
||||
|
||||
public static final Flag<?>[] flagsList = new Flag<?>[] {
|
||||
PASSTHROUGH, BUILD, PVP, MOB_DAMAGE, CREEPER_EXPLOSION,
|
||||
PASSTHROUGH, BUILD, PVP, MOB_DAMAGE, MOB_SPAWNING, CREEPER_EXPLOSION,
|
||||
TNT, LIGHTER, FIRE_SPREAD, LAVA_FIRE, CHEST_ACCESS, WATER_FLOW, LAVA_FLOW,
|
||||
USE, PLACE_VEHICLE, GREET_MESSAGE, FAREWELL_MESSAGE, NOTIFY_GREET,
|
||||
NOTIFY_FAREWELL, DENY_SPAWN, HEAL_DELAY, HEAL_AMOUNT, TELE_LOC,
|
||||
|
Loading…
Reference in New Issue
Block a user