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:
parent
447a8a1fc4
commit
62d6326503
|
|
@ -2058,8 +2058,11 @@ public class GriefPrevention extends JavaPlugin
|
||||||
GriefPrevention.instance.restoreClaim(claim, 20L * 60 * 2);
|
GriefPrevention.instance.restoreClaim(claim, 20L * 60 * 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
//adjust claim blocks
|
//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))));
|
playerData.setAccruedClaimBlocks(playerData.getAccruedClaimBlocks() - (int)Math.ceil((claim.getArea() * (1 - this.config_claims_abandonReturnRatio))));
|
||||||
|
}
|
||||||
|
|
||||||
//tell the player how many claim blocks he has left
|
//tell the player how many claim blocks he has left
|
||||||
int remainingBlocks = playerData.getRemainingClaimBlocks();
|
int remainingBlocks = playerData.getRemainingClaimBlocks();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user