From 63f70e3378a673b84d7530ef7fffa6527d27a5e8 Mon Sep 17 00:00:00 2001 From: ryanhamshire Date: Mon, 16 Feb 2015 19:46:53 -0800 Subject: [PATCH] Fixed selling initial claim blocks. --- src/me/ryanhamshire/GriefPrevention/GriefPrevention.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java b/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java index 6068ffa..f34420e 100644 --- a/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java +++ b/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java @@ -1383,7 +1383,7 @@ public class GriefPrevention extends JavaPlugin //if no amount provided, just tell player value per block sold, and how many he can sell if(args.length != 1) { - GriefPrevention.sendMessage(player, TextMode.Info, Messages.BlockSaleValue, String.valueOf(GriefPrevention.instance.config_economy_claimBlocksSellValue), String.valueOf(availableBlocks)); + GriefPrevention.sendMessage(player, TextMode.Info, Messages.BlockSaleValue, String.valueOf(GriefPrevention.instance.config_economy_claimBlocksSellValue), String.valueOf(Math.max(0, availableBlocks - GriefPrevention.instance.config_claims_initialBlocks))); return false; } @@ -1404,7 +1404,7 @@ public class GriefPrevention extends JavaPlugin } //if he doesn't have enough blocks, tell him so - if(blockCount > availableBlocks) + if(blockCount > availableBlocks - GriefPrevention.instance.config_claims_initialBlocks) { GriefPrevention.sendMessage(player, TextMode.Err, Messages.NotEnoughBlocksForSale); }