From e8fb3e6d243c4b449b8276386a4bce7f60a3c697 Mon Sep 17 00:00:00 2001 From: sk89q Date: Sat, 2 Apr 2011 18:44:44 -0700 Subject: [PATCH] Added a region high frequency flags setting to disable high frequency flags. Enable it if you've got the system resources to support it. This covers the fire spread, lava fire spread, lava flow, and water flow flags. --- config_world.yml | 1 + .../sk89q/worldguard/bukkit/WorldConfiguration.java | 2 ++ .../worldguard/bukkit/WorldGuardBlockListener.java | 11 +++++++---- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/config_world.yml b/config_world.yml index 9b8ef618..2a5fbfa7 100644 --- a/config_world.yml +++ b/config_world.yml @@ -73,6 +73,7 @@ regions: max-claim-volume: 30000 claim-only-inside-existing-regions: off max-region-count-per-player: 7 + high-frequency-flags: off iconomy: enable: on diff --git a/src/com/sk89q/worldguard/bukkit/WorldConfiguration.java b/src/com/sk89q/worldguard/bukkit/WorldConfiguration.java index 12ccefda..37ccbeb5 100644 --- a/src/com/sk89q/worldguard/bukkit/WorldConfiguration.java +++ b/src/com/sk89q/worldguard/bukkit/WorldConfiguration.java @@ -87,6 +87,7 @@ public class WorldConfiguration { public boolean disableSuffocationDamage; public boolean teleportOnSuffocation; public boolean useRegions; + public boolean highFreqFlags; public int regionWand = 287; public Set blockCreatureSpawn; public boolean useiConomy; @@ -168,6 +169,7 @@ private void loadConfiguration() { teleportOnSuffocation = config.getBoolean("player-damage.teleport-on-suffocation", false); useRegions = config.getBoolean("regions.enable", true); + highFreqFlags = config.getBoolean("regions.high-frequency-flags", false); regionWand = config.getInt("regions.wand", 287); maxClaimVolume = config.getInt("regions.max-claim-volume", 30000); claimOnlyInsideExistingRegions = config.getBoolean("regions.claim-only-inside-existing-regions", false); diff --git a/src/com/sk89q/worldguard/bukkit/WorldGuardBlockListener.java b/src/com/sk89q/worldguard/bukkit/WorldGuardBlockListener.java index b055f0ee..0382e063 100644 --- a/src/com/sk89q/worldguard/bukkit/WorldGuardBlockListener.java +++ b/src/com/sk89q/worldguard/bukkit/WorldGuardBlockListener.java @@ -188,13 +188,15 @@ public void onBlockFromTo(BlockFromToEvent event) { } } - if (isWater && !plugin.getGlobalRegionManager().allows(DefaultFlag.WATER_FLOW, + if (wcfg.highFreqFlags && isWater + && !plugin.getGlobalRegionManager().allows(DefaultFlag.WATER_FLOW, blockFrom.getLocation())) { event.setCancelled(true); return; } - if (isLava && !plugin.getGlobalRegionManager().allows(DefaultFlag.LAVA_FLOW, + if (wcfg.highFreqFlags && isLava + && !plugin.getGlobalRegionManager().allows(DefaultFlag.LAVA_FLOW, blockFrom.getLocation())) { event.setCancelled(true); return; @@ -276,12 +278,13 @@ public void onBlockIgnite(BlockIgniteEvent event) { } } - if (isFireSpread && set.allows(DefaultFlag.FIRE_SPREAD)) { + if (wcfg.highFreqFlags && isFireSpread && set.allows(DefaultFlag.FIRE_SPREAD)) { event.setCancelled(true); return; } - if (cause == IgniteCause.LAVA && !set.allows(DefaultFlag.LAVA_FIRE)) { + if (wcfg.highFreqFlags && cause == IgniteCause.LAVA + && !set.allows(DefaultFlag.LAVA_FIRE)) { event.setCancelled(true); return; }