From 485bbf930bb1a607c2aa651ea7b18723702858b7 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Tue, 26 Nov 2013 13:41:17 -0700 Subject: [PATCH] Fixed places where toLowerCase() was not needed/ was missing. --- .../src/me/kaZep/Base/PlayerListener.java | 28 +++++++++---------- .../me/kaZep/Commands/commandBankEconomy.java | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java b/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java index 0cca953..d899c8e 100644 --- a/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java +++ b/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java @@ -12642,10 +12642,10 @@ implements Listener //Deposit all the money into their account. val = this.plugin.economy.getBalance(e.getPlayer().getName()); this.plugin.economy.withdrawPlayer(e.getPlayer().getName(), val); - double mymoney = this.plugin.getAccountsConfig().getDouble(e.getPlayer().getName() + ".money"); - this.plugin.getAccountsConfig().set(e.getPlayer().getName() + ".money", Double.valueOf(mymoney+val)); + double mymoney = this.plugin.getAccountsConfig().getDouble(e.getPlayer().getName().toLowerCase() + ".money"); + this.plugin.getAccountsConfig().set(e.getPlayer().getName().toLowerCase() + ".money", Double.valueOf(mymoney+val)); //this.plugin.saveAccountsConfig(); - e.getPlayer().sendMessage(ChatColor.GREEN+"Deposited $" + df.format(val) + " into your account. " + ChatColor.YELLOW + "New Bank Balance: $" + ChatColor.AQUA + df.format(this.plugin.getAccountsConfig().getDouble(e.getPlayer().getName() + ".money"))); + e.getPlayer().sendMessage(ChatColor.GREEN+"Deposited $" + df.format(val) + " into your account. " + ChatColor.YELLOW + "New Bank Balance: $" + ChatColor.AQUA + df.format(this.plugin.getAccountsConfig().getDouble(e.getPlayer().getName().toLowerCase() + ".money"))); this.plugin.last_bank_deposit_use_time=0; } else { try { @@ -12655,10 +12655,10 @@ implements Listener //Deposit the money into their account. //this.plugin.economy.bankDeposit(e.getPlayer().getName(), val); this.plugin.economy.withdrawPlayer(e.getPlayer().getName(), val); - double mymoney = this.plugin.getAccountsConfig().getDouble(e.getPlayer().getName() + ".money"); - this.plugin.getAccountsConfig().set(e.getPlayer().getName() + ".money", Double.valueOf(mymoney+val)); + double mymoney = this.plugin.getAccountsConfig().getDouble(e.getPlayer().getName().toLowerCase() + ".money"); + this.plugin.getAccountsConfig().set(e.getPlayer().getName().toLowerCase() + ".money", Double.valueOf(mymoney+val)); //this.plugin.saveAccountsConfig(); - e.getPlayer().sendMessage(ChatColor.GREEN+"Deposited $" + df.format(val) + " into your account. " + ChatColor.YELLOW + "New Bank Balance: $" + ChatColor.AQUA + df.format(this.plugin.getAccountsConfig().getDouble(e.getPlayer().getName() + ".money"))); + e.getPlayer().sendMessage(ChatColor.GREEN+"Deposited $" + df.format(val) + " into your account. " + ChatColor.YELLOW + "New Bank Balance: $" + ChatColor.AQUA + df.format(this.plugin.getAccountsConfig().getDouble(e.getPlayer().getName().toLowerCase() + ".money"))); this.plugin.last_bank_deposit_use_time=0; } else { e.getPlayer().sendMessage(ChatColor.RED+"You are not holding that much! " + ChatColor.YELLOW +"Enter a value equal to or lower than $" + ChatColor.GREEN+ df.format(this.plugin.economy.getBalance(e.getPlayer().getName())) + "" + ChatColor.GRAY + ChatColor.ITALIC + " (Remember you can also use the word all)"); @@ -12676,27 +12676,27 @@ implements Listener double val=0; if (e.getMessage().equalsIgnoreCase("all")) { //Withdraw all the money in their account. - val = this.plugin.getAccountsConfig().getDouble(e.getPlayer().getName() + ".money"); - this.plugin.getAccountsConfig().set(e.getPlayer().getName() + ".money", Double.valueOf(0)); + val = this.plugin.getAccountsConfig().getDouble(e.getPlayer().getName().toLowerCase() + ".money"); + this.plugin.getAccountsConfig().set(e.getPlayer().getName().toLowerCase() + ".money", Double.valueOf(0)); //this.plugin.saveAccountsConfig(); this.plugin.economy.depositPlayer(e.getPlayer().getName(), val); - e.getPlayer().sendMessage(ChatColor.GREEN+"Withdrawed $" + df.format(val) + " from your account. " + ChatColor.YELLOW + "New Bank Balance: $" + ChatColor.AQUA + df.format(this.plugin.getAccountsConfig().getDouble(e.getPlayer().getName() + ".money"))); + e.getPlayer().sendMessage(ChatColor.GREEN+"Withdrawed $" + df.format(val) + " from your account. " + ChatColor.YELLOW + "New Bank Balance: $" + ChatColor.AQUA + df.format(this.plugin.getAccountsConfig().getDouble(e.getPlayer().getName().toLowerCase() + ".money"))); this.plugin.last_bank_withdraw_use_time=0; } else { try { val = Double.parseDouble(e.getMessage()); //Make sure the user is holding at least that much money. - if (this.plugin.getAccountsConfig().getDouble(e.getPlayer().getName() + ".money")>=val && val>0) { + if (this.plugin.getAccountsConfig().getDouble(e.getPlayer().getName().toLowerCase() + ".money")>=val && val>0) { //Deposit the money into their account. //this.plugin.economy.bankDeposit(e.getPlayer().getName(), val); this.plugin.economy.depositPlayer(e.getPlayer().getName(), val); - double mymoney = this.plugin.getAccountsConfig().getDouble(e.getPlayer().getName() + ".money"); - this.plugin.getAccountsConfig().set(e.getPlayer().getName() + ".money", Double.valueOf(mymoney-val)); + double mymoney = this.plugin.getAccountsConfig().getDouble(e.getPlayer().getName().toLowerCase() + ".money"); + this.plugin.getAccountsConfig().set(e.getPlayer().getName().toLowerCase() + ".money", Double.valueOf(mymoney-val)); //this.plugin.saveAccountsConfig(); - e.getPlayer().sendMessage(ChatColor.GREEN+"Withdrawed $" + df.format(val) + " from your account. " + ChatColor.YELLOW + "New Bank Balance: $" + ChatColor.AQUA + df.format(this.plugin.getAccountsConfig().getDouble(e.getPlayer().getName() + ".money"))); + e.getPlayer().sendMessage(ChatColor.GREEN+"Withdrawed $" + df.format(val) + " from your account. " + ChatColor.YELLOW + "New Bank Balance: $" + ChatColor.AQUA + df.format(this.plugin.getAccountsConfig().getDouble(e.getPlayer().getName().toLowerCase() + ".money"))); this.plugin.last_bank_withdraw_use_time=0; } else { - e.getPlayer().sendMessage(ChatColor.RED+"You do not have that much! " + ChatColor.YELLOW +"Enter a value equal to or lower than $" + ChatColor.GREEN+ df.format(this.plugin.getAccountsConfig().getDouble(e.getPlayer().getName() + ".money")) + "" + ChatColor.GRAY + ChatColor.ITALIC + " (Remember you can also use the word all)"); + e.getPlayer().sendMessage(ChatColor.RED+"You do not have that much! " + ChatColor.YELLOW +"Enter a value equal to or lower than $" + ChatColor.GREEN+ df.format(this.plugin.getAccountsConfig().getDouble(e.getPlayer().getName().toLowerCase() + ".money")) + "" + ChatColor.GRAY + ChatColor.ITALIC + " (Remember you can also use the word all)"); this.plugin.last_bank_withdraw_use_time=Main.SERVER_TICK_TIME; } } catch (NumberFormatException ex_e) { diff --git a/BankEconomyMod/src/me/kaZep/Commands/commandBankEconomy.java b/BankEconomyMod/src/me/kaZep/Commands/commandBankEconomy.java index 4a1de06..d7285bf 100644 --- a/BankEconomyMod/src/me/kaZep/Commands/commandBankEconomy.java +++ b/BankEconomyMod/src/me/kaZep/Commands/commandBankEconomy.java @@ -1586,7 +1586,7 @@ public String convertToItemName(String val) { is_in_vehicle=true; vehicle = p.getVehicle(); } - if (target.getName().toLowerCase() == this.plugin.getAccountsConfig().getString(p.getName().toLowerCase().toLowerCase() + ".teleplayer")) { + if (target.getName() == this.plugin.getAccountsConfig().getString(p.getName().toLowerCase().toLowerCase() + ".teleplayer")) { //Determine distance of player to other player. double otherx = target.getLocation().getX(); double othery = target.getLocation().getY();