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.

This commit is contained in:
sk89q 2011-04-02 18:44:44 -07:00
parent 93d084d5ba
commit e8fb3e6d24
3 changed files with 10 additions and 4 deletions

View File

@ -73,6 +73,7 @@ regions:
max-claim-volume: 30000 max-claim-volume: 30000
claim-only-inside-existing-regions: off claim-only-inside-existing-regions: off
max-region-count-per-player: 7 max-region-count-per-player: 7
high-frequency-flags: off
iconomy: iconomy:
enable: on enable: on

View File

@ -87,6 +87,7 @@ public class WorldConfiguration {
public boolean disableSuffocationDamage; public boolean disableSuffocationDamage;
public boolean teleportOnSuffocation; public boolean teleportOnSuffocation;
public boolean useRegions; public boolean useRegions;
public boolean highFreqFlags;
public int regionWand = 287; public int regionWand = 287;
public Set<CreatureType> blockCreatureSpawn; public Set<CreatureType> blockCreatureSpawn;
public boolean useiConomy; public boolean useiConomy;
@ -168,6 +169,7 @@ private void loadConfiguration() {
teleportOnSuffocation = config.getBoolean("player-damage.teleport-on-suffocation", false); teleportOnSuffocation = config.getBoolean("player-damage.teleport-on-suffocation", false);
useRegions = config.getBoolean("regions.enable", true); useRegions = config.getBoolean("regions.enable", true);
highFreqFlags = config.getBoolean("regions.high-frequency-flags", false);
regionWand = config.getInt("regions.wand", 287); regionWand = config.getInt("regions.wand", 287);
maxClaimVolume = config.getInt("regions.max-claim-volume", 30000); maxClaimVolume = config.getInt("regions.max-claim-volume", 30000);
claimOnlyInsideExistingRegions = config.getBoolean("regions.claim-only-inside-existing-regions", false); claimOnlyInsideExistingRegions = config.getBoolean("regions.claim-only-inside-existing-regions", false);

View File

@ -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())) { blockFrom.getLocation())) {
event.setCancelled(true); event.setCancelled(true);
return; return;
} }
if (isLava && !plugin.getGlobalRegionManager().allows(DefaultFlag.LAVA_FLOW, if (wcfg.highFreqFlags && isLava
&& !plugin.getGlobalRegionManager().allows(DefaultFlag.LAVA_FLOW,
blockFrom.getLocation())) { blockFrom.getLocation())) {
event.setCancelled(true); event.setCancelled(true);
return; 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); event.setCancelled(true);
return; return;
} }
if (cause == IgniteCause.LAVA && !set.allows(DefaultFlag.LAVA_FIRE)) { if (wcfg.highFreqFlags && cause == IgniteCause.LAVA
&& !set.allows(DefaultFlag.LAVA_FIRE)) {
event.setCancelled(true); event.setCancelled(true);
return; return;
} }