Added ability to set a max. claim volume

This commit is contained in:
DarkLiKally 2011-02-26 15:35:48 +01:00
parent dbf65f798f
commit 987a20b33c
3 changed files with 9 additions and 0 deletions

View File

@ -71,6 +71,7 @@ player-damage:
regions: regions:
enable: on enable: on
wand: 287 wand: 287
max-claim-volume: 1000
default: default:
build: on build: on
chest-access: off chest-access: off

View File

@ -92,6 +92,7 @@ public class WorldGuardWorldConfiguration {
public boolean useiConomy; public boolean useiConomy;
public boolean buyOnClaim; public boolean buyOnClaim;
public int buyOnClaimPrice; public int buyOnClaimPrice;
public int maxClaimVolume;
/* Configuration data end */ /* Configuration data end */
@ -200,6 +201,7 @@ private void loadConfiguration() {
useRegions = config.getBoolean("regions.enable", true); useRegions = config.getBoolean("regions.enable", true);
regionWand = config.getInt("regions.wand", 287); regionWand = config.getInt("regions.wand", 287);
maxClaimVolume = config.getInt("regions.max-claim-volume", 1000);
useiConomy = config.getBoolean("iconomy.enable", false); useiConomy = config.getBoolean("iconomy.enable", false);
buyOnClaim = config.getBoolean("iconomy.buy-on-claim", false); buyOnClaim = config.getBoolean("iconomy.buy-on-claim", false);

View File

@ -104,6 +104,12 @@ public boolean handle(CommandSender sender, String senderName, String command, S
return true; return true;
} }
if (region.countBlocks() > wcfg.maxClaimVolume) {
player.sendMessage(ChatColor.RED + "This region is to large to claim.");
player.sendMessage(ChatColor.RED + "Max. volume: " + wcfg.maxClaimVolume + " Your volume: " + region.countBlocks());
return true;
}
region.getOwners().addPlayer(player.getName()); region.getOwners().addPlayer(player.getName());
if (cfg.getiConomy() != null && wcfg.useiConomy && wcfg.buyOnClaim) { if (cfg.getiConomy() != null && wcfg.useiConomy && wcfg.buyOnClaim) {