From 70a92aeaacfe17725ae3e2ef13fc75122b9d8d68 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Tue, 26 Nov 2013 10:17:23 -0700 Subject: [PATCH] Remove all saveAccountsConfig() calls. Add in 30 second account save config. Should reduce a lot of stress on the server when players are grinding jobs. There should be no reason to write to a file so often. --- BankEconomyMod/bin/sig/ItemSets/.gitignore | 4 + BankEconomyMod/src/me/kaZep/Base/Main.java | 316 ++++----- .../src/me/kaZep/Base/PlayerBuffData.java | 18 +- .../src/me/kaZep/Base/PlayerListener.java | 649 +++++++++--------- .../me/kaZep/Commands/commandBankEconomy.java | 338 ++++----- 5 files changed, 666 insertions(+), 659 deletions(-) create mode 100644 BankEconomyMod/bin/sig/ItemSets/.gitignore diff --git a/BankEconomyMod/bin/sig/ItemSets/.gitignore b/BankEconomyMod/bin/sig/ItemSets/.gitignore new file mode 100644 index 0000000..4335a54 --- /dev/null +++ b/BankEconomyMod/bin/sig/ItemSets/.gitignore @@ -0,0 +1,4 @@ +/ColorSet.class +/ItemSet.class +/ItemSetList$Armor.class +/ItemSetList.class diff --git a/BankEconomyMod/src/me/kaZep/Base/Main.java b/BankEconomyMod/src/me/kaZep/Base/Main.java index 151cc7a..79544ae 100644 --- a/BankEconomyMod/src/me/kaZep/Base/Main.java +++ b/BankEconomyMod/src/me/kaZep/Base/Main.java @@ -258,7 +258,7 @@ public class Main extends JavaPlugin SERVER_TICK_TIME = getConfig().getLong("server-tick-time"); getAccountsConfig().options().copyDefaults(true); - saveAccountsConfig(); + //saveAccountsConfig(); getConfig().set("spleefrequestatime", Integer.valueOf(0)); getConfig().set("spleefrequestbtime", Integer.valueOf(0)); @@ -1017,6 +1017,7 @@ public class Main extends JavaPlugin public void onDisable() { + saveAccountsConfig(); getConfig().set("server-tick-time", Long.valueOf(SERVER_TICK_TIME)); saveConfig(); PluginDescriptionFile pdf = getDescription(); @@ -1030,31 +1031,31 @@ public void onDisable() //Get list of all players on the server. OfflinePlayer playerlist[] = Bukkit.getOfflinePlayers(); for (int i=0;i=20) { - if (getAccountsConfig().getDouble(playerlist[i].getName()+".spleefrating")>rating[0]) { + if (getAccountsConfig().contains(playerlist[i].getName().toLowerCase())) { + if (getAccountsConfig().contains(playerlist[i].getName().toLowerCase()+".spleefrating") && getAccountsConfig().getInt(playerlist[i].getName().toLowerCase()+".spleefwins")+getAccountsConfig().getInt(playerlist[i].getName().toLowerCase()+".spleeflosses")>=20) { + if (getAccountsConfig().getDouble(playerlist[i].getName().toLowerCase()+".spleefrating")>rating[0]) { //This beats the top record, move everything down. name[2]=name[1];rating[2]=rating[1];wins[2]=wins[1];losses[2]=losses[1]; name[1]=name[0];rating[1]=rating[0];wins[1]=wins[0];losses[1]=losses[0]; - name[0]=playerlist[i].getName(); - rating[0]=(int)getAccountsConfig().getDouble(playerlist[i].getName()+".spleefrating"); - wins[0]=getAccountsConfig().getInt(playerlist[i].getName()+".spleefwins"); - losses[0]=getAccountsConfig().getInt(playerlist[i].getName()+".spleeflosses"); + name[0]=playerlist[i].getName().toLowerCase(); + rating[0]=(int)getAccountsConfig().getDouble(playerlist[i].getName().toLowerCase()+".spleefrating"); + wins[0]=getAccountsConfig().getInt(playerlist[i].getName().toLowerCase()+".spleefwins"); + losses[0]=getAccountsConfig().getInt(playerlist[i].getName().toLowerCase()+".spleeflosses"); } else - if (getAccountsConfig().getDouble(playerlist[i].getName()+".spleefrating")>rating[1]) { + if (getAccountsConfig().getDouble(playerlist[i].getName().toLowerCase()+".spleefrating")>rating[1]) { //This beats the 2nd record, move everything down. name[2]=name[1];rating[2]=rating[1];wins[2]=wins[1];losses[2]=losses[1]; - name[1]=playerlist[i].getName(); - rating[1]=(int)getAccountsConfig().getDouble(playerlist[i].getName()+".spleefrating"); - wins[1]=getAccountsConfig().getInt(playerlist[i].getName()+".spleefwins"); - losses[1]=getAccountsConfig().getInt(playerlist[i].getName()+".spleeflosses"); + name[1]=playerlist[i].getName().toLowerCase(); + rating[1]=(int)getAccountsConfig().getDouble(playerlist[i].getName().toLowerCase()+".spleefrating"); + wins[1]=getAccountsConfig().getInt(playerlist[i].getName().toLowerCase()+".spleefwins"); + losses[1]=getAccountsConfig().getInt(playerlist[i].getName().toLowerCase()+".spleeflosses"); } else - if (getAccountsConfig().getDouble(playerlist[i].getName()+".spleefrating")>rating[2]) { + if (getAccountsConfig().getDouble(playerlist[i].getName().toLowerCase()+".spleefrating")>rating[2]) { //This beats the 3rd record, move everything down. - name[2]=playerlist[i].getName(); - rating[2]=(int)getAccountsConfig().getDouble(playerlist[i].getName()+".spleefrating"); - wins[2]=getAccountsConfig().getInt(playerlist[i].getName()+".spleefwins"); - losses[2]=getAccountsConfig().getInt(playerlist[i].getName()+".spleeflosses"); + name[2]=playerlist[i].getName().toLowerCase(); + rating[2]=(int)getAccountsConfig().getDouble(playerlist[i].getName().toLowerCase()+".spleefrating"); + wins[2]=getAccountsConfig().getInt(playerlist[i].getName().toLowerCase()+".spleefwins"); + losses[2]=getAccountsConfig().getInt(playerlist[i].getName().toLowerCase()+".spleeflosses"); } } } @@ -1264,7 +1265,7 @@ public void runTick() { Player p = Bukkit.getOnlinePlayers()[zx]; //p.sendMessage("That's item slot #"+p.getInventory().getHeldItemSlot()); /* - if (p.getName().compareTo("sigonasr2")==0) { + if (p.getName().toLowerCase().compareTo("sigonasr2")==0) { //Packet61WorldEvent packet = new Packet61WorldEvent(2004, p.getLocation().getBlockX(), p.getLocation().getBlockY(), p.getLocation().getBlockZ(), 0, false); //((CraftPlayer)t).getHandle().netServerHandler.sendPacket(packet); @@ -2036,6 +2037,7 @@ public void runTick() { } } if (Main.SERVER_TICK_TIME%600==0) { + saveAccountsConfig(); //Save account data once every 30 seconds. if (turnedon==false && Bukkit.getWorld("world").getTime()>13000) { //Bukkit.getPlayer("sigonasr2").sendMessage("It's night now..."); turnedon=true; @@ -2069,7 +2071,7 @@ public void runTick() { if (getConfig().getBoolean("spleef4insession")) { //Check to see if we fall off. if ((p.getLocation().getX()<1585 || p.getLocation().getX()>1600 || p.getLocation().getZ()<24 || p.getLocation().getZ()>39 || p.getLocation().getY()<86.5d) && ( - (p.getName().compareTo(getConfig().getString("spleefrequesta4player"))==0 || p.getName().compareTo(getConfig().getString("spleefrequestb4player"))==0 + (p.getName().toLowerCase().compareTo(getConfig().getString("spleefrequesta4player"))==0 || p.getName().compareTo(getConfig().getString("spleefrequestb4player"))==0 || p.getName().compareTo(getConfig().getString("spleefrequestc4player"))==0 || p.getName().compareTo(getConfig().getString("spleefrequestd4player"))==0))) { //You lose. //See if we're the winner. @@ -2080,7 +2082,7 @@ public void runTick() { if (getConfig().getString("spleefrequesta4player").compareTo("none")==0) { countdead++; } else { - if (getConfig().getString("spleefrequesta4player").compareTo(p.getName())==0) { + if (getConfig().getString("spleefrequesta4player").compareTo(p.getName().toLowerCase())==0) { losingplayer=Bukkit.getPlayer(getConfig().getString("spleefrequesta4player")); } else { winningplayer=Bukkit.getPlayer(getConfig().getString("spleefrequesta4player")); @@ -2089,7 +2091,7 @@ public void runTick() { if (getConfig().getString("spleefrequestb4player").compareTo("none")==0) { countdead++; } else { - if (getConfig().getString("spleefrequestb4player").compareTo(p.getName())==0) { + if (getConfig().getString("spleefrequestb4player").compareTo(p.getName().toLowerCase())==0) { losingplayer=Bukkit.getPlayer(getConfig().getString("spleefrequestb4player")); } else { winningplayer=Bukkit.getPlayer(getConfig().getString("spleefrequestb4player")); @@ -2098,7 +2100,7 @@ public void runTick() { if (getConfig().getString("spleefrequestc4player").compareTo("none")==0) { countdead++; } else { - if (getConfig().getString("spleefrequestc4player").compareTo(p.getName())==0) { + if (getConfig().getString("spleefrequestc4player").compareTo(p.getName().toLowerCase())==0) { losingplayer=Bukkit.getPlayer(getConfig().getString("spleefrequestc4player")); } else { winningplayer=Bukkit.getPlayer(getConfig().getString("spleefrequestc4player")); @@ -2107,7 +2109,7 @@ public void runTick() { if (getConfig().getString("spleefrequestd4player").compareTo("none")==0) { countdead++; } else { - if (getConfig().getString("spleefrequestd4player").compareTo(p.getName())==0) { + if (getConfig().getString("spleefrequestd4player").compareTo(p.getName().toLowerCase())==0) { losingplayer=Bukkit.getPlayer(getConfig().getString("spleefrequestd4player")); } else { winningplayer=Bukkit.getPlayer(getConfig().getString("spleefrequestd4player")); @@ -2146,7 +2148,7 @@ public void runTick() { p.getInventory().clear(); p.getInventory().clear(p.getInventory().getHeldItemSlot()); //Give inventories back. - if (getConfig().getString("spleefrequesta4player").compareTo(p.getName())==0) { + if (getConfig().getString("spleefrequesta4player").compareTo(p.getName().toLowerCase())==0) { for (int i=0;i78.0d && p.getLocation().getZ()>53.0d && p.getLocation().getZ()<64.0d && p.getLocation().getX()<1627.0d && p.getLocation().getX()>1616.0d) { Location newloc = p.getLocation(); newloc.setX(1622.5d); @@ -2651,7 +2653,7 @@ public void checkJukeboxes() { Player p = Bukkit.getPlayer(explorers.get(i).name); if (explorers.get(i).event==1 && Bukkit.getPlayer(explorers.get(i).name)!=null && !Bukkit.getPlayer(explorers.get(i).name).isDead()) { if (getJobLv("Explorer", p)>=10) { - PersistentExplorerList eve = new PersistentExplorerList(p.getName()); + PersistentExplorerList eve = new PersistentExplorerList(p.getName().toLowerCase()); eve.event=1; eve.data=p.getExp(); eve.data2=p.getLevel(); @@ -2659,12 +2661,12 @@ public void checkJukeboxes() { explorers.add(eve); } } - if (explorers.get(i).event==1 && explorers.get(i).name.compareTo(p.getName())==0) { + if (explorers.get(i).event==1 && explorers.get(i).name.compareTo(p.getName().toLowerCase())==0) { exppoint=i; //p.setTotalExperience(p.getTotalExperience()+explorers.get(j).data); //p.sendMessage("Your experience: "+explorers.get(i).data+"/"+p.getTotalExperience()); } else - if (explorers.get(i).event==2 && explorers.get(i).name.compareTo(p.getName())==0) { + if (explorers.get(i).event==2 && explorers.get(i).name.compareTo(p.getName().toLowerCase())==0) { deadpoint=i; } if (exppoint!=-1 && deadpoint!=-1) { @@ -3367,18 +3369,18 @@ public void payDay(int time) allOnlineP.sendMessage(ChatColor.DARK_GREEN+"<=========["+ChatColor.LIGHT_PURPLE+"Interest"+ChatColor.DARK_GREEN+"]=========>"); DecimalFormat df = new DecimalFormat("#0.00"); allOnlineP.sendMessage(ChatColor.GOLD+"The money interest has been delivered to all players. ("+df.format((double)(Main.this.getConfig().getDouble("payday.amount")*100))+"% interest rate)"); - allOnlineP.sendMessage(ChatColor.GOLD+"Your Balance: $"+df.format((getAccountsConfig().getDouble(allOnlineP.getName() + ".money")))+" -> $"+df.format(((Main.this.getConfig().getDouble("payday.amount")*(getAccountsConfig().getDouble(allOnlineP.getName() + ".money"))+getAccountsConfig().getDouble(allOnlineP.getName() + ".money"))))); + allOnlineP.sendMessage(ChatColor.GOLD+"Your Balance: $"+df.format((getAccountsConfig().getDouble(allOnlineP.getName().toLowerCase() + ".money")))+" -> $"+df.format(((Main.this.getConfig().getDouble("payday.amount")*(getAccountsConfig().getDouble(allOnlineP.getName().toLowerCase() + ".money"))+getAccountsConfig().getDouble(allOnlineP.getName().toLowerCase() + ".money"))))); allOnlineP.sendMessage(ChatColor.DARK_GREEN+"<==========================>"); - getAccountsConfig().set(allOnlineP.getName() + ".money", ((Main.this.getConfig().getDouble("payday.amount")*(getAccountsConfig().getDouble(allOnlineP.getName() + ".money"))+getAccountsConfig().getDouble(allOnlineP.getName() + ".money")))); - //Main.economy.depositPlayer(allOnlineP.getName(), (Main.this.getConfig().getDouble("payday.amount")*Main.economy.bankBalance(allOnlineP.getName()).balance)); + getAccountsConfig().set(allOnlineP.getName().toLowerCase() + ".money", ((Main.this.getConfig().getDouble("payday.amount")*(getAccountsConfig().getDouble(allOnlineP.getName().toLowerCase() + ".money"))+getAccountsConfig().getDouble(allOnlineP.getName().toLowerCase() + ".money")))); + //Main.economy.depositPlayer(allOnlineP.getName().toLowerCase(), (Main.this.getConfig().getDouble("payday.amount")*Main.economy.bankBalance(allOnlineP.getName().toLowerCase()).balance)); } for (OfflinePlayer allOnlineP : Bukkit.getOfflinePlayers()) { if (!allOnlineP.isOnline()) { - getAccountsConfig().set(allOnlineP.getName() + ".money", ((Main.this.getConfig().getDouble("payday.amount")*(getAccountsConfig().getDouble(allOnlineP.getName() + ".money"))+getAccountsConfig().getDouble(allOnlineP.getName() + ".money")))); + getAccountsConfig().set(allOnlineP.getName().toLowerCase() + ".money", ((Main.this.getConfig().getDouble("payday.amount")*(getAccountsConfig().getDouble(allOnlineP.getName().toLowerCase() + ".money"))+getAccountsConfig().getDouble(allOnlineP.getName().toLowerCase() + ".money")))); } - //Main.economy.depositPlayer(allOnlineP.getName(), (Main.this.getConfig().getDouble("payday.amount")*Main.economy.bankBalance(allOnlineP.getName()).balance)); + //Main.economy.depositPlayer(allOnlineP.getName().toLowerCase(), (Main.this.getConfig().getDouble("payday.amount")*Main.economy.bankBalance(allOnlineP.getName().toLowerCase()).balance)); } - saveAccountsConfig(); + //saveAccountsConfig(); List expired_uuids = new ArrayList(); String moblist = getConfig().getString("fed.mobs"); String finalstring = ""; @@ -3532,13 +3534,13 @@ public void payDay(int time) public int getPlayerJobCount(Player p) { int count=0; - if (getAccountsConfig().getString(p.getName()+".jobs.job1").compareTo("None")!=0) { + if (getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job1").compareTo("None")!=0) { count++; } - if (getAccountsConfig().getString(p.getName()+".jobs.job2").compareTo("None")!=0) { + if (getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job2").compareTo("None")!=0) { count++; } - if (getAccountsConfig().getString(p.getName()+".jobs.job3").compareTo("None")!=0) { + if (getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job3").compareTo("None")!=0) { count++; } return count; @@ -3560,8 +3562,8 @@ public void payDay(int time) return; } if (PlayerinJob(p,job)) { - getAccountsConfig().set(p.getName()+".jobs.ultimate", String.valueOf(ValidJobs[matchedjob])); - saveAccountsConfig(); + getAccountsConfig().set(p.getName().toLowerCase()+".jobs.ultimate", String.valueOf(ValidJobs[matchedjob])); + //saveAccountsConfig(); p.sendMessage(ChatColor.YELLOW+"Set Declared Ultimate job to "+job); } else { p.sendMessage(ChatColor.GOLD+"Sorry, you are not in that job!"); @@ -3609,14 +3611,14 @@ public void payDay(int time) //Check for the slot we have "None" job in first. int openslot=0; for (int i=0;i<3;i++) { - if (getAccountsConfig().getString(p.getName()+".jobs.job"+(i+1)).equalsIgnoreCase("None")) { + if (getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job"+(i+1)).equalsIgnoreCase("None")) { openslot=i; Bukkit.getLogger().info("Found a None job slot."); break; } } if (ValidJobs[matchedjob].compareTo("Explorer")==0) { - explorerlist.add(new ExplorerData(p.getName(), p.getLocation().getX(), p.getLocation().getZ())); + explorerlist.add(new ExplorerData(p.getName().toLowerCase(), p.getLocation().getX(), p.getLocation().getZ())); } if (ValidJobs[matchedjob].compareTo("Support")==0) { supportplayers.add(new SupportPlayer(p)); @@ -3625,18 +3627,18 @@ public void payDay(int time) hunterplayers.add(p); } Bukkit.getLogger().info("Added extra job pieces when joining."); - getAccountsConfig().set(p.getName()+".jobs.job"+(openslot+1), String.valueOf(ValidJobs[matchedjob])); - getAccountsConfig().set(p.getName()+".jobs.job"+(openslot+1)+"lv", Integer.valueOf(1)); - getAccountsConfig().set(p.getName()+".jobs.job"+(openslot+1)+"exp", Double.valueOf(0)); - saveAccountsConfig(); + getAccountsConfig().set(p.getName().toLowerCase()+".jobs.job"+(openslot+1), String.valueOf(ValidJobs[matchedjob])); + getAccountsConfig().set(p.getName().toLowerCase()+".jobs.job"+(openslot+1)+"lv", Integer.valueOf(1)); + getAccountsConfig().set(p.getName().toLowerCase()+".jobs.job"+(openslot+1)+"exp", Double.valueOf(0)); + //saveAccountsConfig(); Bukkit.getLogger().info("Set job data."); - Bukkit.broadcastMessage(p.getName()+" has joined the "+JobColors[matchedjob]+ValidJobs[matchedjob]+ChatColor.WHITE+" job!"); + Bukkit.broadcastMessage(p.getName().toLowerCase()+" has joined the "+JobColors[matchedjob]+ValidJobs[matchedjob]+ChatColor.WHITE+" job!"); p.sendMessage("You can check out your job progress anytime with "+ChatColor.GOLD+"/jobs stats"+ChatColor.WHITE+"."); return true; } public String[] getJobs(Player p) { - String[] string= {getAccountsConfig().getString(p.getName()+".jobs.job1"),getAccountsConfig().getString(p.getName()+".jobs.job2"),getAccountsConfig().getString(p.getName()+".jobs.job3")}; + String[] string= {getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job1"),getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job2"),getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job3")}; return string; } @@ -3686,10 +3688,10 @@ public void payDay(int time) } JobsDataInfo info = Jobsinfo[getJobSlot(job)]; double val=0; - val = economy.getBalance(p.getName()); - economy.withdrawPlayer(p.getName(), val); - getAccountsConfig().set(p.getName()+".jobs.job"+(slot+1)+"exp", Double.valueOf(newexp)); - saveAccountsConfig(); + val = economy.getBalance(p.getName().toLowerCase()); + economy.withdrawPlayer(p.getName().toLowerCase(), val); + getAccountsConfig().set(p.getName().toLowerCase()+".jobs.job"+(slot+1)+"exp", Double.valueOf(newexp)); + //saveAccountsConfig(); } public void gainMoneyExp(Player p,String job,double amount,double exp) { @@ -3701,7 +3703,7 @@ public void payDay(int time) } //Add to how much we've earned so far. for (int i=0;i0) { @@ -3733,7 +3735,7 @@ public void payDay(int time) } } } - saveAccountsConfig(); + //saveAccountsConfig(); } public void levelUpJob(Player p, String job) { @@ -3760,15 +3762,15 @@ public void payDay(int time) if (slot!=-1) { JobsDataInfo info = Jobsinfo[getJobSlot(job)]; if (getJobLv(job,p)<40) { - getAccountsConfig().set(p.getName()+".jobs.job"+(slot+1)+"lv", Integer.valueOf(getAccountsConfig().getInt(p.getName()+".jobs.job"+(slot+1)+"lv")+1)); - Bukkit.broadcastMessage(p.getName()+" is now a Level "+getAccountsConfig().getInt(p.getName()+".jobs.job"+(slot+1)+"lv")+" "+getJobColor(job)+job+ChatColor.WHITE+"."); + getAccountsConfig().set(p.getName().toLowerCase()+".jobs.job"+(slot+1)+"lv", Integer.valueOf(getAccountsConfig().getInt(p.getName().toLowerCase()+".jobs.job"+(slot+1)+"lv")+1)); + Bukkit.broadcastMessage(p.getName().toLowerCase()+" is now a Level "+getAccountsConfig().getInt(p.getName().toLowerCase()+".jobs.job"+(slot+1)+"lv")+" "+getJobColor(job)+job+ChatColor.WHITE+"."); if (getJobTotalLvs(p)%5==0) { Bukkit.broadcastMessage(ChatColor.GREEN+p.getName()+" has reached Level "+getJobTotalLvs(p)+"!"); if ((((getJobTotalLvs(p)/5+1)-getStatPointTotal(p)))>0) { p.sendMessage(ChatColor.GOLD+"You have earned 1 stat point! You now have "+(((getJobTotalLvs(p)/5+1)-getStatPointTotal(p)))+" stat point"+((((getJobTotalLvs(p)/5+1)-getStatPointTotal(p)))==1?"":"s")+" to spend. "+ChatColor.ITALIC+ChatColor.BLUE+" Type /sp to spend them!"); } } - saveAccountsConfig(); + //saveAccountsConfig(); p.getInventory().removeItem(j); } else { p.sendMessage(ChatColor.GOLD+"You can't level this job. It is already at max level."); @@ -3789,7 +3791,7 @@ public void payDay(int time) } //Add to how much we've earned so far. for (int i=0;i0) { - base_hplv+=this.plugin.getStatBonus(7, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat8")/2); + if (this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat8")>0) { + base_hplv+=this.plugin.getStatBonus(7, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat8")/2); } //Check player equipment to see if an item could possibly have a health buff. for (int i=0;i0) { + if (!hasabsorption && this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat4")>0) { p.removePotionEffect(PotionEffectType.ABSORPTION); - p.addPotionEffect(new PotionEffect(PotionEffectType.ABSORPTION,3590,this.plugin.getStatBonus(3, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat4")/3)/4-1)); - //p.sendMessage("Absorption level is "+(this.plugin.getStatBonus(3, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat4")/4)/4-1)); + p.addPotionEffect(new PotionEffect(PotionEffectType.ABSORPTION,3590,this.plugin.getStatBonus(3, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat4")/3)/4-1)); + //p.sendMessage("Absorption level is "+(this.plugin.getStatBonus(3, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat4")/4)/4-1)); } - if (this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat2")>0) { + if (this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat2")>0) { p.removePotionEffect(PotionEffectType.FAST_DIGGING); - p.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING,399,this.plugin.getStatBonus(1, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat2")/5)/20-1)); + p.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING,399,this.plugin.getStatBonus(1, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat2")/5)/20-1)); } //p.sendMessage("Health: "+p.getHealth()+"/"+p.getMaxHealth()+" Base HP Level: "+base_hplv); if (p.getHealth()>p.getMaxHealth()) { @@ -260,13 +260,13 @@ public class PlayerBuffData { } if (last_money_report_time+72000=20) { - if (this.plugin.getAccountsConfig().getDouble(playerlist[i].getName()+".spleefrating")>rating[0]) { + if (this.plugin.getAccountsConfig().contains(playerlist[i].getName().toLowerCase())) { + if (this.plugin.getAccountsConfig().contains(playerlist[i].getName().toLowerCase()+".spleefrating") && this.plugin.getAccountsConfig().getInt(playerlist[i].getName().toLowerCase()+".spleefwins")+this.plugin.getAccountsConfig().getInt(playerlist[i].getName().toLowerCase()+".spleeflosses")>=20) { + if (this.plugin.getAccountsConfig().getDouble(playerlist[i].getName().toLowerCase()+".spleefrating")>rating[0]) { //This beats the top record, move everything down. name[2]=name[1];rating[2]=rating[1];wins[2]=wins[1];losses[2]=losses[1]; name[1]=name[0];rating[1]=rating[0];wins[1]=wins[0];losses[1]=losses[0]; name[0]=playerlist[i].getName(); - rating[0]=(int)this.plugin.getAccountsConfig().getDouble(playerlist[i].getName()+".spleefrating"); - wins[0]=this.plugin.getAccountsConfig().getInt(playerlist[i].getName()+".spleefwins"); - losses[0]=this.plugin.getAccountsConfig().getInt(playerlist[i].getName()+".spleeflosses"); + rating[0]=(int)this.plugin.getAccountsConfig().getDouble(playerlist[i].getName().toLowerCase()+".spleefrating"); + wins[0]=this.plugin.getAccountsConfig().getInt(playerlist[i].getName().toLowerCase()+".spleefwins"); + losses[0]=this.plugin.getAccountsConfig().getInt(playerlist[i].getName().toLowerCase()+".spleeflosses"); } else - if (this.plugin.getAccountsConfig().getDouble(playerlist[i].getName()+".spleefrating")>rating[1]) { + if (this.plugin.getAccountsConfig().getDouble(playerlist[i].getName().toLowerCase()+".spleefrating")>rating[1]) { //This beats the 2nd record, move everything down. name[2]=name[1];rating[2]=rating[1];wins[2]=wins[1];losses[2]=losses[1]; name[1]=playerlist[i].getName(); - rating[1]=(int)this.plugin.getAccountsConfig().getDouble(playerlist[i].getName()+".spleefrating"); - wins[1]=this.plugin.getAccountsConfig().getInt(playerlist[i].getName()+".spleefwins"); - losses[1]=this.plugin.getAccountsConfig().getInt(playerlist[i].getName()+".spleeflosses"); + rating[1]=(int)this.plugin.getAccountsConfig().getDouble(playerlist[i].getName().toLowerCase()+".spleefrating"); + wins[1]=this.plugin.getAccountsConfig().getInt(playerlist[i].getName().toLowerCase()+".spleefwins"); + losses[1]=this.plugin.getAccountsConfig().getInt(playerlist[i].getName().toLowerCase()+".spleeflosses"); } else - if (this.plugin.getAccountsConfig().getDouble(playerlist[i].getName()+".spleefrating")>rating[2]) { + if (this.plugin.getAccountsConfig().getDouble(playerlist[i].getName().toLowerCase()+".spleefrating")>rating[2]) { //This beats the 3rd record, move everything down. name[2]=playerlist[i].getName(); - rating[2]=(int)this.plugin.getAccountsConfig().getDouble(playerlist[i].getName()+".spleefrating"); - wins[2]=this.plugin.getAccountsConfig().getInt(playerlist[i].getName()+".spleefwins"); - losses[2]=this.plugin.getAccountsConfig().getInt(playerlist[i].getName()+".spleeflosses"); + rating[2]=(int)this.plugin.getAccountsConfig().getDouble(playerlist[i].getName().toLowerCase()+".spleefrating"); + wins[2]=this.plugin.getAccountsConfig().getInt(playerlist[i].getName().toLowerCase()+".spleefwins"); + losses[2]=this.plugin.getAccountsConfig().getInt(playerlist[i].getName().toLowerCase()+".spleeflosses"); } } } @@ -321,7 +321,7 @@ implements Listener if (this.plugin.getAccountsConfig().getBoolean("halloween-enabled")) { e.setAmount(e.getAmount()*2); } - if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify3")) { + if (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify3")) { p.sendMessage(ChatColor.DARK_GREEN+""+ChatColor.ITALIC+"Gained "+e.getAmount()+" exp."); } } @@ -949,7 +949,7 @@ implements Listener this.plugin.animallist.add(new EntityInteractData(e.getRightClicked().getUniqueId(), p.getName())); } else { //Modify the owner. - this.plugin.animallist.get(slot).setOwner(p.getName()); + this.plugin.animallist.get(slot).setOwner(p.getName().toLowerCase()); } if (p.getItemInHand().getType()==Material.WHEAT) { if (e.getRightClicked().getType()==EntityType.COW) { @@ -1396,11 +1396,11 @@ implements Listener } else { Bukkit.getWorld("world").setDifficulty(Difficulty.HARD); } - if (p.getScoreboard().getTeam(p.getName())!=null) { - tempteam=p.getScoreboard().getTeam(p.getName()); + if (p.getScoreboard().getTeam(p.getName().toLowerCase())!=null) { + tempteam=p.getScoreboard().getTeam(p.getName().toLowerCase()); tempteam.unregister(); } - tempteam=p.getScoreboard().registerNewTeam(p.getName()); + tempteam=p.getScoreboard().registerNewTeam(p.getName().toLowerCase()); if (p.hasPermission("group.moderator")) { tempteam.setPrefix(ChatColor.GREEN+""); } @@ -1428,7 +1428,7 @@ implements Listener p.getInventory().getArmorContents()[i].setItemMeta(meta); } } - /*if (p.getName().equalsIgnoreCase("AaMay")) { + /*if (p.getName().toLowerCase().equalsIgnoreCase("AaMay")) { p.removePotionEffect(PotionEffectType.SPEED); } */ @@ -1496,7 +1496,7 @@ implements Listener } String name = players.next().getName(); playerslist += name; - if (name.compareToIgnoreCase(p.getName())==0) { + if (name.compareToIgnoreCase(p.getName().toLowerCase())==0) { playerwhitelisted=true; } } @@ -1524,55 +1524,55 @@ implements Listener */ //System.out.println("Whitelisted Players: "+playerslist); //System.out.println("Maximum Air: "+p.getMaximumAir()); - if (!this.plugin.getAccountsConfig().contains(p.getName())) { + if (!this.plugin.getAccountsConfig().contains(p.getName().toLowerCase())) { //This is a brand new player. - Main.economy.withdrawPlayer(p.getName(), Main.economy.getBalance(p.getName())); - Main.economy.depositPlayer(p.getName(), 70); - this.plugin.getAccountsConfig().set(p.getName() + ".status", Boolean.valueOf(true)); - this.plugin.getAccountsConfig().set(p.getName() + ".money", Double.valueOf(this.plugin.getConfig().getDouble("start-balance"))); - this.plugin.getAccountsConfig().set(p.getName() + ".revived", Boolean.valueOf(true)); - this.plugin.getAccountsConfig().set(p.getName() + ".spleefrating", Double.valueOf(1000.0d)); - this.plugin.getAccountsConfig().set(p.getName() + ".spleefwins", Integer.valueOf(0)); - this.plugin.getAccountsConfig().set(p.getName() + ".spleeflosses", Integer.valueOf(0)); - this.plugin.getAccountsConfig().set(p.getName() + ".jobs.job1", String.valueOf("None")); - this.plugin.getAccountsConfig().set(p.getName() + ".jobs.job1lv", Integer.valueOf(0)); - this.plugin.getAccountsConfig().set(p.getName() + ".jobs.job1exp", Double.valueOf(0.0d)); - this.plugin.getAccountsConfig().set(p.getName() + ".jobs.job2", String.valueOf("None")); - this.plugin.getAccountsConfig().set(p.getName() + ".jobs.job2lv", Integer.valueOf(0)); - this.plugin.getAccountsConfig().set(p.getName() + ".jobs.job2exp", Double.valueOf(0.0d)); - this.plugin.getAccountsConfig().set(p.getName() + ".jobs.job3", String.valueOf("None")); - this.plugin.getAccountsConfig().set(p.getName() + ".jobs.job3lv", Integer.valueOf(0)); - this.plugin.getAccountsConfig().set(p.getName() + ".jobs.job3exp", Double.valueOf(0.0d)); - this.plugin.getAccountsConfig().set(p.getName() + ".jobs.ultimate", String.valueOf("None")); - this.plugin.getAccountsConfig().set(p.getName() + ".jobs.ultimatesealed", Boolean.valueOf(false)); - this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat1", Integer.valueOf(0)); - this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat2", Integer.valueOf(0)); - this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat3", Integer.valueOf(0)); - this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat4", Integer.valueOf(0)); - this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat5", Integer.valueOf(0)); - this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat6", Integer.valueOf(0)); - this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat7", Integer.valueOf(0)); - this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat8", Integer.valueOf(0)); - this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat9", Integer.valueOf(0)); - this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat10", Integer.valueOf(0)); - this.plugin.getAccountsConfig().set(p.getName() + ".settings.notify1", Boolean.valueOf(true)); - this.plugin.getAccountsConfig().set(p.getName() + ".settings.notify2", Boolean.valueOf(false)); - this.plugin.getAccountsConfig().set(p.getName() + ".settings.notify3", Boolean.valueOf(true)); - this.plugin.getAccountsConfig().set(p.getName() + ".settings.notify4", Boolean.valueOf(false)); - this.plugin.getAccountsConfig().set(p.getName() + ".settings.notify5", Boolean.valueOf(false)); - this.plugin.getAccountsConfig().set(p.getName() + ".settings.notify6", Boolean.valueOf(false)); - this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest1", Boolean.valueOf(false)); - this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest2", Boolean.valueOf(false)); - this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest3", Boolean.valueOf(false)); - this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest4", Boolean.valueOf(false)); - this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest5", Boolean.valueOf(false)); - this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest6", Boolean.valueOf(false)); - this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest7", Boolean.valueOf(false)); - this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest8", Boolean.valueOf(false)); - this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest9", Boolean.valueOf(false)); - this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest10", Boolean.valueOf(false)); - this.plugin.getAccountsConfig().set(p.getName()+".bonus.witherskeleton", Integer.valueOf(0)); - this.plugin.saveAccountsConfig(); + Main.economy.withdrawPlayer(p.getName().toLowerCase(), Main.economy.getBalance(p.getName().toLowerCase())); + Main.economy.depositPlayer(p.getName().toLowerCase(), 70); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".status", Boolean.valueOf(true)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".money", Double.valueOf(this.plugin.getConfig().getDouble("start-balance"))); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".revived", Boolean.valueOf(true)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".spleefrating", Double.valueOf(1000.0d)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".spleefwins", Integer.valueOf(0)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".spleeflosses", Integer.valueOf(0)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".jobs.job1", String.valueOf("None")); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".jobs.job1lv", Integer.valueOf(0)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".jobs.job1exp", Double.valueOf(0.0d)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".jobs.job2", String.valueOf("None")); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".jobs.job2lv", Integer.valueOf(0)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".jobs.job2exp", Double.valueOf(0.0d)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".jobs.job3", String.valueOf("None")); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".jobs.job3lv", Integer.valueOf(0)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".jobs.job3exp", Double.valueOf(0.0d)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".jobs.ultimate", String.valueOf("None")); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".jobs.ultimatesealed", Boolean.valueOf(false)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat1", Integer.valueOf(0)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat2", Integer.valueOf(0)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat3", Integer.valueOf(0)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat4", Integer.valueOf(0)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat5", Integer.valueOf(0)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat6", Integer.valueOf(0)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat7", Integer.valueOf(0)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat8", Integer.valueOf(0)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat9", Integer.valueOf(0)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat10", Integer.valueOf(0)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".settings.notify1", Boolean.valueOf(true)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".settings.notify2", Boolean.valueOf(false)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".settings.notify3", Boolean.valueOf(true)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".settings.notify4", Boolean.valueOf(false)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".settings.notify5", Boolean.valueOf(false)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".settings.notify6", Boolean.valueOf(false)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest1", Boolean.valueOf(false)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest2", Boolean.valueOf(false)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest3", Boolean.valueOf(false)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest4", Boolean.valueOf(false)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest5", Boolean.valueOf(false)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest6", Boolean.valueOf(false)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest7", Boolean.valueOf(false)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest8", Boolean.valueOf(false)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest9", Boolean.valueOf(false)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest10", Boolean.valueOf(false)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase()+".bonus.witherskeleton", Integer.valueOf(0)); + //this.plugin.saveAccountsConfig(); System.out.println("[BankEconomy] Bank account created for " + p.getName() + "."); if (playerwhitelisted) { Bukkit.broadcastMessage(ChatColor.LIGHT_PURPLE+"New player "+ChatColor.ITALIC+ChatColor.GOLD+p.getName()+ChatColor.RESET+ChatColor.LIGHT_PURPLE+" has joined the game."); @@ -1591,35 +1591,35 @@ implements Listener DecimalFormat df = new DecimalFormat("#0.00"); p.sendMessage(ChatColor.DARK_AQUA+"For a list of all changes made to this server, visit: http://z-gamers.net/changelog.html"); p.sendMessage("----------------------------"); - p.sendMessage(ChatColor.YELLOW+"Current Money Balance: $ "+df.format(Main.economy.bankBalance(p.getName()).balance)+", Bank Balance: $"+df.format(this.plugin.getAccountsConfig().getDouble(p.getName()+".money"))); + p.sendMessage(ChatColor.YELLOW+"Current Money Balance: $ "+df.format(Main.economy.bankBalance(p.getName().toLowerCase()).balance)+", Bank Balance: $"+df.format(this.plugin.getAccountsConfig().getDouble(p.getName().toLowerCase()+".money"))); //Update account information for the stat point update. - if (!this.plugin.getAccountsConfig().contains(p.getName() + ".bonus.witherskeleton")) { - this.plugin.getAccountsConfig().set(p.getName()+".bonus.witherskeleton", Integer.valueOf(0)); - this.plugin.saveAccountsConfig(); - } - if (!this.plugin.getAccountsConfig().contains(p.getName() + ".stats.stat1")) { - this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat1", Integer.valueOf(0)); - this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat2", Integer.valueOf(0)); - this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat3", Integer.valueOf(0)); - this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat4", Integer.valueOf(0)); - this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat5", Integer.valueOf(0)); - this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat6", Integer.valueOf(0)); - this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat7", Integer.valueOf(0)); - this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat8", Integer.valueOf(0)); - this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat9", Integer.valueOf(0)); - this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat10", Integer.valueOf(0)); - this.plugin.saveAccountsConfig(); + if (!this.plugin.getAccountsConfig().contains(p.getName().toLowerCase() + ".bonus.witherskeleton")) { + this.plugin.getAccountsConfig().set(p.getName().toLowerCase()+".bonus.witherskeleton", Integer.valueOf(0)); + //this.plugin.saveAccountsConfig(); + } + if (!this.plugin.getAccountsConfig().contains(p.getName().toLowerCase() + ".stats.stat1")) { + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat1", Integer.valueOf(0)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat2", Integer.valueOf(0)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat3", Integer.valueOf(0)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat4", Integer.valueOf(0)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat5", Integer.valueOf(0)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat6", Integer.valueOf(0)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat7", Integer.valueOf(0)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat8", Integer.valueOf(0)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat9", Integer.valueOf(0)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat10", Integer.valueOf(0)); + //this.plugin.saveAccountsConfig(); System.out.println("Updated " + p.getName() + "'s data with stat point update."); } //Update account information for notification settings. - if (!this.plugin.getAccountsConfig().contains(p.getName() + ".settings.notify1")) { - this.plugin.getAccountsConfig().set(p.getName() + ".settings.notify1", Boolean.valueOf(true)); - this.plugin.getAccountsConfig().set(p.getName() + ".settings.notify2", Boolean.valueOf(false)); - this.plugin.getAccountsConfig().set(p.getName() + ".settings.notify3", Boolean.valueOf(true)); - this.plugin.getAccountsConfig().set(p.getName() + ".settings.notify4", Boolean.valueOf(false)); - this.plugin.getAccountsConfig().set(p.getName() + ".settings.notify5", Boolean.valueOf(false)); - this.plugin.getAccountsConfig().set(p.getName() + ".settings.notify6", Boolean.valueOf(false)); - this.plugin.saveAccountsConfig(); + if (!this.plugin.getAccountsConfig().contains(p.getName().toLowerCase() + ".settings.notify1")) { + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".settings.notify1", Boolean.valueOf(true)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".settings.notify2", Boolean.valueOf(false)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".settings.notify3", Boolean.valueOf(true)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".settings.notify4", Boolean.valueOf(false)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".settings.notify5", Boolean.valueOf(false)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".settings.notify6", Boolean.valueOf(false)); + //this.plugin.saveAccountsConfig(); System.out.println("Updated " + p.getName() + "'s data with nofitications update."); } if (this.plugin.getConfig().getBoolean("halloween-enabled")) { @@ -1633,9 +1633,9 @@ implements Listener } } if (!full) { - if (!this.plugin.getAccountsConfig().contains(p.getName() + ".join.halloween_book")) { - this.plugin.getAccountsConfig().set(p.getName() + ".join.halloween_book", Boolean.valueOf(true)); - this.plugin.saveAccountsConfig(); + if (!this.plugin.getAccountsConfig().contains(p.getName().toLowerCase() + ".join.halloween_book")) { + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".join.halloween_book", Boolean.valueOf(true)); + //this.plugin.saveAccountsConfig(); System.out.println("Updated " + p.getName() + "'s data with a Halloween Book."); ItemStack book = new ItemStack(Material.WRITTEN_BOOK); BookMeta bookdata = (BookMeta)book.getItemMeta(); @@ -1651,9 +1651,9 @@ implements Listener book.setItemMeta(bookdata); p.getInventory().addItem(book); } - if (!this.plugin.getAccountsConfig().contains(p.getName() + ".join.halloween_vote_signs")) { - this.plugin.getAccountsConfig().set(p.getName() + ".join.halloween_vote_signs", Boolean.valueOf(true)); - this.plugin.saveAccountsConfig(); + if (!this.plugin.getAccountsConfig().contains(p.getName().toLowerCase() + ".join.halloween_vote_signs")) { + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".join.halloween_vote_signs", Boolean.valueOf(true)); + //this.plugin.saveAccountsConfig(); ItemStack sign = new ItemStack(Material.SIGN,2); ItemMeta meta = sign.getItemMeta(); meta.setDisplayName(ChatColor.BLUE+p.getName()); @@ -1662,31 +1662,31 @@ implements Listener p.sendMessage("You have received 2 vote signs. Go vote at the Pumpkin Patch for the best pumpkin! (Note that voting for yourself does not count. Please vote the best of the others' pumpkins.)"); } } else { - if (!this.plugin.getAccountsConfig().contains(p.getName() + ".join.halloween_vote_signs")) { + if (!this.plugin.getAccountsConfig().contains(p.getName().toLowerCase() + ".join.halloween_vote_signs")) { p.sendMessage("You do not have enough room in your inventory to receive Pumpkin vote signs. Clear some of your inventory and then rejoin."); } } - if (!this.plugin.getAccountsConfig().contains(p.getName() + ".halloween.chest1")) { - this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest1", Boolean.valueOf(false)); - this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest2", Boolean.valueOf(false)); - this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest3", Boolean.valueOf(false)); - this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest4", Boolean.valueOf(false)); - this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest5", Boolean.valueOf(false)); - this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest6", Boolean.valueOf(false)); - this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest7", Boolean.valueOf(false)); - this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest8", Boolean.valueOf(false)); - this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest9", Boolean.valueOf(false)); - this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest10", Boolean.valueOf(false)); - this.plugin.saveAccountsConfig(); + if (!this.plugin.getAccountsConfig().contains(p.getName().toLowerCase() + ".halloween.chest1")) { + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest1", Boolean.valueOf(false)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest2", Boolean.valueOf(false)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest3", Boolean.valueOf(false)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest4", Boolean.valueOf(false)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest5", Boolean.valueOf(false)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest6", Boolean.valueOf(false)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest7", Boolean.valueOf(false)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest8", Boolean.valueOf(false)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest9", Boolean.valueOf(false)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest10", Boolean.valueOf(false)); + //this.plugin.saveAccountsConfig(); } - if (!this.plugin.getAccountsConfig().contains(p.getName() + ".jobs.ultimate")) { - this.plugin.getAccountsConfig().set(p.getName() + ".jobs.ultimate", String.valueOf("None")); - this.plugin.getAccountsConfig().set(p.getName() + ".jobs.ultimatesealed", Boolean.valueOf(false)); - this.plugin.saveAccountsConfig(); + if (!this.plugin.getAccountsConfig().contains(p.getName().toLowerCase() + ".jobs.ultimate")) { + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".jobs.ultimate", String.valueOf("None")); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".jobs.ultimatesealed", Boolean.valueOf(false)); + //this.plugin.saveAccountsConfig(); } - if (!this.plugin.getAccountsConfig().contains(p.getName() + ".halloween.wand")) { - this.plugin.getAccountsConfig().set(p.getName() + ".halloween.wand", Long.valueOf(Main.SERVER_TICK_TIME)); - this.plugin.saveAccountsConfig(); + if (!this.plugin.getAccountsConfig().contains(p.getName().toLowerCase() + ".halloween.wand")) { + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.wand", Long.valueOf(Main.SERVER_TICK_TIME)); + //this.plugin.saveAccountsConfig(); } } //Check if this player has unallocated stat points. @@ -1696,8 +1696,8 @@ implements Listener p.sendMessage(ChatColor.GOLD+""); } //Set Stat Point specific stuff here. - if (this.plugin.getAccountsConfig().getInt(p.getName() + ".stats.stat10")>0) { - p.setMaximumAir(300+this.plugin.getStatBonus(9, this.plugin.getAccountsConfig().getInt(p.getName() + ".stats.stat10"))*20); + if (this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase() + ".stats.stat10")>0) { + p.setMaximumAir(300+this.plugin.getStatBonus(9, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase() + ".stats.stat10"))*20); } if (p.getLocation().getY()>78.0d && p.getLocation().getZ()>53.0d && p.getLocation().getZ()<64.0d && p.getLocation().getX()<1627.0d && p.getLocation().getX()>1616.0d) { //In a spleef zone. Kick this player out. @@ -1711,7 +1711,7 @@ implements Listener } boolean found=false; for (int i=0;i=24 && e.getBlock().getZ()<=39) || (e.getBlock().getX()==1600 && e.getBlock().getZ()>=24 && e.getBlock().getZ()<=39) || (e.getBlock().getZ()==24 && e.getBlock().getX()>=1585 && e.getBlock().getX()<=1600) || (e.getBlock().getZ()==39 && e.getBlock().getX()>=1585 && e.getBlock().getX()<=1600)) { e.setCancelled(true); } - if (this.plugin.getConfig().getBoolean("spleefinsession")==true && (this.plugin.getConfig().getString("spleefrequestaplayer").compareTo(p.getName())==0 || this.plugin.getConfig().getString("spleefrequestbplayer").compareTo(p.getName())==0)) { + if (this.plugin.getConfig().getBoolean("spleefinsession")==true && (this.plugin.getConfig().getString("spleefrequestaplayer").compareTo(p.getName().toLowerCase())==0 || this.plugin.getConfig().getString("spleefrequestbplayer").compareTo(p.getName().toLowerCase())==0)) { this.plugin.spleef_last_broken_block=p.getPlayerTime(); } - if (this.plugin.getConfig().getBoolean("spleef4insession")==true && (this.plugin.getConfig().getString("spleefrequesta4player").compareTo(p.getName())==0 || this.plugin.getConfig().getString("spleefrequestb4player").compareTo(p.getName())==0 || this.plugin.getConfig().getString("spleefrequestc4player").compareTo(p.getName())==0 || this.plugin.getConfig().getString("spleefrequestd4player").compareTo(p.getName())==0)) { + if (this.plugin.getConfig().getBoolean("spleef4insession")==true && (this.plugin.getConfig().getString("spleefrequesta4player").compareTo(p.getName().toLowerCase())==0 || this.plugin.getConfig().getString("spleefrequestb4player").compareTo(p.getName().toLowerCase())==0 || this.plugin.getConfig().getString("spleefrequestc4player").compareTo(p.getName().toLowerCase())==0 || this.plugin.getConfig().getString("spleefrequestd4player").compareTo(p.getName().toLowerCase())==0)) { this.plugin.spleef4_last_broken_block=p.getPlayerTime(); } if (p.getItemInHand()!=null && p.getItemInHand().getItemMeta()!=null && p.getItemInHand().getItemMeta().hasDisplayName()==true && p.getItemInHand().getItemMeta().getDisplayName().compareTo("Spleef Wooden Shovel")==0) { @@ -3805,12 +3805,12 @@ implements Listener Bukkit.getScheduler().scheduleSyncDelayedTask(this.plugin, new Runnable() { @Override public void run() { - p.getScoreboard().getTeam(p.getName()).setSuffix(healthbar(p.getHealth(),p.getMaxHealth(),p.getFoodLevel())); + p.getScoreboard().getTeam(p.getName().toLowerCase()).setSuffix(healthbar(p.getHealth(),p.getMaxHealth(),p.getFoodLevel())); } },5); if (e.getItem().getType()==Material.MILK_BUCKET) { for (int i=0;i effects = e.getPotion().getEffects().iterator(); try { Collection effects = e.getPotion().getEffects(); @@ -3885,7 +3885,7 @@ implements Listener if (nextpotioneffect.getType().getName().compareTo("SPEED")==0) { this.plugin.gainMoneyExp(shooter,"Support",0.15,6); for (int i=0;ip.getMaxHealth()) { @@ -3937,7 +3937,7 @@ implements Listener if (nextpotioneffect.getType().getName().compareTo("SPEED")==0) { this.plugin.gainMoneyExp(shooter,"Support",0.15,6); for (int i=0;i0) { - if (Math.random()<=this.plugin.getStatBonus(8, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat9"))/100.0d) { + if (this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat9")>0) { + if (Math.random()<=this.plugin.getStatBonus(8, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat9"))/100.0d) { e.setFoodLevel(e.getFoodLevel()+1); } } @@ -6632,26 +6632,26 @@ implements Listener } // 笆�笆�(Player)e.getPlayer()).sendMessage(((Player)e.getPlayer()).getScoreboard().getPlayerTeam((OfflinePlayer)e.getPlayer()).getName()); Player p = (Player)e.getPlayer(); - p.getScoreboard().getTeam(p.getName()).setPrefix(ChatColor.DARK_GRAY+""); + p.getScoreboard().getTeam(p.getName().toLowerCase()).setPrefix(ChatColor.DARK_GRAY+""); if (p.hasPermission("group.moderator")) { - p.getScoreboard().getTeam(p.getName()).setPrefix(ChatColor.DARK_GREEN+""); + p.getScoreboard().getTeam(p.getName().toLowerCase()).setPrefix(ChatColor.DARK_GREEN+""); } if (p.hasPermission("group.administrators")) { - p.getScoreboard().getTeam(p.getName()).setPrefix(ChatColor.DARK_PURPLE+""); + p.getScoreboard().getTeam(p.getName().toLowerCase()).setPrefix(ChatColor.DARK_PURPLE+""); } if (this.plugin.getConfig().getBoolean("halloween-enabled")) { for (int m=0;m0) { - p.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, (this.plugin.getStatBonus(5, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat6"))/3)*20, 0)); + if (this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat6")>0) { + p.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, (this.plugin.getStatBonus(5, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat6"))/3)*20, 0)); } } } @@ -6993,7 +6993,7 @@ implements Listener public void onRegainHealth(EntityRegainHealthEvent e) { if (e.getEntity().getType()==EntityType.PLAYER) { final Player p = (Player)e.getEntity(); - p.getScoreboard().getTeam(p.getName()).setSuffix(healthbar(p.getHealth(),p.getMaxHealth(),p.getFoodLevel())); + p.getScoreboard().getTeam(p.getName().toLowerCase()).setSuffix(healthbar(p.getHealth(),p.getMaxHealth(),p.getFoodLevel())); boolean regen_high=false; int duration=0; if (e.getRegainReason()==RegainReason.MAGIC_REGEN) { @@ -7028,8 +7028,8 @@ implements Listener }, 1L); } } - if (this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat1")>0) { - e.setAmount(e.getAmount()+this.plugin.getStatBonus(0, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat1")/6)); + if (this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat1")>0) { + e.setAmount(e.getAmount()+this.plugin.getStatBonus(0, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat1")/6)); } } } @@ -7274,7 +7274,7 @@ implements Listener if (e.getDamager() instanceof LivingEntity) { final double player_starthp = p.getHealth(); final LivingEntity l = (LivingEntity)e.getDamager(); - if (p.getNoDamageTicks()0) { + if (this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat3")>0) { double olddmg=e.getDamage(); - e.setDamage(e.getDamage()*(((100-this.plugin.getStatBonus(2, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat3")/4))/100.0d))); + e.setDamage(e.getDamage()*(((100-this.plugin.getStatBonus(2, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat3")/4))/100.0d))); //p.sendMessage("Damage set from "+olddmg+" to "+e.getDamage()); } } @@ -7792,7 +7792,7 @@ implements Listener if (e.getEntity().getType()==EntityType.PLAYER && e.getDamager().getType()==EntityType.ZOMBIE) { LivingEntity enemy = (LivingEntity)e.getDamager(); Player p = (Player)e.getEntity(); - p.getScoreboard().getTeam(p.getName()).setSuffix(healthbar(p.getHealth(),p.getMaxHealth(),p.getFoodLevel())); + p.getScoreboard().getTeam(p.getName().toLowerCase()).setSuffix(healthbar(p.getHealth(),p.getMaxHealth(),p.getFoodLevel())); double throughdmg=0; double maxdmg=0; if (enemy.getCustomName()!=null && (enemy.getCustomName().compareTo(ChatColor.YELLOW+"Charge Zombie")==0 || enemy.getCustomName().compareTo(ChatColor.DARK_PURPLE+"Charge Zombie III")==0)) { @@ -7800,7 +7800,7 @@ implements Listener if (throughdmg>e.getDamage()/2) { if (p.getHealth()-throughdmg>0) { p.setHealth(p.getHealth()-throughdmg); - if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify5") && e.getDamage()!=0) { + if (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify5") && e.getDamage()!=0) { //p.sendMessage(ChatColor.DARK_PURPLE+""+ChatColor.ITALIC+"You were hurt for "+Math.round(throughdmg*10)/10+" damage from "+convertToItemName(e.getCause().name())+"."); } } else { @@ -7811,12 +7811,12 @@ implements Listener //Check to see if our "fatal s urvivor" effect is available. boolean survivor=false; for (int i=0;i0) { p.setHealth(p.getHealth()-e.getDamage()/2); - if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify5") && e.getDamage()!=0) { + if (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify5") && e.getDamage()!=0) { //p.sendMessage(ChatColor.DARK_PURPLE+""+ChatColor.ITALIC+"You were hurt for "+Math.round(e.getDamage()/2*10)/10+" damage from "+convertToItemName(e.getCause().name())+"."); } } else { @@ -7844,12 +7844,12 @@ implements Listener //Check to see if our "fatal s urvivor" effect is available. boolean survivor=false; for (int i=0;ie.getDamage()) { if (p.getHealth()-throughdmg>0) { p.setHealth(p.getHealth()-throughdmg); - if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify5") && e.getDamage()!=0) { + if (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify5") && e.getDamage()!=0) { //p.sendMessage(ChatColor.DARK_PURPLE+""+ChatColor.ITALIC+"You were hurt for "+Math.round(throughdmg*10)/10+" damage from "+convertToItemName(e.getCause().name())+"."); } } else { @@ -7908,12 +7908,12 @@ implements Listener //Check to see if our "fatal s urvivor" effect is available. boolean survivor=false; for (int i=0;i0) { p.setHealth(p.getHealth()-e.getDamage()); - if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify5") && e.getDamage()!=0) { + if (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify5") && e.getDamage()!=0) { //p.sendMessage(ChatColor.DARK_PURPLE+""+ChatColor.ITALIC+"You were hurt for "+Math.round(e.getDamage()*10)/10+" damage from "+convertToItemName(e.getCause().name())+"."); } } else { @@ -7946,12 +7946,12 @@ implements Listener //Check to see if our "fatal s urvivor" effect is available. boolean survivor=false; for (int i=0;i0) { - e.setDamage(e.getDamage()+(this.plugin.getStatBonus(6, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat7"))/2)); + if (this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat7")>0) { + e.setDamage(e.getDamage()+(this.plugin.getStatBonus(6, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat7"))/2)); } //Add Armor penetration from the stat point, if any. - if (this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4)>0) { - armor_pen+=this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4); + if (this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat5")/4)>0) { + armor_pen+=this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat5")/4); } if (f.getNoDamageTicks()0) { double normaldmg=(this.plugin.DMGCALC.getDamage(f.getEquipment().getHelmet(), f.getEquipment().getChestplate(), f.getEquipment().getLeggings(), f.getEquipment().getBoots(), e.getDamage(), DamageCause.ENTITY_ATTACK, false)); double throughdmg=(this.plugin.DMGCALC.getDamage(new ItemStack(Material.AIR), new ItemStack(Material.AIR), new ItemStack(Material.AIR), new ItemStack(Material.AIR), e.getDamage(), DamageCause.ENTITY_ATTACK, false)); if (throughdmg>normaldmg+armor_pen) { //This means some piercing can be done. - //e.setDamage(normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4)); + //e.setDamage(normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat5")/4)); if (f.getHealth()-(normaldmg+armor_pen)>0) { f.setHealth(f.getHealth()-(normaldmg+armor_pen)); armor_pen_dmg=(normaldmg+armor_pen); if (f!=null) { - if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")) { + if (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify4")) { if (f.getCustomName()!=null) { //p.sendMessage(ChatColor.RED+""+ChatColor.ITALIC+" Dealt "+(Math.round(normaldmg+armor_pen)*10)/10+" damage to "+convertToItemName(f.getCustomName())+"."); } else { @@ -8148,7 +8148,7 @@ implements Listener f.setHealth(f.getHealth()-throughdmg); armor_pen_dmg=throughdmg; if (f!=null) { - if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")) { + if (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify4")) { if (f.getCustomName()!=null) { //p.sendMessage(ChatColor.RED+""+ChatColor.ITALIC+" Dealt "+(Math.round(throughdmg)*10)/10+" damage to "+convertToItemName(f.getCustomName())+"."); } else { @@ -8163,7 +8163,7 @@ implements Listener e.setDamage(0); } if (f.getNoDamageTicks()0) { - armor_pen+=this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4); + if (this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat5")/4)>0) { + armor_pen+=this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat5")/4); } if (e.getEntity() instanceof LivingEntity) { LivingEntity enemy = (LivingEntity)e.getEntity(); @@ -8288,8 +8288,8 @@ implements Listener //Deal 2 extra damage. e.setDamage(e.getDamage()+2); } - if (this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat7")>0) { - e.setDamage(e.getDamage()+(this.plugin.getStatBonus(6, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat7"))/2)); + if (this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat7")>0) { + e.setDamage(e.getDamage()+(this.plugin.getStatBonus(6, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat7"))/2)); } if (f.getNoDamageTicks()0) { double normaldmg=(this.plugin.DMGCALC.getDamage(f.getEquipment().getHelmet(), f.getEquipment().getChestplate(), f.getEquipment().getLeggings(), f.getEquipment().getBoots(), e.getDamage(), DamageCause.ENTITY_ATTACK, false)); @@ -8298,11 +8298,11 @@ implements Listener if (throughdmg>normaldmg+armor_pen) { //This means some piercing can be done. - //e.setDamage(normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4)); + //e.setDamage(normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat5")/4)); if (f.getHealth()-(normaldmg+armor_pen)>0) { f.setHealth(f.getHealth()-(normaldmg+armor_pen)); armor_pen_dmg=(normaldmg+armor_pen); - if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")) { + if (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify4")) { if (f.getCustomName()!=null) { //p.sendMessage(ChatColor.RED+""+ChatColor.ITALIC+" Dealt "+(Math.round(normaldmg+armor_pen)*10)/10+" damage to "+convertToItemName(f.getCustomName())+"."); } else { @@ -8317,7 +8317,7 @@ implements Listener if (f.getHealth()-throughdmg>0) { f.setHealth(f.getHealth()-throughdmg); armor_pen_dmg=throughdmg; - if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")) { + if (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify4")) { if (f.getCustomName()!=null) { //p.sendMessage(ChatColor.RED+""+ChatColor.ITALIC+" Dealt "+(Math.round(throughdmg)*10)/10+" damage to "+convertToItemName(f.getCustomName())+"."); } else { @@ -8331,7 +8331,7 @@ implements Listener e.setDamage(0); } if (f.getNoDamageTicks()=10 && crafteditem==true) { //This is an ugly fix for the problem...But it works somehow. - //Player newp = Bukkit.getPlayer(p.getName()); + //Player newp = Bukkit.getPlayer(p.getName().toLowerCase()); p.getInventory().addItem(new ItemStack(item.getType(),amount,item.getDurability(),item.getData().getData())); } } @@ -11748,7 +11748,7 @@ implements Listener if (this.plugin.getConfig().getBoolean("spleef4insession")) { //Check to see if we fall off. if ((p.getLocation().getX()<1585 || p.getLocation().getX()>1600 || p.getLocation().getZ()<24 || p.getLocation().getZ()>39 || p.getLocation().getY()<86.5d) && ( - (p.getName().compareTo(this.plugin.getConfig().getString("spleefrequesta4player"))==0 || p.getName().compareTo(this.plugin.getConfig().getString("spleefrequestb4player"))==0 + (p.getName().toLowerCase().compareTo(this.plugin.getConfig().getString("spleefrequesta4player"))==0 || p.getName().compareTo(this.plugin.getConfig().getString("spleefrequestb4player"))==0 || p.getName().compareTo(this.plugin.getConfig().getString("spleefrequestc4player"))==0 || p.getName().compareTo(this.plugin.getConfig().getString("spleefrequestd4player"))==0))) { //You lose. //See if we're the winner. @@ -11759,7 +11759,7 @@ implements Listener if (this.plugin.getConfig().getString("spleefrequesta4player").compareTo("none")==0) { countdead++; } else { - if (this.plugin.getConfig().getString("spleefrequesta4player").compareTo(p.getName())==0) { + if (this.plugin.getConfig().getString("spleefrequesta4player").compareTo(p.getName().toLowerCase())==0) { losingplayer=Bukkit.getPlayer(this.plugin.getConfig().getString("spleefrequesta4player")); } else { winningplayer=Bukkit.getPlayer(this.plugin.getConfig().getString("spleefrequesta4player")); @@ -11768,7 +11768,7 @@ implements Listener if (this.plugin.getConfig().getString("spleefrequestb4player").compareTo("none")==0) { countdead++; } else { - if (this.plugin.getConfig().getString("spleefrequestb4player").compareTo(p.getName())==0) { + if (this.plugin.getConfig().getString("spleefrequestb4player").compareTo(p.getName().toLowerCase())==0) { losingplayer=Bukkit.getPlayer(this.plugin.getConfig().getString("spleefrequestb4player")); } else { winningplayer=Bukkit.getPlayer(this.plugin.getConfig().getString("spleefrequestb4player")); @@ -11777,7 +11777,7 @@ implements Listener if (this.plugin.getConfig().getString("spleefrequestc4player").compareTo("none")==0) { countdead++; } else { - if (this.plugin.getConfig().getString("spleefrequestc4player").compareTo(p.getName())==0) { + if (this.plugin.getConfig().getString("spleefrequestc4player").compareTo(p.getName().toLowerCase())==0) { losingplayer=Bukkit.getPlayer(this.plugin.getConfig().getString("spleefrequestc4player")); } else { winningplayer=Bukkit.getPlayer(this.plugin.getConfig().getString("spleefrequestc4player")); @@ -11786,7 +11786,7 @@ implements Listener if (this.plugin.getConfig().getString("spleefrequestd4player").compareTo("none")==0) { countdead++; } else { - if (this.plugin.getConfig().getString("spleefrequestd4player").compareTo(p.getName())==0) { + if (this.plugin.getConfig().getString("spleefrequestd4player").compareTo(p.getName().toLowerCase())==0) { losingplayer=Bukkit.getPlayer(this.plugin.getConfig().getString("spleefrequestd4player")); } else { winningplayer=Bukkit.getPlayer(this.plugin.getConfig().getString("spleefrequestd4player")); @@ -11810,7 +11810,7 @@ implements Listener p.getInventory().clear(); p.getInventory().clear(p.getInventory().getHeldItemSlot()); //Give inventories back. - if (this.plugin.getConfig().getString("spleefrequesta4player").compareTo(p.getName())==0) { + if (this.plugin.getConfig().getString("spleefrequesta4player").compareTo(p.getName().toLowerCase())==0) { for (int i=0;i78.0d && p.getLocation().getZ()>53.0d && p.getLocation().getZ()<64.0d && p.getLocation().getX()<1627.0d && p.getLocation().getX()>1616.0d) { Location newloc = p.getLocation(); newloc.setX(1622.5d); @@ -12150,7 +12150,7 @@ implements Listener p.closeInventory(); } for (int i=0;i=10) { //Check to see if our "fatal s urvivor" effect is available. for (int i=0;i=20) { finalcost*=0.25; @@ -12644,7 +12644,7 @@ implements Listener 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)); - this.plugin.saveAccountsConfig(); + //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"))); this.plugin.last_bank_deposit_use_time=0; } else { @@ -12657,7 +12657,7 @@ implements Listener 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)); - this.plugin.saveAccountsConfig(); + //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"))); this.plugin.last_bank_deposit_use_time=0; } else { @@ -12678,7 +12678,7 @@ implements Listener //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)); - this.plugin.saveAccountsConfig(); + //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"))); this.plugin.last_bank_withdraw_use_time=0; @@ -12692,7 +12692,7 @@ implements Listener 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)); - this.plugin.saveAccountsConfig(); + //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"))); this.plugin.last_bank_withdraw_use_time=0; } else { @@ -13028,12 +13028,12 @@ implements Listener Action blockAction = e.getAction(); String currencySG = Main.economy.currencyNameSingular(); String currencyPL = Main.economy.currencyNamePlural(); - boolean stats = this.plugin.getAccountsConfig().getBoolean(p.getName() + ".status"); - double actMon = this.plugin.getAccountsConfig().getDouble(p.getName() + ".money"); - int actHand = (int)Main.economy.getBalance(p.getName()); + boolean stats = this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase() + ".status"); + double actMon = this.plugin.getAccountsConfig().getDouble(p.getName().toLowerCase() + ".money"); + int actHand = (int)Main.economy.getBalance(p.getName().toLowerCase()); if (this.plugin.PlayerinJob(p, "Explorer")) { for (int i=0;i400) { - if (p.getPlayerTime()-this.plugin.getConfig().getDouble("spleefrequestatime")>400 && (p.getName().compareTo(this.plugin.getConfig().getString("spleefrequestbplayer"))!=0 || p.getPlayerTime()-this.plugin.getConfig().getDouble("spleefrequestbtime")>400)) { + if (p.getPlayerTime()-this.plugin.getConfig().getDouble("spleefrequestatime")>400 && (p.getName().toLowerCase().compareTo(this.plugin.getConfig().getString("spleefrequestbplayer"))!=0 || p.getPlayerTime()-this.plugin.getConfig().getDouble("spleefrequestbtime")>400)) { Bukkit.broadcastMessage(ChatColor.RED+"[SPLEEF] "+ChatColor.YELLOW+"Spleef Player "+p.getName()+" requested a game in slot A. Join within 20 seconds."); this.plugin.getConfig().set("spleefrequestatime", Double.valueOf(p.getPlayerTime())); - this.plugin.getConfig().set("spleefrequestaplayer", String.valueOf(p.getName())); + this.plugin.getConfig().set("spleefrequestaplayer", String.valueOf(p.getName().toLowerCase())); } } else { - if (p.getName().compareTo(this.plugin.getConfig().getString("spleefrequestbplayer"))!=0) { + if (p.getName().toLowerCase().compareTo(this.plugin.getConfig().getString("spleefrequestbplayer"))!=0) { //This is a confirmed Spleef game. int playerarating,playerbrating; Player playera,playerb; playera=p; this.plugin.getConfig().set("spleefrequestatime", Double.valueOf(p.getPlayerTime())); - this.plugin.getConfig().set("spleefrequestaplayer", String.valueOf(p.getName())); + this.plugin.getConfig().set("spleefrequestaplayer", String.valueOf(p.getName().toLowerCase())); playerb=Bukkit.getPlayer(this.plugin.getConfig().getString("spleefrequestbplayer")); if (this.plugin.getAccountsConfig().contains(this.plugin.getConfig().getString("spleefrequestaplayer")+".spleefrating")) { playerarating=(int)this.plugin.getAccountsConfig().getDouble(this.plugin.getConfig().getString("spleefrequestaplayer")+".spleefrating")/10; @@ -13423,25 +13424,25 @@ implements Listener } } this.plugin.saveConfig(); - this.plugin.saveAccountsConfig(); + //this.plugin.saveAccountsConfig(); } } else if (sign.getBlock().getX()==1620 && sign.getBlock().getY()==83 && sign.getBlock().getZ()==45) { //Side B Request. //If not requested already. if (!this.plugin.getConfig().getBoolean("spleefinsession")) { if (p.getPlayerTime()-this.plugin.getConfig().getDouble("spleefrequestatime")>400) { - if (p.getPlayerTime()-this.plugin.getConfig().getDouble("spleefrequestbtime")>400 && (p.getName().compareTo(this.plugin.getConfig().getString("spleefrequestaplayer"))!=0 || p.getPlayerTime()-this.plugin.getConfig().getDouble("spleefrequestatime")>400)) { + if (p.getPlayerTime()-this.plugin.getConfig().getDouble("spleefrequestbtime")>400 && (p.getName().toLowerCase().compareTo(this.plugin.getConfig().getString("spleefrequestaplayer"))!=0 || p.getPlayerTime()-this.plugin.getConfig().getDouble("spleefrequestatime")>400)) { Bukkit.broadcastMessage(ChatColor.RED+"[SPLEEF] "+ChatColor.YELLOW+"Spleef Player "+p.getName()+" requested a game in slot B. Join within 20 seconds."); this.plugin.getConfig().set("spleefrequestbtime", Double.valueOf(p.getPlayerTime())); - this.plugin.getConfig().set("spleefrequestbplayer", String.valueOf(p.getName())); + this.plugin.getConfig().set("spleefrequestbplayer", String.valueOf(p.getName().toLowerCase())); } } else { - if (p.getName().compareTo(this.plugin.getConfig().getString("spleefrequestaplayer"))!=0) { + if (p.getName().toLowerCase().compareTo(this.plugin.getConfig().getString("spleefrequestaplayer"))!=0) { //This is a confirmed Spleef game. int playerarating,playerbrating; Player playera,playerb; this.plugin.getConfig().set("spleefrequestbtime", Double.valueOf(p.getPlayerTime())); - this.plugin.getConfig().set("spleefrequestbplayer", String.valueOf(p.getName())); + this.plugin.getConfig().set("spleefrequestbplayer", String.valueOf(p.getName().toLowerCase())); playera=Bukkit.getPlayer(this.plugin.getConfig().getString("spleefrequestaplayer")); playerb=p; if (this.plugin.getAccountsConfig().contains(this.plugin.getConfig().getString("spleefrequestaplayer")+".spleefrating")) { @@ -13494,7 +13495,7 @@ implements Listener } } this.plugin.saveConfig(); - this.plugin.saveAccountsConfig(); + //this.plugin.saveAccountsConfig(); } } if (stats) { @@ -13503,22 +13504,22 @@ implements Listener /*double value = Double.parseDouble(arg0); double total = actMon + value; if (value <= actHand) { - this.plugin.getAccountsConfig().set(p.getName() + ".money", Double.valueOf(total)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".money", Double.valueOf(total)); this.plugin.saveAccountsConfig(); if (value <= 1) p.sendMessage("�ァ2[BankEconomy]" + ChatColor.AQUA + " You added " + value + " " + currencySG + " to your bank account."); else { p.sendMessage("�ァ2[BankEconomy]" + ChatColor.AQUA + " You added " + value + " " + currencyPL + " to your bank account."); } - Main.economy.withdrawPlayer(p.getName(), value); + Main.economy.withdrawPlayer(p.getName().toLowerCase(), value); } else { p.sendMessage("�ァ2[BankEconomy]" + ChatColor.AQUA + " Sorry, you can't deposit that amount of money."); }*/ //If they were using the withdraw bank before, clear them from it. - if (this.plugin.last_bank_withdraw_user.equalsIgnoreCase(p.getName())) { + if (this.plugin.last_bank_withdraw_user.equalsIgnoreCase(p.getName().toLowerCase())) { this.plugin.last_bank_withdraw_user=""; } - if (this.plugin.last_bank_deposit_use_time+2000/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(0, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat1")/6)+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(0, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat1")/6+1):ChatColor.RED+"+"+this.plugin.getStatBonus(0, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat1")/6+1)):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(0, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat1")/6))))+ChatColor.GREEN+" Health Regeneration."); - p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"#9 "+ChatColor.RESET+ChatColor.WHITE+"+"+this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat2")/5+" - "+ChatColor.AQUA+" 5 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat2")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat2")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(1, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat2")/5)+"%"+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(1, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat2")/5+1)+"%":ChatColor.RED+"+"+this.plugin.getStatBonus(1, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat2")/5+1)+"%"):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(1, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat2")/5)+"%")))+ChatColor.GREEN+" block destroying speed."); - p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"#8 "+ChatColor.RESET+ChatColor.WHITE+"+"+this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat3")/4+" - "+ChatColor.AQUA+" 4 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat3")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat3")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(2, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat3")/4)+"%"+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(2, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat3")/4+1)+"%":ChatColor.RED+"+"+this.plugin.getStatBonus(2, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat3")/4+1)+"%"):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(2, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat3")/4)+"%")))+ChatColor.GREEN+" damage reduction."); - p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"#7 "+ChatColor.RESET+ChatColor.WHITE+"+"+this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4+" - "+ChatColor.AQUA+" 4 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4)+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4+1):ChatColor.RED+"+"+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4+1)):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4))))+ChatColor.GREEN+" armor penetration."); - p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"#6 "+ChatColor.RESET+ChatColor.WHITE+"+"+this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat4")/3+" - "+ChatColor.AQUA+" 3 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat4")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat4")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(3, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat4")/3)+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(3, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat4")/3+1):ChatColor.RED+"+"+this.plugin.getStatBonus(3, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat4")/3+1)):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(3, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat4")/3))))+ChatColor.GREEN+" temporary health. (Regenerates every 3 minutes)"); - p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"#5 "+ChatColor.RESET+ChatColor.WHITE+"+"+this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat6")/3+" - "+ChatColor.AQUA+" 3 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat6")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat6")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(5, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat6")/3)+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(5, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat6")/3+1):ChatColor.RED+"+"+this.plugin.getStatBonus(5, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat6")/3+1)):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(5, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat6")/3))))+ChatColor.GREEN+" seconds of fire resistance when caught on fire."); - p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"#4 "+ChatColor.RESET+ChatColor.WHITE+"+"+this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat7")/2+" - "+ChatColor.AQUA+" 2 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat7")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat7")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(6, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat7")/2)+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(6, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat7")/2+1):ChatColor.RED+"+"+this.plugin.getStatBonus(6, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat7")/2+1)):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(6, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat7")/2))))+ChatColor.GREEN+" base damage."); - p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"#3 "+ChatColor.RESET+ChatColor.WHITE+"+"+this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat8")/2+" - "+ChatColor.AQUA+" 2 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat8")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat8")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(7, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat8")/2)+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(7, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat8")/2+1):ChatColor.RED+"+"+this.plugin.getStatBonus(7, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat8")/2+1)):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(7, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat8")/2))))+ChatColor.GREEN+" health."); - p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"#2 "+ChatColor.RESET+ChatColor.WHITE+"-"+this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat9")/1+" - "+ChatColor.AQUA+" 1 pt: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat9")<25 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat9")>0/*Has a point in it.*/?ChatColor.YELLOW+"-"+this.plugin.getStatBonus(8, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat9")/1)+"%"+"/"+ChatColor.RED+"-"+this.plugin.getStatBonus(8, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat9")/1+1)+"%":ChatColor.RED+"-"+this.plugin.getStatBonus(8, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat9")/1+1)+"%"):(ChatColor.YELLOW+"-"+this.plugin.getStatBonus(8, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat9")/1)+"%")))+ChatColor.GREEN+" hunger decay."); - p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"#1 "+ChatColor.RESET+ChatColor.WHITE+"+"+this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat10")/1+" - "+ChatColor.AQUA+" 1 pt: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat10")<25 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat10")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(9, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat10")/1)+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(9, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat10")/1+1):ChatColor.RED+"+"+this.plugin.getStatBonus(9, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat10")/1+1)):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(9, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat10")/1))))+ChatColor.GREEN+" seconds of water breathing."); + p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"#10 "+ChatColor.RESET+ChatColor.WHITE+"+"+this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat1")/6+" - "+ChatColor.AQUA+" 6 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat1")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat1")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(0, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat1")/6)+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(0, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat1")/6+1):ChatColor.RED+"+"+this.plugin.getStatBonus(0, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat1")/6+1)):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(0, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat1")/6))))+ChatColor.GREEN+" Health Regeneration."); + p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"#9 "+ChatColor.RESET+ChatColor.WHITE+"+"+this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat2")/5+" - "+ChatColor.AQUA+" 5 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat2")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat2")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(1, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat2")/5)+"%"+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(1, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat2")/5+1)+"%":ChatColor.RED+"+"+this.plugin.getStatBonus(1, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat2")/5+1)+"%"):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(1, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat2")/5)+"%")))+ChatColor.GREEN+" block destroying speed."); + p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"#8 "+ChatColor.RESET+ChatColor.WHITE+"+"+this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat3")/4+" - "+ChatColor.AQUA+" 4 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat3")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat3")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(2, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat3")/4)+"%"+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(2, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat3")/4+1)+"%":ChatColor.RED+"+"+this.plugin.getStatBonus(2, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat3")/4+1)+"%"):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(2, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat3")/4)+"%")))+ChatColor.GREEN+" damage reduction."); + p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"#7 "+ChatColor.RESET+ChatColor.WHITE+"+"+this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat5")/4+" - "+ChatColor.AQUA+" 4 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat5")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat5")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat5")/4)+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat5")/4+1):ChatColor.RED+"+"+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat5")/4+1)):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat5")/4))))+ChatColor.GREEN+" armor penetration."); + p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"#6 "+ChatColor.RESET+ChatColor.WHITE+"+"+this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat4")/3+" - "+ChatColor.AQUA+" 3 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat4")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat4")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(3, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat4")/3)+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(3, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat4")/3+1):ChatColor.RED+"+"+this.plugin.getStatBonus(3, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat4")/3+1)):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(3, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat4")/3))))+ChatColor.GREEN+" temporary health. (Regenerates every 3 minutes)"); + p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"#5 "+ChatColor.RESET+ChatColor.WHITE+"+"+this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat6")/3+" - "+ChatColor.AQUA+" 3 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat6")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat6")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(5, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat6")/3)+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(5, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat6")/3+1):ChatColor.RED+"+"+this.plugin.getStatBonus(5, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat6")/3+1)):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(5, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat6")/3))))+ChatColor.GREEN+" seconds of fire resistance when caught on fire."); + p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"#4 "+ChatColor.RESET+ChatColor.WHITE+"+"+this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat7")/2+" - "+ChatColor.AQUA+" 2 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat7")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat7")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(6, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat7")/2)+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(6, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat7")/2+1):ChatColor.RED+"+"+this.plugin.getStatBonus(6, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat7")/2+1)):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(6, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat7")/2))))+ChatColor.GREEN+" base damage."); + p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"#3 "+ChatColor.RESET+ChatColor.WHITE+"+"+this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat8")/2+" - "+ChatColor.AQUA+" 2 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat8")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat8")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(7, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat8")/2)+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(7, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat8")/2+1):ChatColor.RED+"+"+this.plugin.getStatBonus(7, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat8")/2+1)):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(7, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat8")/2))))+ChatColor.GREEN+" health."); + p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"#2 "+ChatColor.RESET+ChatColor.WHITE+"-"+this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat9")/1+" - "+ChatColor.AQUA+" 1 pt: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat9")<25 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat9")>0/*Has a point in it.*/?ChatColor.YELLOW+"-"+this.plugin.getStatBonus(8, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat9")/1)+"%"+"/"+ChatColor.RED+"-"+this.plugin.getStatBonus(8, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat9")/1+1)+"%":ChatColor.RED+"-"+this.plugin.getStatBonus(8, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat9")/1+1)+"%"):(ChatColor.YELLOW+"-"+this.plugin.getStatBonus(8, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat9")/1)+"%")))+ChatColor.GREEN+" hunger decay."); + p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"#1 "+ChatColor.RESET+ChatColor.WHITE+"+"+this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat10")/1+" - "+ChatColor.AQUA+" 1 pt: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat10")<25 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat10")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(9, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat10")/1)+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(9, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat10")/1+1):ChatColor.RED+"+"+this.plugin.getStatBonus(9, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat10")/1+1)):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(9, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat10")/1))))+ChatColor.GREEN+" seconds of water breathing."); p.sendMessage(ChatColor.ITALIC+""+ChatColor.DARK_AQUA+"Remember that 1 Health / Damage point is half a heart."); if (this.plugin.getStatPointTotal(p)"+ChatColor.WHITE+" - Teleport to a player for a cost."); } else - if (cmd.getName().equalsIgnoreCase("settings")) { + if (cmd.getName().toLowerCase().equalsIgnoreCase("settings")) { Inventory i = Bukkit.createInventory(p, 27, "Notification Options"); int count=-1; ItemStack temp,on,off; @@ -379,30 +379,30 @@ public String convertToItemName(String val) { ItemMeta temp_meta=temp.getItemMeta();temp_meta.setDisplayName(ChatColor.YELLOW+"Pick Up Items");List temp_meta_lore = new ArrayList();temp_meta_lore.add(ChatColor.ITALIC+"Get notified whenever you pick up items.");temp_meta_lore.add(ChatColor.ITALIC+"");temp_meta_lore.add(ChatColor.ITALIC+""+ChatColor.GRAY+"Click to toggle this option on or off.");temp_meta.setLore(temp_meta_lore);temp.setItemMeta(temp_meta); on=new ItemStack(Material.REDSTONE_TORCH_ON); off=new ItemStack(Material.REDSTONE_TORCH_OFF); - i.setItem(count+=2, temp);on.setItemMeta(temp_meta);off.setItemMeta(temp_meta); i.setItem(count+=1, (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify1")?on:off)); + i.setItem(count+=2, temp);on.setItemMeta(temp_meta);off.setItemMeta(temp_meta); i.setItem(count+=1, (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase().toLowerCase()+".settings.notify1")?on:off)); temp_meta.setDisplayName(ChatColor.YELLOW+"Craft Items");temp_meta_lore = new ArrayList();temp_meta_lore.add(ChatColor.ITALIC+"Get notified whenever you craft an item.");temp_meta_lore.add(ChatColor.ITALIC+"");temp_meta_lore.add(ChatColor.ITALIC+""+ChatColor.GRAY+"Click to toggle this option on or off.");temp_meta.setLore(temp_meta_lore); temp=new ItemStack(Material.WORKBENCH); - temp.setItemMeta(temp_meta);i.setItem(count+=3, temp);on.setItemMeta(temp_meta);off.setItemMeta(temp_meta); i.setItem(count+=1, (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify2")?on:off)); + temp.setItemMeta(temp_meta);i.setItem(count+=3, temp);on.setItemMeta(temp_meta);off.setItemMeta(temp_meta); i.setItem(count+=1, (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase().toLowerCase()+".settings.notify2")?on:off)); temp_meta.setDisplayName(ChatColor.YELLOW+"Experience Points");temp_meta_lore = new ArrayList();temp_meta_lore.add(ChatColor.ITALIC+"Get notified whenever you gain");temp_meta_lore.add(ChatColor.ITALIC+"experience points.");temp_meta_lore.add(ChatColor.ITALIC+"");temp_meta_lore.add(ChatColor.ITALIC+""+ChatColor.GRAY+"Click to toggle this option on or off.");temp_meta.setLore(temp_meta_lore); temp=new ItemStack(Material.SLIME_BALL); - temp.setItemMeta(temp_meta);i.setItem(count+=4, temp);on.setItemMeta(temp_meta);off.setItemMeta(temp_meta); i.setItem(count+=1, (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify3")?on:off)); + temp.setItemMeta(temp_meta);i.setItem(count+=4, temp);on.setItemMeta(temp_meta);off.setItemMeta(temp_meta); i.setItem(count+=1, (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase().toLowerCase()+".settings.notify3")?on:off)); temp_meta.setDisplayName(ChatColor.YELLOW+"Damage Dealt");temp_meta_lore = new ArrayList();temp_meta_lore.add(ChatColor.ITALIC+"Get notified whenever you deal");temp_meta_lore.add(ChatColor.ITALIC+"damage to enemies.");temp_meta_lore.add(ChatColor.ITALIC+"");temp_meta_lore.add(ChatColor.ITALIC+""+ChatColor.GRAY+"Click to toggle this option on or off.");temp_meta.setLore(temp_meta_lore); temp=new ItemStack(Material.IRON_SWORD); - temp.setItemMeta(temp_meta);i.setItem(count+=3, temp);on.setItemMeta(temp_meta);off.setItemMeta(temp_meta); i.setItem(count+=1, (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")?on:off)); + temp.setItemMeta(temp_meta);i.setItem(count+=3, temp);on.setItemMeta(temp_meta);off.setItemMeta(temp_meta); i.setItem(count+=1, (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase().toLowerCase()+".settings.notify4")?on:off)); temp_meta.setDisplayName(ChatColor.YELLOW+"Damage Received");temp_meta_lore = new ArrayList();temp_meta_lore.add(ChatColor.ITALIC+"Get notified whenever you take damage");temp_meta_lore.add(ChatColor.ITALIC+" from enemies and other sources of damage.");temp_meta_lore.add(ChatColor.ITALIC+"");temp_meta_lore.add(ChatColor.ITALIC+""+ChatColor.GRAY+"Click to toggle this option on or off.");temp_meta.setLore(temp_meta_lore); temp=new ItemStack(Material.IRON_CHESTPLATE); - temp.setItemMeta(temp_meta); i.setItem(count+=4, temp);on.setItemMeta(temp_meta);off.setItemMeta(temp_meta); i.setItem(count+=1, (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify5")?on:off)); + temp.setItemMeta(temp_meta); i.setItem(count+=4, temp);on.setItemMeta(temp_meta);off.setItemMeta(temp_meta); i.setItem(count+=1, (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase().toLowerCase()+".settings.notify5")?on:off)); temp_meta.setDisplayName(ChatColor.YELLOW+"Money Gained");temp_meta_lore = new ArrayList();temp_meta_lore.add(ChatColor.ITALIC+"Get notified of how much money you made");temp_meta_lore.add(ChatColor.ITALIC+" from your jobs in the past hour.");temp_meta_lore.add(ChatColor.ITALIC+"");temp_meta_lore.add(ChatColor.ITALIC+""+ChatColor.GRAY+"Click to toggle this option on or off.");temp_meta.setLore(temp_meta_lore); temp=new ItemStack(Material.GOLD_INGOT); - temp.setItemMeta(temp_meta);i.setItem(count+=3, temp);on.setItemMeta(temp_meta);off.setItemMeta(temp_meta); i.setItem(count+=1, (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify6")?on:off)); + temp.setItemMeta(temp_meta);i.setItem(count+=3, temp);on.setItemMeta(temp_meta);off.setItemMeta(temp_meta); i.setItem(count+=1, (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase().toLowerCase()+".settings.notify6")?on:off)); p.openInventory(i); } else - if (cmd.getName().equalsIgnoreCase("event")) { + if (cmd.getName().toLowerCase().equalsIgnoreCase("event")) { if (p.hasPermission("maintenance-mode-admin")) { p.sendMessage("Events available: halloween, thanksgiving. Use: /event "); } } else - if (cmd.getName().equalsIgnoreCase("maintenance")) { + if (cmd.getName().toLowerCase().equalsIgnoreCase("maintenance")) { if (p.hasPermission("maintenance-mode-admin")) { if (this.plugin.getConfig().getBoolean("maintenance-mode")) { this.plugin.getConfig().set("maintenance-mode", Boolean.valueOf(false)); @@ -414,13 +414,13 @@ public String convertToItemName(String val) { this.plugin.saveConfig(); } } else - if (cmd.getName().equalsIgnoreCase("transfer")) { + if (cmd.getName().toLowerCase().equalsIgnoreCase("transfer")) { p.sendMessage("Usage: "+ChatColor.RED+"/transfer name money"+ChatColor.WHITE+" - Transfer money to a player."); } else - if (cmd.getName().equalsIgnoreCase("revive")) { + if (cmd.getName().toLowerCase().equalsIgnoreCase("revive")) { p.sendMessage("Usage: "+ChatColor.RED+"/revive me "+ChatColor.WHITE+" - Revive to the last location you died at."); } else - if (cmd.getName().equalsIgnoreCase("unenchant")) { + if (cmd.getName().toLowerCase().equalsIgnoreCase("unenchant")) { Map map = p.getItemInHand().getEnchantments(); for (Map.Entry entry : map.entrySet()) { p.getItemInHand().removeEnchantment(entry.getKey()); @@ -441,11 +441,11 @@ public String convertToItemName(String val) { p.sendMessage("Enchantments and bonuses removed on this item."); } else - if (cmd.getName().equalsIgnoreCase("ticktime")) { + if (cmd.getName().toLowerCase().equalsIgnoreCase("ticktime")) { p.sendMessage("Current Server Time: "+ChatColor.GRAY+""+ChatColor.ITALIC+Main.SERVER_TICK_TIME); } else - if (cmd.getName().equalsIgnoreCase("jobs")) { + if (cmd.getName().toLowerCase().equalsIgnoreCase("jobs")) { FileConfiguration config = this.plugin.getConfig(); int MAXJOBS = config.getInt("jobs.MAX_JOBS"); p.sendMessage(ChatColor.GOLD+" Blacksmith ("+config.getInt("jobs.Blacksmith")+"/"+MAXJOBS+")"); @@ -502,7 +502,7 @@ public String convertToItemName(String val) { "- Reloads config and accounts."); } } else - if (cmd.getName().equalsIgnoreCase("event") && args.length==1 && p.hasPermission("maintenance-mode-admin")) { + if (cmd.getName().toLowerCase().equalsIgnoreCase("event") && args.length==1 && p.hasPermission("maintenance-mode-admin")) { if (args[0].equalsIgnoreCase("halloween")) { if (this.plugin.getConfig().getBoolean("halloween-enabled")) { this.plugin.getConfig().set("halloween-enabled", Boolean.valueOf(false)); @@ -540,7 +540,7 @@ public String convertToItemName(String val) { p.getWorld().dropItemNaturally(p.getLocation(), chest); } } else - if (cmd.getName().equalsIgnoreCase("event") && args.length==2 && p.hasPermission("maintenance-mode-admin")) { + if (cmd.getName().toLowerCase().equalsIgnoreCase("event") && args.length==2 && p.hasPermission("maintenance-mode-admin")) { if (args[0].equalsIgnoreCase("head")) { ItemStack m = new ItemStack(Material.SKULL_ITEM, 64, (short)SkullType.PLAYER.ordinal()); SkullMeta skullMeta = (SkullMeta) m.getItemMeta(); @@ -1195,136 +1195,136 @@ public String convertToItemName(String val) { this.plugin.saveConfig(); } } else - if (cmd.getName().equalsIgnoreCase("dungeon") && p.hasPermission("maintenance-mode-admin") && args.length==1) { + if (cmd.getName().toLowerCase().equalsIgnoreCase("dungeon") && p.hasPermission("maintenance-mode-admin") && args.length==1) { //Dungeon x = new Dungeon(new Location(Bukkit.getWorld("world"),-8990,0,-4),new Location(Bukkit.getWorld("world"),50,255,50),Integer.valueOf(args[0])); } else - if (cmd.getName().equalsIgnoreCase("transfer") && args.length==1) { + if (cmd.getName().toLowerCase().equalsIgnoreCase("transfer") && args.length==1) { p.sendMessage("Usage: "+ChatColor.RED+"/transfer name money"+ChatColor.WHITE+" - Transfer money to a player."); } else - if (cmd.getName().equalsIgnoreCase("transfer") && args.length==2) { + if (cmd.getName().toLowerCase().equalsIgnoreCase("transfer") && args.length==2) { double amount = Double.parseDouble(args[1].replaceAll("[^0-9\\.]", "")); Player target = p.getServer().getPlayer(args[0]); if (target == null) { p.sendMessage(this.prefix + " " + this.offlinePlayer); } - else if (target.getName() == p.getName()) { + else if (target.getName().toLowerCase() == p.getName().toLowerCase()) { p.sendMessage(this.prefix + " " + this.cmdTransferSameNick); } else if (amount > playerBankBalance) { p.sendMessage(this.prefix + " " + this.notEnoughMoney); } else if (amount <= playerBankBalance) { double totalWithdraw = playerBankBalance - amount; - double totalDeposit = amount + this.plugin.getAccountsConfig().getInt(target.getName() + ".money"); + double totalDeposit = amount + this.plugin.getAccountsConfig().getInt(target.getName().toLowerCase() + ".money"); - this.plugin.getAccountsConfig().set(p.getName() + ".money", Double.valueOf(totalWithdraw)); - this.plugin.getAccountsConfig().set(target.getName() + ".money", Double.valueOf(totalDeposit)); - this.plugin.saveAccountsConfig(); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase().toLowerCase() + ".money", Double.valueOf(totalWithdraw)); + this.plugin.getAccountsConfig().set(target.getName().toLowerCase() + ".money", Double.valueOf(totalDeposit)); + //this.plugin.saveAccountsConfig(); if (amount > 1.0D) { - p.sendMessage(this.prefix + " " + this.cmdTransferToPlayer1 + " " + amount + currencyPlural + " " + this.cmdTransferToPlayer2 + " " + target.getName() + "a."); - target.sendMessage(this.prefix + " b" + p.getName() + " " + this.cmdTransferToTarget1 + " " + amount + currencyPlural + "a."); + p.sendMessage(this.prefix + " " + this.cmdTransferToPlayer1 + " " + amount + currencyPlural + " " + this.cmdTransferToPlayer2 + " " + target.getName().toLowerCase() + "a."); + target.sendMessage(this.prefix + " b" + p.getName().toLowerCase() + " " + this.cmdTransferToTarget1 + " " + amount + currencyPlural + "a."); } else if (amount <= 1.0D) { - p.sendMessage(this.prefix + " " + this.cmdTransferToPlayer1 + " " + amount + currencySingular + " " + this.cmdTransferToPlayer2 + " " + target.getName() + "a."); - target.sendMessage(this.prefix + " b" + p.getName() + " " + this.cmdTransferToTarget1 + " " + amount + currencySingular + "a."); + p.sendMessage(this.prefix + " " + this.cmdTransferToPlayer1 + " " + amount + currencySingular + " " + this.cmdTransferToPlayer2 + " " + target.getName().toLowerCase() + "a."); + target.sendMessage(this.prefix + " b" + p.getName().toLowerCase() + " " + this.cmdTransferToTarget1 + " " + amount + currencySingular + "a."); } } } else - if (cmd.getName().equalsIgnoreCase("sp") && args.length==1) { + if (cmd.getName().toLowerCase().equalsIgnoreCase("sp") && args.length==1) { try { int readvalue = Integer.valueOf(args[0]); if (readvalue<=10 && readvalue>=1) { int statpoints = (this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p); if (readvalue==10) { if (statpoints>=6) { - this.plugin.getAccountsConfig().set(p.getName()+".stats.stat1", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat1")+6)); - this.plugin.saveAccountsConfig(); - p.sendMessage("You added 1 stat point to Health Regeneration! "+ChatColor.BLUE+"You now have "+this.plugin.getStatBonus(0, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat1")/6)+" of extra health regeneration! (Every time you regenerate health, you get "+this.plugin.getStatBonus(0, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat1"))+" extra hearts!) "+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+" left."); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase().toLowerCase()+".stats.stat1", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat1")+6)); + //this.plugin.saveAccountsConfig(); + p.sendMessage("You added 1 stat point to Health Regeneration! "+ChatColor.BLUE+"You now have "+this.plugin.getStatBonus(0, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat1")/6)+" of extra health regeneration! (Every time you regenerate health, you get "+this.plugin.getStatBonus(0, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat1"))+" extra hearts!) "+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+" left."); } else { p.sendMessage(ChatColor.RED+"You do not have enough stat points to get that stat! (You need 6.)"); } } else if (readvalue==9) { if (statpoints>=5) { - this.plugin.getAccountsConfig().set(p.getName()+".stats.stat2", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat2")+5)); - this.plugin.saveAccountsConfig(); - p.sendMessage("You added 1 stat point to block destroying speed! "+ChatColor.BLUE+"You now have "+this.plugin.getStatBonus(1, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat2")/5)+"% block destruction speed! "+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+" left."); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase().toLowerCase()+".stats.stat2", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat2")+5)); + //this.plugin.saveAccountsConfig(); + p.sendMessage("You added 1 stat point to block destroying speed! "+ChatColor.BLUE+"You now have "+this.plugin.getStatBonus(1, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat2")/5)+"% block destruction speed! "+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+" left."); } else { p.sendMessage(ChatColor.RED+"You do not have enough stat points to get that stat! (You need 5.)"); } } else if (readvalue==8) { if (statpoints>=4) { - this.plugin.getAccountsConfig().set(p.getName()+".stats.stat3", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat3")+4)); - this.plugin.saveAccountsConfig(); - p.sendMessage("You added 1 stat point to block damage reduction! "+ChatColor.BLUE+"You now have "+this.plugin.getStatBonus(2, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat3")/4)+"% of damage taken reduced! "+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+" left."); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase().toLowerCase()+".stats.stat3", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat3")+4)); + //this.plugin.saveAccountsConfig(); + p.sendMessage("You added 1 stat point to block damage reduction! "+ChatColor.BLUE+"You now have "+this.plugin.getStatBonus(2, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat3")/4)+"% of damage taken reduced! "+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+" left."); } else { p.sendMessage(ChatColor.RED+"You do not have enough stat points to get that stat! (You need 4.)"); } } else if (readvalue==6) { if (statpoints>=3) { - this.plugin.getAccountsConfig().set(p.getName()+".stats.stat4", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat4")+3)); - this.plugin.saveAccountsConfig(); - p.sendMessage("You added 1 stat point to temporary health! "+ChatColor.BLUE+"You now have "+this.plugin.getStatBonus(3, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat4")/4)+" extra temporary health. (Regenerates every 3 minutes.) "+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+" left."); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase().toLowerCase()+".stats.stat4", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat4")+3)); + //this.plugin.saveAccountsConfig(); + p.sendMessage("You added 1 stat point to temporary health! "+ChatColor.BLUE+"You now have "+this.plugin.getStatBonus(3, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat4")/4)+" extra temporary health. (Regenerates every 3 minutes.) "+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+" left."); } else { p.sendMessage(ChatColor.RED+"You do not have enough stat points to get that stat! (You need 3.)"); } } else if (readvalue==7) { if (statpoints>=4) { - this.plugin.getAccountsConfig().set(p.getName()+".stats.stat5", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")+4)); - this.plugin.saveAccountsConfig(); - p.sendMessage("You added 1 stat point to armor penetration! "+ChatColor.BLUE+"You now have "+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4)+" damage of armor penetration. Armor-Wearers will be more afraid of you! "+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+" left."); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase().toLowerCase()+".stats.stat5", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat5")+4)); + //this.plugin.saveAccountsConfig(); + p.sendMessage("You added 1 stat point to armor penetration! "+ChatColor.BLUE+"You now have "+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat5")/4)+" damage of armor penetration. Armor-Wearers will be more afraid of you! "+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+" left."); } else { p.sendMessage(ChatColor.RED+"You do not have enough stat points to get that stat! (You need 4.)"); } } else if (readvalue==5) { if (statpoints>=3) { - this.plugin.getAccountsConfig().set(p.getName()+".stats.stat6", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat6")+3)); - this.plugin.saveAccountsConfig(); - p.sendMessage("You added 1 stat point to fire resistance! "+ChatColor.BLUE+"You now have "+this.plugin.getStatBonus(5, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat6")/3)+" seconds of fire resistance when you catch on fire. (Resets when you stop burning) "+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+" left."); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase().toLowerCase()+".stats.stat6", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat6")+3)); + //this.plugin.saveAccountsConfig(); + p.sendMessage("You added 1 stat point to fire resistance! "+ChatColor.BLUE+"You now have "+this.plugin.getStatBonus(5, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat6")/3)+" seconds of fire resistance when you catch on fire. (Resets when you stop burning) "+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+" left."); } else { p.sendMessage(ChatColor.RED+"You do not have enough stat points to get that stat! (You need 3.)"); } } else if (readvalue==4) { if (statpoints>=2) { - this.plugin.getAccountsConfig().set(p.getName()+".stats.stat7", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat7")+2)); - this.plugin.saveAccountsConfig(); - p.sendMessage("You added 1 stat point to base damage! "+ChatColor.BLUE+"You now have +"+this.plugin.getStatBonus(6, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat7")/2)+" base damage. "+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+" left."); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase().toLowerCase()+".stats.stat7", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat7")+2)); + //this.plugin.saveAccountsConfig(); + p.sendMessage("You added 1 stat point to base damage! "+ChatColor.BLUE+"You now have +"+this.plugin.getStatBonus(6, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat7")/2)+" base damage. "+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+" left."); } else { p.sendMessage(ChatColor.RED+"You do not have enough stat points to get that stat! (You need 2.)"); } } else if (readvalue==3) { if (statpoints>=2) { - this.plugin.getAccountsConfig().set(p.getName()+".stats.stat8", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat8")+2)); - this.plugin.saveAccountsConfig(); - p.sendMessage("You added 1 stat point to base health! "+ChatColor.BLUE+"You now have +"+this.plugin.getStatBonus(7, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat8")/2)+" base health. "+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+" left."); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase().toLowerCase()+".stats.stat8", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat8")+2)); + //this.plugin.saveAccountsConfig(); + p.sendMessage("You added 1 stat point to base health! "+ChatColor.BLUE+"You now have +"+this.plugin.getStatBonus(7, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat8")/2)+" base health. "+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+" left."); } else { p.sendMessage(ChatColor.RED+"You do not have enough stat points to get that stat! (You need 2.)"); } } else if (readvalue==2) { if (statpoints>=1) { - this.plugin.getAccountsConfig().set(p.getName()+".stats.stat9", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat9")+1)); - this.plugin.saveAccountsConfig(); - p.sendMessage("You added 1 stat point to hunger decay! "+ChatColor.BLUE+"You now have "+this.plugin.getStatBonus(8, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat9"))+"% less hunger decay "+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+" left."); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase().toLowerCase()+".stats.stat9", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat9")+1)); + //this.plugin.saveAccountsConfig(); + p.sendMessage("You added 1 stat point to hunger decay! "+ChatColor.BLUE+"You now have "+this.plugin.getStatBonus(8, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat9"))+"% less hunger decay "+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+" left."); } else { p.sendMessage(ChatColor.RED+"You do not have enough stat points to get that stat! (You need 1.)"); } } else if (readvalue==1) { if (statpoints>=1) { - this.plugin.getAccountsConfig().set(p.getName()+".stats.stat10", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat10")+1)); - this.plugin.saveAccountsConfig(); - p.sendMessage("You added 1 stat point to water breathing! "+ChatColor.BLUE+"You now have "+this.plugin.getStatBonus(9, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat10"))+" seconds of water breathing. "+ChatColor.WHITE+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+" left."); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase().toLowerCase()+".stats.stat10", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat10")+1)); + //this.plugin.saveAccountsConfig(); + p.sendMessage("You added 1 stat point to water breathing! "+ChatColor.BLUE+"You now have "+this.plugin.getStatBonus(9, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".stats.stat10"))+" seconds of water breathing. "+ChatColor.WHITE+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+" left."); //Increase maximum air by 200 ticks. - p.setMaximumAir(300+this.plugin.getStatBonus(9, this.plugin.getAccountsConfig().getInt(p.getName() + ".stats.stat10"))*20); + p.setMaximumAir(300+this.plugin.getStatBonus(9, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase() + ".stats.stat10"))*20); } else { p.sendMessage(ChatColor.RED+"You do not have enough stat points to get that stat! (You need 1.)"); } @@ -1336,7 +1336,7 @@ public String convertToItemName(String val) { p.sendMessage(ChatColor.RED+"The inputted slot is not a valid number."); } } - else if (cmd.getName().equalsIgnoreCase("bankeconomy") && (args[0].equalsIgnoreCase("info")) && (p.hasPermission("bankeconomy.info"))) { + else if (cmd.getName().toLowerCase().equalsIgnoreCase("bankeconomy") && (args[0].equalsIgnoreCase("info")) && (p.hasPermission("bankeconomy.info"))) { if (args.length == 1) { if (playerBankBalance <= 1) p.sendMessage(this.prefix + " " + this.cmdInfo + " " + playerBankBalance + currencySingular + "a."); @@ -1346,7 +1346,7 @@ public String convertToItemName(String val) { else p.sendMessage(this.invARG); } - else if (cmd.getName().equalsIgnoreCase("bankeconomy") && (args[0].equalsIgnoreCase("check")) && (p.hasPermission("bankeconomy.check"))) { + else if (cmd.getName().toLowerCase().equalsIgnoreCase("bankeconomy") && (args[0].equalsIgnoreCase("check")) && (p.hasPermission("bankeconomy.check"))) { if (args.length == 1) { p.sendMessage(this.prefix + " " + this.usage + " " + this.cmdCheckARG1); } else if (args.length == 2) { @@ -1355,18 +1355,18 @@ public String convertToItemName(String val) { if (target == null) { p.sendMessage(this.prefix + " " + this.offlinePlayer); } else { - int targetBalance = this.plugin.getAccountsConfig().getInt(target.getName() + ".money"); + int targetBalance = this.plugin.getAccountsConfig().getInt(target.getName().toLowerCase() + ".money"); if (targetBalance <= 1) - p.sendMessage(this.prefix + "a " + target.getName() + this.cmdCheckReponsePlayer + " " + targetBalance + currencySingular); + p.sendMessage(this.prefix + "a " + target.getName().toLowerCase() + this.cmdCheckReponsePlayer + " " + targetBalance + currencySingular); else if (targetBalance > 1) - p.sendMessage(this.prefix + "a " + target.getName() + this.cmdCheckReponsePlayer + " " + targetBalance + currencyPlural); + p.sendMessage(this.prefix + "a " + target.getName().toLowerCase() + this.cmdCheckReponsePlayer + " " + targetBalance + currencyPlural); } } else { p.sendMessage(this.invARG); } - } else if (cmd.getName().equalsIgnoreCase("bankeconomy") && (args[0].equalsIgnoreCase("reset")) && (p.hasPermission("bankeconomy.reset"))) { + } else if (cmd.getName().toLowerCase().equalsIgnoreCase("bankeconomy") && (args[0].equalsIgnoreCase("reset")) && (p.hasPermission("bankeconomy.reset"))) { if (args.length == 1) { p.sendMessage(this.prefix + " " + this.usage + " " + this.cmdResetARG1); } else if (args.length == 2) { @@ -1375,11 +1375,11 @@ public String convertToItemName(String val) { if (target == null) { p.sendMessage(this.prefix + " " + this.offlinePlayer); } else { - this.plugin.getAccountsConfig().set(target.getName() + ".money", Integer.valueOf(0)); - this.plugin.saveAccountsConfig(); + this.plugin.getAccountsConfig().set(target.getName().toLowerCase() + ".money", Integer.valueOf(0)); + //this.plugin.saveAccountsConfig(); - p.sendMessage(this.prefix + " " + this.cmdResetToPlayer1 + " " + target.getName() + this.cmdResetToPlayer2); - target.sendMessage(this.prefix + " a" + p.getName() + " " + this.cmdResetToTarget); + p.sendMessage(this.prefix + " " + this.cmdResetToPlayer1 + " " + target.getName().toLowerCase() + this.cmdResetToPlayer2); + target.sendMessage(this.prefix + " a" + p.getName().toLowerCase() + " " + this.cmdResetToTarget); } } else { p.sendMessage(this.invARG); @@ -1394,7 +1394,7 @@ public String convertToItemName(String val) { } p.sendMessage(this.invARG); } - else if (cmd.getName().equalsIgnoreCase("bankeconomy") && (args[0].equalsIgnoreCase("transfer")) && (p.hasPermission("bankeconomy.transfer"))) { + else if (cmd.getName().toLowerCase().equalsIgnoreCase("bankeconomy") && (args[0].equalsIgnoreCase("transfer")) && (p.hasPermission("bankeconomy.transfer"))) { if (args.length == 1) { p.sendMessage(this.prefix + " " + this.usage + " " + this.cmdTransferARG1); } else if (args.length == 2) { @@ -1406,25 +1406,25 @@ public String convertToItemName(String val) { if (target == null) { p.sendMessage(this.prefix + " " + this.offlinePlayer); } - else if (target.getName() == p.getName()) { + else if (target.getName().toLowerCase() == p.getName().toLowerCase()) { p.sendMessage(this.prefix + " " + this.cmdTransferSameNick); } else if (amount > playerBankBalance) { p.sendMessage(this.prefix + " " + this.notEnoughMoney); } else if (amount <= playerBankBalance) { double totalWithdraw = playerBankBalance - amount; - double totalDeposit = amount + this.plugin.getAccountsConfig().getInt(target.getName() + ".money"); + double totalDeposit = amount + this.plugin.getAccountsConfig().getInt(target.getName().toLowerCase() + ".money"); - this.plugin.getAccountsConfig().set(p.getName() + ".money", Double.valueOf(totalWithdraw)); - this.plugin.getAccountsConfig().set(target.getName() + ".money", Double.valueOf(totalDeposit)); - this.plugin.saveAccountsConfig(); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase().toLowerCase() + ".money", Double.valueOf(totalWithdraw)); + this.plugin.getAccountsConfig().set(target.getName().toLowerCase() + ".money", Double.valueOf(totalDeposit)); + //this.plugin.saveAccountsConfig(); if (amount > 1.0D) { - p.sendMessage(this.prefix + " " + this.cmdTransferToPlayer1 + " " + amount + currencyPlural + " " + this.cmdTransferToPlayer2 + " " + target.getName() + "a."); - target.sendMessage(this.prefix + " b" + p.getName() + " " + this.cmdTransferToTarget1 + " " + amount + currencyPlural + "a."); + p.sendMessage(this.prefix + " " + this.cmdTransferToPlayer1 + " " + amount + currencyPlural + " " + this.cmdTransferToPlayer2 + " " + target.getName().toLowerCase() + "a."); + target.sendMessage(this.prefix + " b" + p.getName().toLowerCase() + " " + this.cmdTransferToTarget1 + " " + amount + currencyPlural + "a."); } else if (amount <= 1.0D) { - p.sendMessage(this.prefix + " " + this.cmdTransferToPlayer1 + " " + amount + currencySingular + " " + this.cmdTransferToPlayer2 + " " + target.getName() + "a."); - target.sendMessage(this.prefix + " b" + p.getName() + " " + this.cmdTransferToTarget1 + " " + amount + currencySingular + "a."); + p.sendMessage(this.prefix + " " + this.cmdTransferToPlayer1 + " " + amount + currencySingular + " " + this.cmdTransferToPlayer2 + " " + target.getName().toLowerCase() + "a."); + target.sendMessage(this.prefix + " b" + p.getName().toLowerCase() + " " + this.cmdTransferToTarget1 + " " + amount + currencySingular + "a."); } } } @@ -1432,7 +1432,7 @@ public String convertToItemName(String val) { { p.sendMessage(this.invARG); } - } else if (cmd.getName().equalsIgnoreCase("bankeconomy") && (args[0].equalsIgnoreCase("edit")) && (p.hasPermission("bankeconomy.edit"))) { + } else if (cmd.getName().toLowerCase().equalsIgnoreCase("bankeconomy") && (args[0].equalsIgnoreCase("edit")) && (p.hasPermission("bankeconomy.edit"))) { if (args.length == 1) { p.sendMessage(this.prefix + " " + this.usage + " " + this.cmdEditARG1); p.sendMessage(this.prefix + " " + this.cmdEditAvaibleActions); @@ -1449,24 +1449,24 @@ public String convertToItemName(String val) { } else if (args[1].equalsIgnoreCase("status")) { if (amount == 1.0D) { - this.plugin.getAccountsConfig().set(target.getName() + ".status", Boolean.valueOf(true)); - this.plugin.saveAccountsConfig(); + this.plugin.getAccountsConfig().set(target.getName().toLowerCase() + ".status", Boolean.valueOf(true)); + //this.plugin.saveAccountsConfig(); - p.sendMessage(this.prefix + " " + this.cmdEditEnableToPlayer1 + " " + p.getName() + this.cmdEditEnableToPlayer2); + p.sendMessage(this.prefix + " " + this.cmdEditEnableToPlayer1 + " " + p.getName().toLowerCase() + this.cmdEditEnableToPlayer2); } else if (amount == 0.0D) { - this.plugin.getAccountsConfig().set(target.getName() + ".status", Boolean.valueOf(false)); - this.plugin.saveAccountsConfig(); + this.plugin.getAccountsConfig().set(target.getName().toLowerCase() + ".status", Boolean.valueOf(false)); + //this.plugin.saveAccountsConfig(); - p.sendMessage(this.prefix + " " + this.cmdEditDisabledToPlayer1 + " " + p.getName() + this.cmdEditDisabledToPlayer2); + p.sendMessage(this.prefix + " " + this.cmdEditDisabledToPlayer1 + " " + p.getName().toLowerCase() + this.cmdEditDisabledToPlayer2); } } else if (args[1].equalsIgnoreCase("balance")) { - this.plugin.getAccountsConfig().set(target.getName() + ".money", Double.valueOf(amount)); - this.plugin.saveAccountsConfig(); + this.plugin.getAccountsConfig().set(target.getName().toLowerCase() + ".money", Double.valueOf(amount)); + //this.plugin.saveAccountsConfig(); if (amount > 1.0D) - p.sendMessage(this.prefix + " " + this.cmdEditAmountSetPlayer1 + " b" + amount + currencyPlural + " " + this.cmdEditAmountSetPlayer2 + " " + target.getName() + this.cmdEditAmountSetPlayer3); + p.sendMessage(this.prefix + " " + this.cmdEditAmountSetPlayer1 + " b" + amount + currencyPlural + " " + this.cmdEditAmountSetPlayer2 + " " + target.getName().toLowerCase() + this.cmdEditAmountSetPlayer3); else if (amount <= 1.0D) - p.sendMessage(this.prefix + " " + this.cmdEditAmountSetPlayer1 + " b" + amount + currencySingular + " " + this.cmdEditAmountSetPlayer2 + " " + target.getName() + this.cmdEditAmountSetPlayer3); + p.sendMessage(this.prefix + " " + this.cmdEditAmountSetPlayer1 + " b" + amount + currencySingular + " " + this.cmdEditAmountSetPlayer2 + " " + target.getName().toLowerCase() + this.cmdEditAmountSetPlayer3); } else { p.sendMessage(this.prefix + " " + this.cmdEditAvaibleActions); @@ -1476,14 +1476,14 @@ public String convertToItemName(String val) { p.sendMessage(this.invARG); } } - else if (cmd.getName().equalsIgnoreCase("revive") && args[0].equalsIgnoreCase("me")) { + else if (cmd.getName().toLowerCase().equalsIgnoreCase("revive") && args[0].equalsIgnoreCase("me")) { DecimalFormat df = new DecimalFormat("#0.00"); - double deathX = this.plugin.getAccountsConfig().getDouble(p.getName() + ".deathpointX"); - double deathY = this.plugin.getAccountsConfig().getDouble(p.getName() + ".deathpointY"); - double deathZ = this.plugin.getAccountsConfig().getDouble(p.getName() + ".deathpointZ"); - String deathWorld = this.plugin.getAccountsConfig().getString(p.getName() + ".deathworld"); + double deathX = this.plugin.getAccountsConfig().getDouble(p.getName().toLowerCase().toLowerCase() + ".deathpointX"); + double deathY = this.plugin.getAccountsConfig().getDouble(p.getName().toLowerCase().toLowerCase() + ".deathpointY"); + double deathZ = this.plugin.getAccountsConfig().getDouble(p.getName().toLowerCase().toLowerCase() + ".deathpointZ"); + String deathWorld = this.plugin.getAccountsConfig().getString(p.getName().toLowerCase().toLowerCase() + ".deathworld"); //p.sendMessage("Got 1."); - if (this.plugin.getAccountsConfig().getBoolean(p.getName() + ".revived")==false && this.plugin.SERVER_TICK_TIME-this.plugin.getAccountsConfig().getLong(p.getName() + ".revivetime")<12000) { + if (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase().toLowerCase() + ".revived")==false && this.plugin.SERVER_TICK_TIME-this.plugin.getAccountsConfig().getLong(p.getName().toLowerCase().toLowerCase() + ".revivetime")<12000) { double mincost = this.plugin.getConfig().getDouble("revive-cost-rate"); //p.sendMessage("Got 2."); if (p.getBedSpawnLocation()!=null) { @@ -1491,17 +1491,17 @@ public String convertToItemName(String val) { } else { mincost *= Math.abs(p.getWorld().getSpawnLocation().getX()-deathX)+Math.abs(p.getWorld().getSpawnLocation().getY()-deathY)+Math.abs(p.getWorld().getSpawnLocation().getZ()-deathZ); } - double mymoney = this.plugin.getAccountsConfig().getDouble(p.getName() + ".money"); + double mymoney = this.plugin.getAccountsConfig().getDouble(p.getName().toLowerCase().toLowerCase() + ".money"); double finalcost = (mincost*this.plugin.getConfig().getDouble("revive-cost-rate")) + (mymoney*this.plugin.getConfig().getDouble("revive-cost-tax")); if (this.plugin.PlayerinJob(p, "Explorer") && this.plugin.getJobLv("Explorer", p)>=20) { finalcost*=0.25; } //p.sendMessage("Got 3."); if (mymoney>=finalcost) { - this.plugin.getAccountsConfig().set(p.getName() + ".revived", Boolean.valueOf(true)); - this.plugin.getAccountsConfig().set(p.getName() + ".money", mymoney-finalcost); - this.plugin.getAccountsConfig().set(p.getName() + ".revivetime", Long.valueOf(0)); - this.plugin.saveAccountsConfig(); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase().toLowerCase() + ".revived", Boolean.valueOf(true)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase().toLowerCase() + ".money", mymoney-finalcost); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase().toLowerCase() + ".revivetime", Long.valueOf(0)); + //this.plugin.saveAccountsConfig(); //p.sendMessage("Got 4."); p.sendMessage("You spent $"+df.format(finalcost)+" to revive. New Bank Balance: $"+ChatColor.YELLOW+df.format(mymoney-finalcost)); //p.sendMessage("Got 5."); @@ -1540,17 +1540,17 @@ public String convertToItemName(String val) { p2.setMaximumNoDamageTicks(20); } },100); - Bukkit.broadcastMessage(ChatColor.GREEN+p.getName()+ChatColor.WHITE+" decided to revive."); + Bukkit.broadcastMessage(ChatColor.GREEN+p.getName().toLowerCase()+ChatColor.WHITE+" decided to revive."); } else { p.sendMessage("You cannot revive. You need to have $"+df.format(finalcost)+" to do so."); } } else { p.sendMessage("You haven't died. So you cannot revive."); } - this.plugin.saveAccountsConfig(); + //this.plugin.saveAccountsConfig(); return true; } - else if (cmd.getName().equalsIgnoreCase("revive") && (args[0].equalsIgnoreCase("amount"))) { + else if (cmd.getName().toLowerCase().equalsIgnoreCase("revive") && (args[0].equalsIgnoreCase("amount"))) { DecimalFormat df = new DecimalFormat("#0.00"); double deathX = p.getLocation().getX(); double deathY = p.getLocation().getY(); @@ -1561,7 +1561,7 @@ public String convertToItemName(String val) { } else { mincost *= Math.abs(p.getWorld().getSpawnLocation().getX()-deathX)+Math.abs(p.getWorld().getSpawnLocation().getY()-deathY)+Math.abs(p.getWorld().getSpawnLocation().getZ()-deathZ); } - double mymoney = this.plugin.getAccountsConfig().getDouble(p.getName() + ".money"); + double mymoney = this.plugin.getAccountsConfig().getDouble(p.getName().toLowerCase().toLowerCase() + ".money"); double finalcost = (mincost*this.plugin.getConfig().getDouble("revive-cost-rate")) + (mymoney*this.plugin.getConfig().getDouble("revive-cost-tax")); if (this.plugin.PlayerinJob(p, "Explorer") && this.plugin.getJobLv("Explorer", p)>=20) { finalcost*=0.25; @@ -1569,9 +1569,9 @@ public String convertToItemName(String val) { p.sendMessage("You need to have $"+df.format(finalcost)+" to revive."); return true; } - else if (cmd.getName().equalsIgnoreCase("tele") && (args[0].equalsIgnoreCase("to"))) { + else if (cmd.getName().toLowerCase().equalsIgnoreCase("tele") && (args[0].equalsIgnoreCase("to"))) { DecimalFormat df = new DecimalFormat("#0.00"); - if (p.getPlayerTime()-this.plugin.getAccountsConfig().getDouble(p.getName() + ".teletime")<400) { + if (p.getPlayerTime()-this.plugin.getAccountsConfig().getDouble(p.getName().toLowerCase().toLowerCase() + ".teletime")<400) { if (args.length==1) { p.sendMessage("Usage: "+ChatColor.RED+"/tele to "+ChatColor.GREEN+" "+ChatColor.WHITE+" - Teleport to a player for a cost."); } else if (args.length==2) { @@ -1586,26 +1586,26 @@ public String convertToItemName(String val) { is_in_vehicle=true; vehicle = p.getVehicle(); } - if (target.getName() == this.plugin.getAccountsConfig().getString(p.getName() + ".teleplayer")) { + if (target.getName().toLowerCase() == 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(); double otherz = target.getLocation().getZ(); - double mymoney = this.plugin.getAccountsConfig().getDouble(p.getName() + ".money"); + double mymoney = this.plugin.getAccountsConfig().getDouble(p.getName().toLowerCase().toLowerCase() + ".money"); double finalcost = Math.abs(p.getLocation().getX()-otherx)+Math.abs(p.getLocation().getY()-othery)+Math.abs(p.getLocation().getZ()-otherz); finalcost *= this.plugin.getConfig().getDouble("teleport-cost-rate"); //finalcost += mymoney*this.plugin.getConfig().getDouble("teleport-cost-tax"); if (mymoney>=finalcost) { //Allow teleport to occur. - this.plugin.getAccountsConfig().set(p.getName() + ".money", mymoney-finalcost); - this.plugin.getAccountsConfig().set(p.getName() + ".teletime", Double.valueOf(0.0d)); - this.plugin.saveAccountsConfig(); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase().toLowerCase() + ".money", mymoney-finalcost); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase().toLowerCase() + ".teletime", Double.valueOf(0.0d)); + //this.plugin.saveAccountsConfig(); if (this.plugin.PlayerinJob(p, "Support")) { //Give exp for doing so. //this.plugin.gainMoneyExp(p,"Support",0,100); } - p.sendMessage("Teleported to "+ChatColor.GREEN+target.getName()+ChatColor.WHITE+" for $"+ChatColor.YELLOW+df.format(finalcost)+ChatColor.WHITE+". New Account balance: $"+df.format(mymoney-finalcost)); - target.sendMessage(ChatColor.GREEN+p.getName()+ChatColor.WHITE+" teleported to your location."); + p.sendMessage("Teleported to "+ChatColor.GREEN+target.getName().toLowerCase()+ChatColor.WHITE+" for $"+ChatColor.YELLOW+df.format(finalcost)+ChatColor.WHITE+". New Account balance: $"+df.format(mymoney-finalcost)); + target.sendMessage(ChatColor.GREEN+p.getName().toLowerCase()+ChatColor.WHITE+" teleported to your location."); if (is_in_vehicle) { vehicle.eject(); p.eject(); @@ -1629,7 +1629,7 @@ public String convertToItemName(String val) { } } } else { - p.sendMessage("You need $"+ChatColor.YELLOW+df.format(finalcost)+" in the bank to teleport to "+ChatColor.GREEN+target.getName()+ChatColor.WHITE+"!"); + p.sendMessage("You need $"+ChatColor.YELLOW+df.format(finalcost)+" in the bank to teleport to "+ChatColor.GREEN+target.getName().toLowerCase()+ChatColor.WHITE+"!"); } } else { //Setup another player. @@ -1637,17 +1637,17 @@ public String convertToItemName(String val) { double otherx = target.getLocation().getX(); double othery = target.getLocation().getY(); double otherz = target.getLocation().getZ(); - double mymoney = this.plugin.getAccountsConfig().getDouble(p.getName() + ".money"); + double mymoney = this.plugin.getAccountsConfig().getDouble(p.getName().toLowerCase().toLowerCase() + ".money"); double finalcost = Math.abs(p.getLocation().getX()-otherx)+Math.abs(p.getLocation().getY()-othery)+Math.abs(p.getLocation().getZ()-otherz); finalcost *= this.plugin.getConfig().getDouble("teleport-cost-rate"); //finalcost += mymoney*this.plugin.getConfig().getDouble("teleport-cost-tax"); if (mymoney>=finalcost) { //Allow teleport to occur. - p.sendMessage("Teleporting to "+ChatColor.GREEN+target.getName()+ChatColor.WHITE+" costs $"+ChatColor.YELLOW+df.format(finalcost)+". Type the command again to teleport."); - this.plugin.getAccountsConfig().set(p.getName() + ".teletime", Double.valueOf(p.getPlayerTime())); - this.plugin.getAccountsConfig().set(p.getName() + ".teleplayer", String.valueOf(target.getName())); + p.sendMessage("Teleporting to "+ChatColor.GREEN+target.getName().toLowerCase()+ChatColor.WHITE+" costs $"+ChatColor.YELLOW+df.format(finalcost)+". Type the command again to teleport."); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase().toLowerCase() + ".teletime", Double.valueOf(p.getPlayerTime())); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase().toLowerCase() + ".teleplayer", String.valueOf(target.getName().toLowerCase())); } else { - p.sendMessage("Teleporting to "+ChatColor.GREEN+target.getName()+ChatColor.WHITE+" costs $"+ChatColor.YELLOW+df.format(finalcost)+". You do not have enough in the bank for that."); + p.sendMessage("Teleporting to "+ChatColor.GREEN+target.getName().toLowerCase()+ChatColor.WHITE+" costs $"+ChatColor.YELLOW+df.format(finalcost)+". You do not have enough in the bank for that."); } } } @@ -1666,54 +1666,54 @@ public String convertToItemName(String val) { double otherx = target.getLocation().getX(); double othery = target.getLocation().getY(); double otherz = target.getLocation().getZ(); - double mymoney = this.plugin.getAccountsConfig().getDouble(p.getName() + ".money"); + double mymoney = this.plugin.getAccountsConfig().getDouble(p.getName().toLowerCase().toLowerCase() + ".money"); double finalcost = Math.abs(p.getLocation().getX()-otherx)+Math.abs(p.getLocation().getY()-othery)+Math.abs(p.getLocation().getZ()-otherz); finalcost *= this.plugin.getConfig().getDouble("teleport-cost-rate"); //finalcost += mymoney*this.plugin.getConfig().getDouble("teleport-cost-tax"); if (mymoney>=finalcost) { //Allow teleport to occur. - p.sendMessage("Teleporting to "+ChatColor.GREEN+target.getName()+ChatColor.WHITE+" costs $"+ChatColor.YELLOW+df.format(finalcost)+". Type the command again to teleport."); - this.plugin.getAccountsConfig().set(p.getName() + ".teletime", Double.valueOf(p.getPlayerTime())); - this.plugin.getAccountsConfig().set(p.getName() + ".teleplayer", String.valueOf(target.getName())); + p.sendMessage("Teleporting to "+ChatColor.GREEN+target.getName().toLowerCase()+ChatColor.WHITE+" costs $"+ChatColor.YELLOW+df.format(finalcost)+". Type the command again to teleport."); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase().toLowerCase() + ".teletime", Double.valueOf(p.getPlayerTime())); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase().toLowerCase() + ".teleplayer", String.valueOf(target.getName().toLowerCase())); } else { - p.sendMessage("Teleporting to "+ChatColor.GREEN+target.getName()+ChatColor.WHITE+" costs $"+ChatColor.YELLOW+df.format(finalcost)+". You do not have enough in the bank for that."); + p.sendMessage("Teleporting to "+ChatColor.GREEN+target.getName().toLowerCase()+ChatColor.WHITE+" costs $"+ChatColor.YELLOW+df.format(finalcost)+". You do not have enough in the bank for that."); } } } } return true; } else - if (cmd.getName().equalsIgnoreCase("jobs") && args.length == 1 && args[0].equalsIgnoreCase("info")) { + if (cmd.getName().toLowerCase().equalsIgnoreCase("jobs") && args.length == 1 && args[0].equalsIgnoreCase("info")) { p.sendMessage("Usage: "+ChatColor.GREEN+"/jobs info [JobName]"+ChatColor.WHITE+" - Get information about a job."); p.sendMessage("Usage: "+ChatColor.GREEN+"/jobs info [JobName] "+ChatColor.LIGHT_PURPLE+"[lv]"+ChatColor.WHITE+" - Get information about a job at a certain job level."); p.sendMessage(" Type /jobs to see the jobs."); } else - if (cmd.getName().equalsIgnoreCase("jobs") && args.length == 1 && args[0].equalsIgnoreCase("join")) { + if (cmd.getName().toLowerCase().equalsIgnoreCase("jobs") && args.length == 1 && args[0].equalsIgnoreCase("join")) { p.sendMessage("Usage: "+ChatColor.GREEN+"/jobs join [JobName]"+ChatColor.WHITE+" - Join a job. Type /jobs to see the jobs."); } else - if (cmd.getName().equalsIgnoreCase("jobs") && args.length == 1 && args[0].equalsIgnoreCase("leave")) { + if (cmd.getName().toLowerCase().equalsIgnoreCase("jobs") && args.length == 1 && args[0].equalsIgnoreCase("leave")) { p.sendMessage("Usage: "+ChatColor.GREEN+"/jobs leave [JobName]"+ChatColor.WHITE+" - Leave a job. Type /jobs stats to see your jobs."); } else - if (cmd.getName().equalsIgnoreCase("jobs") && args.length == 1 && args[0].equalsIgnoreCase("buffs")) { + if (cmd.getName().toLowerCase().equalsIgnoreCase("jobs") && args.length == 1 && args[0].equalsIgnoreCase("buffs")) { p.sendMessage("Usage: "+ChatColor.GREEN+"/jobs buffs [JobName]"+ChatColor.WHITE+" - Get buffs information about a job. Type /jobs to see the jobs."); } else - if (cmd.getName().equalsIgnoreCase("jobs") && args.length == 2 && args[0].equalsIgnoreCase("ultimate")) { + if (cmd.getName().toLowerCase().equalsIgnoreCase("jobs") && args.length == 2 && args[0].equalsIgnoreCase("ultimate")) { //Attempt to join the job. this.plugin.setUltimate(p,args[1]); } else - if (cmd.getName().equalsIgnoreCase("jobs") && args.length == 2 && args[0].equalsIgnoreCase("boost")) { + if (cmd.getName().toLowerCase().equalsIgnoreCase("jobs") && args.length == 2 && args[0].equalsIgnoreCase("boost")) { //Attempt to level up the job. this.plugin.levelUpJob(p,args[1]); } else - if (cmd.getName().equalsIgnoreCase("jobs") && args.length == 2 && args[0].equalsIgnoreCase("join")) { + if (cmd.getName().toLowerCase().equalsIgnoreCase("jobs") && args.length == 2 && args[0].equalsIgnoreCase("join")) { //Attempt to join the job. this.plugin.joinJob(p,args[1]); } else - if (cmd.getName().equalsIgnoreCase("jobs") && args.length == 2 && args[0].equalsIgnoreCase("leave")) { + if (cmd.getName().toLowerCase().equalsIgnoreCase("jobs") && args.length == 2 && args[0].equalsIgnoreCase("leave")) { //Attempt to join the job. this.plugin.leaveJob(p,args[1]); } else - if (cmd.getName().equalsIgnoreCase("jobs") && (args.length == 2 || args.length==3) && args[0].equalsIgnoreCase("info")) { + if (cmd.getName().toLowerCase().equalsIgnoreCase("jobs") && (args.length == 2 || args.length==3) && args[0].equalsIgnoreCase("info")) { JobsDataInfo[] Jobsinfo = {this.plugin.Woodcutter_job,this.plugin.Miner_job,this.plugin.Builder_job,this.plugin.Digger_job,this.plugin.Farmer_job,this.plugin.Hunter_job,this.plugin.Fisherman_job,this.plugin.Weaponsmith_job,this.plugin.Blacksmith_job,this.plugin.Cook_job,this.plugin.Brewer_job,this.plugin.Enchanter_job,this.plugin.Breeder_job,this.plugin.Explorer_job,this.plugin.Support_job}; boolean found=false; int matchedjob=0; @@ -1732,7 +1732,7 @@ public String convertToItemName(String val) { } } if (this.plugin.PlayerinJob(p, args[1])) { - Jobsinfo[i].sendOutput(p,this.plugin.getAccountsConfig().getInt(p.getName()+".jobs.job"+(slot+1)+"lv")); + Jobsinfo[i].sendOutput(p,this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".jobs.job"+(slot+1)+"lv")); } else { Jobsinfo[i].sendOutput(p); } @@ -1767,7 +1767,7 @@ public String convertToItemName(String val) { } p.sendMessage(""); } else - if (cmd.getName().equalsIgnoreCase("jobs") && (args.length == 2) && args[0].equalsIgnoreCase("buffs")) { + if (cmd.getName().toLowerCase().equalsIgnoreCase("jobs") && (args.length == 2) && args[0].equalsIgnoreCase("buffs")) { JobsDataInfo[] Jobsinfo = {this.plugin.Woodcutter_job,this.plugin.Miner_job,this.plugin.Builder_job,this.plugin.Digger_job,this.plugin.Farmer_job,this.plugin.Hunter_job,this.plugin.Fisherman_job,this.plugin.Weaponsmith_job,this.plugin.Blacksmith_job,this.plugin.Cook_job,this.plugin.Brewer_job,this.plugin.Enchanter_job,this.plugin.Breeder_job,this.plugin.Explorer_job,this.plugin.Support_job}; boolean found=false; int slot=0; @@ -1797,7 +1797,7 @@ public String convertToItemName(String val) { p.sendMessage(ChatColor.ITALIC+"Note that only one ultimate buff can be chosen. And CANNOT BE CHANGED."); } } else - if (cmd.getName().equalsIgnoreCase("jobs") && (args.length == 1 || args.length==2) && args[0].equalsIgnoreCase("stats")) { + if (cmd.getName().toLowerCase().equalsIgnoreCase("jobs") && (args.length == 1 || args.length==2) && args[0].equalsIgnoreCase("stats")) { if (args.length==1) { //Show your stats. p.sendMessage(""); @@ -1805,12 +1805,12 @@ public String convertToItemName(String val) { String[] joblist=this.plugin.getJobs(p); for (int i=0;i=5?"+Lv5 Buff":"")+ChatColor.GREEN+(mylv>=10?" +Lv10 Buff":"")+ChatColor.GOLD+(mylv>=20?" +Lv20 Buff":"")); + p.sendMessage("Lv"+mylv+" "+this.plugin.getJobColor(joblist[i])+joblist[i]+ChatColor.WHITE+": "+Math.round(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".jobs.job"+(i+1)+"exp"))+"xp "+ChatColor.BLUE+(mylv>=5?"+Lv5 Buff":"")+ChatColor.GREEN+(mylv>=10?" +Lv10 Buff":"")+ChatColor.GOLD+(mylv>=20?" +Lv20 Buff":"")); } else { - p.sendMessage("Lv"+mylv+" "+this.plugin.getJobColor(joblist[i])+joblist[i]+ChatColor.WHITE+": "+Math.round(this.plugin.getAccountsConfig().getInt(p.getName()+".jobs.job"+(i+1)+"exp"))+"/"+Math.round(this.plugin.getJobExp(joblist[i], this.plugin.getAccountsConfig().getInt(p.getName()+".jobs.job"+(i+1)+"lv")))+"xp "+ChatColor.BLUE+(mylv>=5?"+Lv5 Buff":"")+ChatColor.GREEN+(mylv>=10?" +Lv10 Buff":"")+ChatColor.GOLD+(mylv>=20?" +Lv20 Buff":"")); + p.sendMessage("Lv"+mylv+" "+this.plugin.getJobColor(joblist[i])+joblist[i]+ChatColor.WHITE+": "+Math.round(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".jobs.job"+(i+1)+"exp"))+"/"+Math.round(this.plugin.getJobExp(joblist[i], this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".jobs.job"+(i+1)+"lv")))+"xp "+ChatColor.BLUE+(mylv>=5?"+Lv5 Buff":"")+ChatColor.GREEN+(mylv>=10?" +Lv10 Buff":"")+ChatColor.GOLD+(mylv>=20?" +Lv20 Buff":"")); } if (joblist[i].equalsIgnoreCase("Explorer") && this.plugin.getJobLv(joblist[i], p)>=10) { @@ -1818,7 +1818,7 @@ public String convertToItemName(String val) { boolean discovered=false; long timeleft=0; for (int j=0;j=5?"+Lv5 Buff":"")+ChatColor.GREEN+(mylv>=10?" +Lv10 Buff":"")+ChatColor.GOLD+(mylv>=20?" +Lv20 Buff":"")); + p.sendMessage("Lv"+mylv+" "+this.plugin.getJobColor(joblist[i])+joblist[i]+ChatColor.WHITE+": "+Math.round(this.plugin.getAccountsConfig().getInt(Bukkit.getPlayer(args[1]).getName().toLowerCase()+".jobs.job"+(i+1)+"exp"))+"xp "+ChatColor.BLUE+(mylv>=5?"+Lv5 Buff":"")+ChatColor.GREEN+(mylv>=10?" +Lv10 Buff":"")+ChatColor.GOLD+(mylv>=20?" +Lv20 Buff":"")); } else { - p.sendMessage("Lv"+mylv+" "+this.plugin.getJobColor(joblist[i])+joblist[i]+ChatColor.WHITE+": "+Math.round(this.plugin.getAccountsConfig().getInt(Bukkit.getPlayer(args[1]).getName()+".jobs.job"+(i+1)+"exp"))+"/"+Math.round(this.plugin.getJobExp(joblist[i], this.plugin.getAccountsConfig().getInt(Bukkit.getPlayer(args[1]).getName()+".jobs.job"+(i+1)+"lv")))+"xp "+ChatColor.BLUE+(mylv>=5?"+Lv5 Buff":"")+ChatColor.GREEN+(mylv>=10?" +Lv10 Buff":"")+ChatColor.GOLD+(mylv>=20?" +Lv20 Buff":"")); + p.sendMessage("Lv"+mylv+" "+this.plugin.getJobColor(joblist[i])+joblist[i]+ChatColor.WHITE+": "+Math.round(this.plugin.getAccountsConfig().getInt(Bukkit.getPlayer(args[1]).getName().toLowerCase()+".jobs.job"+(i+1)+"exp"))+"/"+Math.round(this.plugin.getJobExp(joblist[i], this.plugin.getAccountsConfig().getInt(Bukkit.getPlayer(args[1]).getName().toLowerCase()+".jobs.job"+(i+1)+"lv")))+"xp "+ChatColor.BLUE+(mylv>=5?"+Lv5 Buff":"")+ChatColor.GREEN+(mylv>=10?" +Lv10 Buff":"")+ChatColor.GOLD+(mylv>=20?" +Lv20 Buff":"")); } if (joblist[i].equalsIgnoreCase("Explorer") && this.plugin.getJobLv(joblist[i], Bukkit.getPlayer(args[1]))>=10) { @@ -1852,7 +1852,7 @@ public String convertToItemName(String val) { boolean discovered=false; long timeleft=0; for (int j=0;j=5?"+Lv5 Buff":"")+ChatColor.GREEN+(mylv>=10?" +Lv10 Buff":"")+ChatColor.GOLD+(mylv>=20?" +Lv20 Buff":"")); + p.sendMessage("Lv"+mylv+" "+this.plugin.getJobColor(joblist[i])+joblist[i]+ChatColor.WHITE+": "+Math.round(this.plugin.getAccountsConfig().getInt(q.getName().toLowerCase()+".jobs.job"+(i+1)+"exp"))+"xp "+ChatColor.BLUE+(mylv>=5?"+Lv5 Buff":"")+ChatColor.GREEN+(mylv>=10?" +Lv10 Buff":"")+ChatColor.GOLD+(mylv>=20?" +Lv20 Buff":"")); } else { - p.sendMessage("Lv"+mylv+" "+this.plugin.getJobColor(joblist[i])+joblist[i]+ChatColor.WHITE+": "+Math.round(this.plugin.getAccountsConfig().getInt(q.getName()+".jobs.job"+(i+1)+"exp"))+"/"+Math.round(this.plugin.getJobExp(joblist[i], this.plugin.getAccountsConfig().getInt(q.getName()+".jobs.job"+(i+1)+"lv")))+"xp "+ChatColor.BLUE+(mylv>=5?"+Lv5 Buff":"")+ChatColor.GREEN+(mylv>=10?" +Lv10 Buff":"")+ChatColor.GOLD+(mylv>=20?" +Lv20 Buff":"")); + p.sendMessage("Lv"+mylv+" "+this.plugin.getJobColor(joblist[i])+joblist[i]+ChatColor.WHITE+": "+Math.round(this.plugin.getAccountsConfig().getInt(q.getName().toLowerCase()+".jobs.job"+(i+1)+"exp"))+"/"+Math.round(this.plugin.getJobExp(joblist[i], this.plugin.getAccountsConfig().getInt(q.getName().toLowerCase()+".jobs.job"+(i+1)+"lv")))+"xp "+ChatColor.BLUE+(mylv>=5?"+Lv5 Buff":"")+ChatColor.GREEN+(mylv>=10?" +Lv10 Buff":"")+ChatColor.GOLD+(mylv>=20?" +Lv20 Buff":"")); } } - if (joblist[i].equalsIgnoreCase("Explorer") && this.plugin.getJobLv(joblist[i], q.getName())>=10) { + if (joblist[i].equalsIgnoreCase("Explorer") && this.plugin.getJobLv(joblist[i], q.getName().toLowerCase())>=10) { //Check to see if the buff is on cooldown for this player or not. boolean discovered=false; long timeleft=0; for (int j=0;j