Added .getName() 's ?

This commit is contained in:
smc87 2016-06-05 01:13:30 +01:00 committed by David Precious
parent 575df4f8a5
commit f33a732d05

View File

@ -1695,7 +1695,7 @@ public class GriefPrevention extends JavaPlugin
//if no parameter, just tell player cost per block and balance //if no parameter, just tell player cost per block and balance
if(args.length != 1) if(args.length != 1)
{ {
GriefPrevention.sendMessage(player, TextMode.Info, Messages.BlockPurchaseCost, String.valueOf(GriefPrevention.instance.config_economy_claimBlocksPurchaseCost), String.valueOf(GriefPrevention.economy.getBalance(player))); GriefPrevention.sendMessage(player, TextMode.Info, Messages.BlockPurchaseCost, String.valueOf(GriefPrevention.instance.config_economy_claimBlocksPurchaseCost), String.valueOf(GriefPrevention.economy.getBalance(player.getName())));
return false; return false;
} }
@ -1720,7 +1720,7 @@ public class GriefPrevention extends JavaPlugin
} }
//if the player can't afford his purchase, send error message //if the player can't afford his purchase, send error message
double balance = economy.getBalance(player); double balance = economy.getBalance(player.getName());
double totalCost = blockCount * GriefPrevention.instance.config_economy_claimBlocksPurchaseCost; double totalCost = blockCount * GriefPrevention.instance.config_economy_claimBlocksPurchaseCost;
if(totalCost > balance) if(totalCost > balance)
{ {
@ -1731,7 +1731,7 @@ public class GriefPrevention extends JavaPlugin
else else
{ {
//withdraw cost //withdraw cost
economy.withdrawPlayer(player, totalCost); economy.withdrawPlayer(player.getName(), totalCost);
//add blocks //add blocks
playerData.setBonusClaimBlocks(playerData.getBonusClaimBlocks() + blockCount); playerData.setBonusClaimBlocks(playerData.getBonusClaimBlocks() + blockCount);
@ -1806,7 +1806,7 @@ public class GriefPrevention extends JavaPlugin
{ {
//compute value and deposit it //compute value and deposit it
double totalValue = blockCount * GriefPrevention.instance.config_economy_claimBlocksSellValue; double totalValue = blockCount * GriefPrevention.instance.config_economy_claimBlocksSellValue;
economy.depositPlayer(player, totalValue); economy.depositPlayer(player.getName(), totalValue);
//subtract blocks //subtract blocks
playerData.setBonusClaimBlocks(playerData.getBonusClaimBlocks() - blockCount); playerData.setBonusClaimBlocks(playerData.getBonusClaimBlocks() - blockCount);