diff --git a/config.yml b/config.yml index 9c71b18c..bfe2f2a0 100644 --- a/config.yml +++ b/config.yml @@ -71,6 +71,7 @@ player-damage: regions: enable: on wand: 287 + max-claim-volume: 1000 default: build: on chest-access: off diff --git a/src/com/sk89q/worldguard/bukkit/WorldGuardWorldConfiguration.java b/src/com/sk89q/worldguard/bukkit/WorldGuardWorldConfiguration.java index 2f685296..104114dd 100644 --- a/src/com/sk89q/worldguard/bukkit/WorldGuardWorldConfiguration.java +++ b/src/com/sk89q/worldguard/bukkit/WorldGuardWorldConfiguration.java @@ -92,6 +92,7 @@ public class WorldGuardWorldConfiguration { public boolean useiConomy; public boolean buyOnClaim; public int buyOnClaimPrice; + public int maxClaimVolume; /* Configuration data end */ @@ -200,6 +201,7 @@ private void loadConfiguration() { useRegions = config.getBoolean("regions.enable", true); regionWand = config.getInt("regions.wand", 287); + maxClaimVolume = config.getInt("regions.max-claim-volume", 1000); useiConomy = config.getBoolean("iconomy.enable", false); buyOnClaim = config.getBoolean("iconomy.buy-on-claim", false); diff --git a/src/com/sk89q/worldguard/bukkit/commands/CommandRegionClaim.java b/src/com/sk89q/worldguard/bukkit/commands/CommandRegionClaim.java index 1546a460..fe505fd4 100644 --- a/src/com/sk89q/worldguard/bukkit/commands/CommandRegionClaim.java +++ b/src/com/sk89q/worldguard/bukkit/commands/CommandRegionClaim.java @@ -104,6 +104,12 @@ public boolean handle(CommandSender sender, String senderName, String command, S 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()); if (cfg.getiConomy() != null && wcfg.useiConomy && wcfg.buyOnClaim) {