Fixed abandoning subdivisions penalizing blocks.

AbandonReturnRatio shouldn't apply to abandoning subdivisions, since
they don't cost any blocks to begin with.
This commit is contained in:
ryanhamshire 2015-03-16 19:35:03 -07:00
parent 447a8a1fc4
commit 62d6326503

View File

@ -2058,8 +2058,11 @@ public class GriefPrevention extends JavaPlugin
GriefPrevention.instance.restoreClaim(claim, 20L * 60 * 2);
}
//adjust claim blocks
playerData.setAccruedClaimBlocks(playerData.getAccruedClaimBlocks() - (int)Math.ceil((claim.getArea() * (1 - this.config_claims_abandonReturnRatio))));
//adjust claim blocks when abandoning a top level claim
if(claim.parent == null)
{
playerData.setAccruedClaimBlocks(playerData.getAccruedClaimBlocks() - (int)Math.ceil((claim.getArea() * (1 - this.config_claims_abandonReturnRatio))));
}
//tell the player how many claim blocks he has left
int remainingBlocks = playerData.getRemainingClaimBlocks();