From ba5be6071f805741bdc2ddbb8683515d28d69074 Mon Sep 17 00:00:00 2001 From: sk89q Date: Mon, 23 Jul 2012 13:43:44 -0700 Subject: [PATCH] Added regions.use-creature-spawn-event configuration setting. --- .../java/com/sk89q/worldguard/bukkit/ConfigurationManager.java | 3 +++ .../com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sk89q/worldguard/bukkit/ConfigurationManager.java b/src/main/java/com/sk89q/worldguard/bukkit/ConfigurationManager.java index 2c15635e..a8ad5b53 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/ConfigurationManager.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/ConfigurationManager.java @@ -94,6 +94,7 @@ public class ConfigurationManager { private boolean hasCommandBookGodMode = false; public boolean useRegionsScheduler; + public boolean useRegionsCreatureSpawnEvent; public boolean activityHaltToggle = false; public boolean autoGodMode; public boolean usePlayerMove; @@ -137,6 +138,8 @@ public void load() { config.removeProperty("suppress-tick-sync-warnings"); useRegionsScheduler = config.getBoolean( "regions.use-scheduler", true); + useRegionsCreatureSpawnEvent = config.getBoolean( + "regions.use-creature-spawn-event", true); autoGodMode = config.getBoolean( "auto-invincible", config.getBoolean("auto-invincible-permission", false)); config.removeProperty("auto-invincible-permission"); diff --git a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java index 30cac0f9..d7a88a10 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java @@ -624,7 +624,7 @@ public void onCreatureSpawn(CreatureSpawnEvent event) { Location eventLoc = event.getLocation(); - if (wcfg.useRegions) { + if (wcfg.useRegions && cfg.useRegionsCreatureSpawnEvent) { Vector pt = toVector(eventLoc); RegionManager mgr = plugin.getGlobalRegionManager().get(eventLoc.getWorld()); // @TODO get victims' stacktraces and find out why it's null anyway