mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-01-30 12:01:24 +01:00
Added ability to set a max. claim volume
This commit is contained in:
parent
dbf65f798f
commit
987a20b33c
@ -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
|
||||||
|
@ -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);
|
||||||
|
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user