Made expanding chest claims easier.

For players expanding for the first time - allow them to resize to less
than the max size as long as it's an expansion.
This commit is contained in:
ryanhamshire 2015-01-28 14:09:04 -08:00
parent 66b18a0193
commit 30998c3d75

View File

@ -1867,8 +1867,9 @@ class PlayerEventHandler implements Listener
//measure new claim, apply size rules //measure new claim, apply size rules
int newWidth = (Math.abs(newx1 - newx2) + 1); int newWidth = (Math.abs(newx1 - newx2) + 1);
int newHeight = (Math.abs(newz1 - newz2) + 1); int newHeight = (Math.abs(newz1 - newz2) + 1);
boolean smaller = newWidth < playerData.claimResizing.getWidth() || newHeight < playerData.claimResizing.getHeight();
if(!playerData.claimResizing.isAdminClaim() && (newWidth < GriefPrevention.instance.config_claims_minSize || newHeight < GriefPrevention.instance.config_claims_minSize)) if(!playerData.claimResizing.isAdminClaim() && smaller && (newWidth < GriefPrevention.instance.config_claims_minSize || newHeight < GriefPrevention.instance.config_claims_minSize))
{ {
GriefPrevention.sendMessage(player, TextMode.Err, Messages.ResizeClaimTooSmall, String.valueOf(GriefPrevention.instance.config_claims_minSize)); GriefPrevention.sendMessage(player, TextMode.Err, Messages.ResizeClaimTooSmall, String.valueOf(GriefPrevention.instance.config_claims_minSize));
return; return;