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.
master_event
sigonasr2 11 years ago
parent 6f05142cc6
commit 70a92aeaac
  1. 4
      BankEconomyMod/bin/sig/ItemSets/.gitignore
  2. 316
      BankEconomyMod/src/me/kaZep/Base/Main.java
  3. 18
      BankEconomyMod/src/me/kaZep/Base/PlayerBuffData.java
  4. 649
      BankEconomyMod/src/me/kaZep/Base/PlayerListener.java
  5. 338
      BankEconomyMod/src/me/kaZep/Commands/commandBankEconomy.java

@ -0,0 +1,4 @@
/ColorSet.class
/ItemSet.class
/ItemSetList$Armor.class
/ItemSetList.class

@ -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<playerlist.length;i++) {
if (getAccountsConfig().contains(playerlist[i].getName())) {
if (getAccountsConfig().contains(playerlist[i].getName()+".spleefrating") && getAccountsConfig().getInt(playerlist[i].getName()+".spleefwins")+getAccountsConfig().getInt(playerlist[i].getName()+".spleeflosses")>=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;i<spleef4_inventory_a.length;i++) {
if (spleef4_inventory_a[i]!=null) {
p.getInventory().addItem(spleef4_inventory_a[i]);
@ -2154,7 +2156,7 @@ public void runTick() {
}
getConfig().set("spleefrequesta4player",String.valueOf("none"));
} else
if (getConfig().getString("spleefrequestb4player").compareTo(p.getName())==0) {
if (getConfig().getString("spleefrequestb4player").compareTo(p.getName().toLowerCase())==0) {
for (int i=0;i<spleef4_inventory_b.length;i++) {
if (spleef4_inventory_b[i]!=null) {
p.getInventory().addItem(spleef4_inventory_b[i]);
@ -2162,7 +2164,7 @@ public void runTick() {
}
getConfig().set("spleefrequestb4player",String.valueOf("none"));
} else
if (getConfig().getString("spleefrequestc4player").compareTo(p.getName())==0) {
if (getConfig().getString("spleefrequestc4player").compareTo(p.getName().toLowerCase())==0) {
for (int i=0;i<spleef4_inventory_c.length;i++) {
if (spleef4_inventory_c[i]!=null) {
p.getInventory().addItem(spleef4_inventory_c[i]);
@ -2170,7 +2172,7 @@ public void runTick() {
}
getConfig().set("spleefrequestc4player",String.valueOf("none"));
} else
if (getConfig().getString("spleefrequestd4player").compareTo(p.getName())==0) {
if (getConfig().getString("spleefrequestd4player").compareTo(p.getName().toLowerCase())==0) {
for (int i=0;i<spleef4_inventory_d.length;i++) {
if (spleef4_inventory_d[i]!=null) {
p.getInventory().addItem(spleef4_inventory_d[i]);
@ -2204,7 +2206,7 @@ public void runTick() {
winningplayer.getInventory().clear();
winningplayer.getInventory().clear(winningplayer.getInventory().getHeldItemSlot());
//Give inventories back.
if (getConfig().getString("spleefrequesta4player").compareTo(winningplayer.getName())==0) {
if (getConfig().getString("spleefrequesta4player").compareTo(winningplayer.getName().toLowerCase())==0) {
for (int i=0;i<spleef4_inventory_a.length;i++) {
if (spleef4_inventory_a[i]!=null) {
winningplayer.getInventory().addItem(spleef4_inventory_a[i]);
@ -2212,7 +2214,7 @@ public void runTick() {
}
getConfig().set("spleefrequesta4player",String.valueOf("none"));
} else
if (getConfig().getString("spleefrequestb4player").compareTo(winningplayer.getName())==0) {
if (getConfig().getString("spleefrequestb4player").compareTo(winningplayer.getName().toLowerCase())==0) {
for (int i=0;i<spleef4_inventory_b.length;i++) {
if (spleef4_inventory_b[i]!=null) {
winningplayer.getInventory().addItem(spleef4_inventory_b[i]);
@ -2220,7 +2222,7 @@ public void runTick() {
}
getConfig().set("spleefrequestb4player",String.valueOf("none"));
} else
if (getConfig().getString("spleefrequestc4player").compareTo(winningplayer.getName())==0) {
if (getConfig().getString("spleefrequestc4player").compareTo(winningplayer.getName().toLowerCase())==0) {
for (int i=0;i<spleef4_inventory_c.length;i++) {
if (spleef4_inventory_c[i]!=null) {
winningplayer.getInventory().addItem(spleef4_inventory_c[i]);
@ -2228,7 +2230,7 @@ public void runTick() {
}
getConfig().set("spleefrequestc4player",String.valueOf("none"));
} else
if (getConfig().getString("spleefrequestd4player").compareTo(winningplayer.getName())==0) {
if (getConfig().getString("spleefrequestd4player").compareTo(winningplayer.getName().toLowerCase())==0) {
for (int i=0;i<spleef4_inventory_d.length;i++) {
if (spleef4_inventory_d[i]!=null) {
winningplayer.getInventory().addItem(spleef4_inventory_d[i]);
@ -2278,7 +2280,7 @@ public void runTick() {
c.getBlockInventory().setItem((int)(Math.random()*27.0d), store_shovel);
}
*/
Bukkit.broadcastMessage(ChatColor.RED+"[SPLEEF] "+ChatColor.YELLOW+winningplayer.getName()+"["+(int)getAccountsConfig().getDouble(winningplayer.getName()+".spleefrating")/10+"] is the winner of this 4-player spleef game!");
Bukkit.broadcastMessage(ChatColor.RED+"[SPLEEF] "+ChatColor.YELLOW+winningplayer.getName().toLowerCase()+"["+(int)getAccountsConfig().getDouble(winningplayer.getName().toLowerCase().toLowerCase()+".spleefrating")/10+"] is the winner of this 4-player spleef game!");
getConfig().set("spleeflastrequesttime",Double.valueOf(0.0d));
getConfig().set("spleefrequesta4player", String.valueOf("none"));
getConfig().set("spleefrequestb4player", String.valueOf("none"));
@ -2311,7 +2313,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;i<spleef4_inventory_a.length;i++) {
if (spleef4_inventory_a[i]!=null) {
p.getInventory().addItem(spleef4_inventory_a[i]);
@ -2319,7 +2321,7 @@ public void runTick() {
}
getConfig().set("spleefrequesta4player",String.valueOf("none"));
} else
if (getConfig().getString("spleefrequestb4player").compareTo(p.getName())==0) {
if (getConfig().getString("spleefrequestb4player").compareTo(p.getName().toLowerCase())==0) {
for (int i=0;i<spleef4_inventory_b.length;i++) {
if (spleef4_inventory_b[i]!=null) {
p.getInventory().addItem(spleef4_inventory_b[i]);
@ -2327,7 +2329,7 @@ public void runTick() {
}
getConfig().set("spleefrequestb4player",String.valueOf("none"));
} else
if (getConfig().getString("spleefrequestc4player").compareTo(p.getName())==0) {
if (getConfig().getString("spleefrequestc4player").compareTo(p.getName().toLowerCase())==0) {
for (int i=0;i<spleef4_inventory_c.length;i++) {
if (spleef4_inventory_c[i]!=null) {
p.getInventory().addItem(spleef4_inventory_c[i]);
@ -2335,7 +2337,7 @@ public void runTick() {
}
getConfig().set("spleefrequestc4player",String.valueOf("none"));
} else
if (getConfig().getString("spleefrequestd4player").compareTo(p.getName())==0) {
if (getConfig().getString("spleefrequestd4player").compareTo(p.getName().toLowerCase())==0) {
for (int i=0;i<spleef4_inventory_d.length;i++) {
if (spleef4_inventory_d[i]!=null) {
p.getInventory().addItem(spleef4_inventory_d[i]);
@ -2348,10 +2350,10 @@ public void runTick() {
}
}
//Check to see if we are a player in spleef.
if (getConfig().getString("spleefrequesta4player").compareTo(p.getName())==0 ||
getConfig().getString("spleefrequestb4player").compareTo(p.getName())==0 ||
getConfig().getString("spleefrequestc4player").compareTo(p.getName())==0 ||
getConfig().getString("spleefrequestd4player").compareTo(p.getName())==0) {
if (getConfig().getString("spleefrequesta4player").compareTo(p.getName().toLowerCase())==0 ||
getConfig().getString("spleefrequestb4player").compareTo(p.getName().toLowerCase())==0 ||
getConfig().getString("spleefrequestc4player").compareTo(p.getName().toLowerCase())==0 ||
getConfig().getString("spleefrequestd4player").compareTo(p.getName().toLowerCase())==0) {
//If they are holding something, remove it.
if (p.getItemInHand()!=null) {
p.getInventory().remove(p.getInventory().getHeldItemSlot());
@ -2359,11 +2361,11 @@ public void runTick() {
}
}
if (getConfig().getBoolean("spleefinsession") && (p.getName().compareTo(getConfig().getString("spleefrequestaplayer"))==0 || p.getName().compareTo(getConfig().getString("spleefrequestbplayer"))==0)) {
if (getConfig().getBoolean("spleefinsession") && (p.getName().toLowerCase().compareTo(getConfig().getString("spleefrequestaplayer"))==0 || p.getName().compareTo(getConfig().getString("spleefrequestbplayer"))==0)) {
//Determine if we're still playing.
int blockwinner=0;
if (getConfig().getString("spleefrequestaplayer").compareTo(p.getName())==0 ||
getConfig().getString("spleefrequestbplayer").compareTo(p.getName())==0) {
if (getConfig().getString("spleefrequestaplayer").compareTo(p.getName().toLowerCase())==0 ||
getConfig().getString("spleefrequestbplayer").compareTo(p.getName().toLowerCase())==0) {
//If they are holding something, remove it.
if (p.getItemInHand()!=null) {
p.getInventory().remove(p.getInventory().getHeldItemSlot());
@ -2398,48 +2400,48 @@ public void runTick() {
getConfig().set("spleefinsession", Boolean.valueOf(false));
//Find out if we're player A, or player B.
Player winningplayer,losingplayer;
if (p.getName().compareTo(getConfig().getString("spleefrequestaplayer"))==0 || blockwinner==2) {
if (p.getName().toLowerCase().compareTo(getConfig().getString("spleefrequestaplayer"))==0 || blockwinner==2) {
//We're player A.
//Bukkit.broadcastMessage(ChatColor.RED+"[SPLEEF] "+ChatColor.YELLOW+getConfig().getString("spleefrequestbplayer")+" is the winner of this spleef game! "+getConfig().getString("spleefrequestaplayer")+" loses.");
losingplayer=p;
winningplayer=Bukkit.getPlayer(getConfig().getString("spleefrequestbplayer"));
double val1,val2,value,newval1,newval2;
if (getAccountsConfig().contains(winningplayer.getName()+".spleefrating")) {
val1 = getAccountsConfig().getDouble(winningplayer.getName()+".spleefrating");
if (getAccountsConfig().contains(winningplayer.getName().toLowerCase()+".spleefrating")) {
val1 = getAccountsConfig().getDouble(winningplayer.getName().toLowerCase()+".spleefrating");
} else {
val1 = 1000.0d;
}
if (getAccountsConfig().contains(losingplayer.getName()+".spleefrating")) {
val2 = getAccountsConfig().getDouble(losingplayer.getName()+".spleefrating");
if (getAccountsConfig().contains(losingplayer.getName().toLowerCase()+".spleefrating")) {
val2 = getAccountsConfig().getDouble(losingplayer.getName().toLowerCase()+".spleefrating");
} else {
val2 = 1000.0d;
}
value = 1.0d/(1.0d+Math.pow(10.0d, ((val2-val1)/400.0d)));
if (getAccountsConfig().contains(winningplayer.getName()+".spleefwins")) {
getAccountsConfig().set(winningplayer.getName()+".spleefwins", Integer.valueOf(getAccountsConfig().getInt(winningplayer.getName()+".spleefwins")+1));
if (getAccountsConfig().contains(winningplayer.getName().toLowerCase()+".spleefwins")) {
getAccountsConfig().set(winningplayer.getName().toLowerCase()+".spleefwins", Integer.valueOf(getAccountsConfig().getInt(winningplayer.getName().toLowerCase()+".spleefwins")+1));
} else {
getAccountsConfig().set(winningplayer.getName()+".spleefwins", Integer.valueOf(1));
getAccountsConfig().set(winningplayer.getName().toLowerCase()+".spleefwins", Integer.valueOf(1));
}
if (getAccountsConfig().contains(winningplayer.getName()+".spleeflosses")) {
getAccountsConfig().set(winningplayer.getName()+".spleeflosses", Integer.valueOf(getAccountsConfig().getInt(winningplayer.getName()+".spleeflosses")));
if (getAccountsConfig().contains(winningplayer.getName().toLowerCase()+".spleeflosses")) {
getAccountsConfig().set(winningplayer.getName().toLowerCase()+".spleeflosses", Integer.valueOf(getAccountsConfig().getInt(winningplayer.getName().toLowerCase()+".spleeflosses")));
} else {
getAccountsConfig().set(winningplayer.getName()+".spleeflosses", Integer.valueOf(0));
getAccountsConfig().set(winningplayer.getName().toLowerCase()+".spleeflosses", Integer.valueOf(0));
}
if (getAccountsConfig().contains(losingplayer.getName()+".spleefwins")) {
getAccountsConfig().set(losingplayer.getName()+".spleefwins", Integer.valueOf(getAccountsConfig().getInt(losingplayer.getName()+".spleefwins")));
if (getAccountsConfig().contains(losingplayer.getName().toLowerCase()+".spleefwins")) {
getAccountsConfig().set(losingplayer.getName().toLowerCase()+".spleefwins", Integer.valueOf(getAccountsConfig().getInt(losingplayer.getName().toLowerCase()+".spleefwins")));
} else {
getAccountsConfig().set(losingplayer.getName()+".spleefwins", Integer.valueOf(0));
getAccountsConfig().set(losingplayer.getName().toLowerCase()+".spleefwins", Integer.valueOf(0));
}
if (getAccountsConfig().contains(losingplayer.getName()+".spleeflosses")) {
getAccountsConfig().set(losingplayer.getName()+".spleeflosses", Integer.valueOf(getAccountsConfig().getInt(losingplayer.getName()+".spleeflosses")+1));
if (getAccountsConfig().contains(losingplayer.getName().toLowerCase()+".spleeflosses")) {
getAccountsConfig().set(losingplayer.getName().toLowerCase()+".spleeflosses", Integer.valueOf(getAccountsConfig().getInt(losingplayer.getName().toLowerCase()+".spleeflosses")+1));
} else {
getAccountsConfig().set(losingplayer.getName()+".spleeflosses", Integer.valueOf(1));
getAccountsConfig().set(losingplayer.getName().toLowerCase()+".spleeflosses", Integer.valueOf(1));
}
newval1 = (val1+Math.round(((50.0d/((getAccountsConfig().getDouble(winningplayer.getName()+".spleefwins")+getAccountsConfig().getDouble(winningplayer.getName()+".spleeflosses"))/20.0d))*(1.0d-value))));
newval2 = (val2+Math.round(((50.0d/((getAccountsConfig().getDouble(losingplayer.getName()+".spleefwins")+getAccountsConfig().getDouble(losingplayer.getName()+".spleeflosses"))/20.0d))*(0.0d-value))));
getAccountsConfig().set(winningplayer.getName()+".spleefrating",Double.valueOf(newval1));
getAccountsConfig().set(losingplayer.getName()+".spleefrating",Double.valueOf(newval2));
newval1 = (val1+Math.round(((50.0d/((getAccountsConfig().getDouble(winningplayer.getName().toLowerCase()+".spleefwins")+getAccountsConfig().getDouble(winningplayer.getName().toLowerCase()+".spleeflosses"))/20.0d))*(1.0d-value))));
newval2 = (val2+Math.round(((50.0d/((getAccountsConfig().getDouble(losingplayer.getName().toLowerCase()+".spleefwins")+getAccountsConfig().getDouble(losingplayer.getName().toLowerCase()+".spleeflosses"))/20.0d))*(0.0d-value))));
getAccountsConfig().set(winningplayer.getName().toLowerCase()+".spleefrating",Double.valueOf(newval1));
getAccountsConfig().set(losingplayer.getName().toLowerCase()+".spleefrating",Double.valueOf(newval2));
Location newloc = winningplayer.getLocation();
Bukkit.broadcastMessage(ChatColor.RED+"[SPLEEF] "+ChatColor.YELLOW+getConfig().getString("spleefrequestbplayer")+"["+(int)newval1/10+"] is the winner of this spleef game! "+getConfig().getString("spleefrequestaplayer")+"["+(int)newval2/10+"] loses.");
@ -2448,48 +2450,48 @@ public void runTick() {
newloc.setZ(51.65d);
winningplayer.teleport(newloc);
updateTopSPLEEFSigns();
saveAccountsConfig();
//saveAccountsConfig();
} else {
//We're player B.
//Bukkit.broadcastMessage(ChatColor.RED+"[SPLEEF] "+ChatColor.YELLOW+getConfig().getString("spleefrequestaplayer")+" is the winner of this spleef game! "+getConfig().getString("spleefrequestbplayer")+" loses.");
losingplayer=p;
winningplayer=Bukkit.getPlayer(getConfig().getString("spleefrequestaplayer"));
double val1,val2,value,newval1,newval2;
if (getAccountsConfig().contains(winningplayer.getName()+".spleefrating")) {
val1 = getAccountsConfig().getDouble(winningplayer.getName()+".spleefrating");
if (getAccountsConfig().contains(winningplayer.getName().toLowerCase()+".spleefrating")) {
val1 = getAccountsConfig().getDouble(winningplayer.getName().toLowerCase()+".spleefrating");
} else {
val1 = 1000.0d;
}
if (getAccountsConfig().contains(losingplayer.getName()+".spleefrating")) {
val2 = getAccountsConfig().getDouble(losingplayer.getName()+".spleefrating");
if (getAccountsConfig().contains(losingplayer.getName().toLowerCase()+".spleefrating")) {
val2 = getAccountsConfig().getDouble(losingplayer.getName().toLowerCase()+".spleefrating");
} else {
val2 = 1000.0d;
}
value = 1.0d/(1.0d+Math.pow(10.0d, ((val2-val1)/400.0d)));
if (getAccountsConfig().contains(winningplayer.getName()+".spleefwins")) {
getAccountsConfig().set(winningplayer.getName()+".spleefwins", Integer.valueOf(getAccountsConfig().getInt(winningplayer.getName()+".spleefwins")+1));
if (getAccountsConfig().contains(winningplayer.getName().toLowerCase()+".spleefwins")) {
getAccountsConfig().set(winningplayer.getName().toLowerCase()+".spleefwins", Integer.valueOf(getAccountsConfig().getInt(winningplayer.getName().toLowerCase()+".spleefwins")+1));
} else {
getAccountsConfig().set(winningplayer.getName()+".spleefwins", Integer.valueOf(1));
getAccountsConfig().set(winningplayer.getName().toLowerCase()+".spleefwins", Integer.valueOf(1));
}
if (getAccountsConfig().contains(winningplayer.getName()+".spleeflosses")) {
getAccountsConfig().set(winningplayer.getName()+".spleeflosses", Integer.valueOf(getAccountsConfig().getInt(winningplayer.getName()+".spleeflosses")));
if (getAccountsConfig().contains(winningplayer.getName().toLowerCase()+".spleeflosses")) {
getAccountsConfig().set(winningplayer.getName().toLowerCase()+".spleeflosses", Integer.valueOf(getAccountsConfig().getInt(winningplayer.getName().toLowerCase()+".spleeflosses")));
} else {
getAccountsConfig().set(winningplayer.getName()+".spleeflosses", Integer.valueOf(0));
getAccountsConfig().set(winningplayer.getName().toLowerCase()+".spleeflosses", Integer.valueOf(0));
}
if (getAccountsConfig().contains(losingplayer.getName()+".spleefwins")) {
getAccountsConfig().set(losingplayer.getName()+".spleefwins", Integer.valueOf(getAccountsConfig().getInt(losingplayer.getName()+".spleefwins")));
if (getAccountsConfig().contains(losingplayer.getName().toLowerCase()+".spleefwins")) {
getAccountsConfig().set(losingplayer.getName().toLowerCase()+".spleefwins", Integer.valueOf(getAccountsConfig().getInt(losingplayer.getName().toLowerCase()+".spleefwins")));
} else {
getAccountsConfig().set(losingplayer.getName()+".spleefwins", Integer.valueOf(0));
getAccountsConfig().set(losingplayer.getName().toLowerCase()+".spleefwins", Integer.valueOf(0));
}
if (getAccountsConfig().contains(losingplayer.getName()+".spleeflosses")) {
getAccountsConfig().set(losingplayer.getName()+".spleeflosses", Integer.valueOf(getAccountsConfig().getInt(losingplayer.getName()+".spleeflosses")+1));
if (getAccountsConfig().contains(losingplayer.getName().toLowerCase()+".spleeflosses")) {
getAccountsConfig().set(losingplayer.getName().toLowerCase()+".spleeflosses", Integer.valueOf(getAccountsConfig().getInt(losingplayer.getName().toLowerCase()+".spleeflosses")+1));
} else {
getAccountsConfig().set(losingplayer.getName()+".spleeflosses", Integer.valueOf(1));
getAccountsConfig().set(losingplayer.getName().toLowerCase()+".spleeflosses", Integer.valueOf(1));
}
newval1 = ((val1+Math.round((50.0d/((getAccountsConfig().getDouble(winningplayer.getName()+".spleefwins")+getAccountsConfig().getDouble(winningplayer.getName()+".spleeflosses"))/20.0d))*(1.0d-value))));
newval2 = ((val2+Math.round((50.0d/((getAccountsConfig().getDouble(losingplayer.getName()+".spleefwins")+getAccountsConfig().getDouble(losingplayer.getName()+".spleeflosses"))/20.0d))*(0.0d-value))));
getAccountsConfig().set(winningplayer.getName()+".spleefrating",Double.valueOf(newval1));
getAccountsConfig().set(losingplayer.getName()+".spleefrating",Double.valueOf(newval2));
newval1 = ((val1+Math.round((50.0d/((getAccountsConfig().getDouble(winningplayer.getName().toLowerCase()+".spleefwins")+getAccountsConfig().getDouble(winningplayer.getName().toLowerCase()+".spleeflosses"))/20.0d))*(1.0d-value))));
newval2 = ((val2+Math.round((50.0d/((getAccountsConfig().getDouble(losingplayer.getName().toLowerCase()+".spleefwins")+getAccountsConfig().getDouble(losingplayer.getName().toLowerCase()+".spleeflosses"))/20.0d))*(0.0d-value))));
getAccountsConfig().set(winningplayer.getName().toLowerCase()+".spleefrating",Double.valueOf(newval1));
getAccountsConfig().set(losingplayer.getName().toLowerCase()+".spleefrating",Double.valueOf(newval2));
Location newloc = winningplayer.getLocation();
Bukkit.broadcastMessage(ChatColor.RED+"[SPLEEF] "+ChatColor.YELLOW+getConfig().getString("spleefrequestaplayer")+"["+(int)newval1/10+"] is the winner of this spleef game! "+getConfig().getString("spleefrequestbplayer")+"["+(int)newval2/10+"] loses.");
@ -2498,7 +2500,7 @@ public void runTick() {
newloc.setZ(51.65d);
winningplayer.teleport(newloc);
updateTopSPLEEFSigns();
saveAccountsConfig();
//saveAccountsConfig();
}
//Look for the special shovel.
/*
@ -2553,7 +2555,7 @@ public void runTick() {
//Bukkit.getPlayer(getConfig().getString("spleefrequestbplayer")).updateInventory();
}
} else {
if (getConfig().getBoolean("spleefinsession") && (p.getName().compareTo(getConfig().getString("spleefrequestaplayer"))!=0 && p.getName().compareTo(getConfig().getString("spleefrequestbplayer"))!=0)) {
if (getConfig().getBoolean("spleefinsession") && (p.getName().toLowerCase().compareTo(getConfig().getString("spleefrequestaplayer"))!=0 && p.getName().compareTo(getConfig().getString("spleefrequestbplayer"))!=0)) {
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) {
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<UUID> expired_uuids = new ArrayList<UUID>();
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;i<SPEED_CONTROL.size();i++) {
if (SPEED_CONTROL.get(i).p.getName().equalsIgnoreCase(p.getName())) {
if (SPEED_CONTROL.get(i).p.getName().equalsIgnoreCase(p.getName().toLowerCase())) {
SPEED_CONTROL.get(i).money_gained+=amount;
break;
}
@ -3714,18 +3716,18 @@ public void payDay(int time)
}
}
JobsDataInfo info = Jobsinfo[getJobSlot(job)];
economy.depositPlayer(p.getName(), amount*(1d+(info.moneymult*getAccountsConfig().getInt(p.getName()+".jobs.job"+(slot+1)+"lv"))));
getAccountsConfig().set(p.getName()+".jobs.job"+(slot+1)+"exp", Double.valueOf(getAccountsConfig().getDouble(p.getName()+".jobs.job"+(slot+1)+"exp")+exp));
if (getAccountsConfig().getDouble(p.getName()+".jobs.job"+(slot+1)+"exp")<0) {
economy.depositPlayer(p.getName().toLowerCase(), amount*(1d+(info.moneymult*getAccountsConfig().getInt(p.getName().toLowerCase()+".jobs.job"+(slot+1)+"lv"))));
getAccountsConfig().set(p.getName().toLowerCase()+".jobs.job"+(slot+1)+"exp", Double.valueOf(getAccountsConfig().getDouble(p.getName().toLowerCase()+".jobs.job"+(slot+1)+"exp")+exp));
if (getAccountsConfig().getDouble(p.getName().toLowerCase()+".jobs.job"+(slot+1)+"exp")<0) {
//It can't be negative.
getAccountsConfig().set(p.getName()+".jobs.job"+(slot+1)+"exp", Double.valueOf(0.0));
getAccountsConfig().set(p.getName().toLowerCase()+".jobs.job"+(slot+1)+"exp", Double.valueOf(0.0));
}
//Check for lv up.
if (getJobLv(job,p)<40 && getJobExp(job,getAccountsConfig().getInt(p.getName()+".jobs.job"+(slot+1)+"lv"))<=getAccountsConfig().getDouble(p.getName()+".jobs.job"+(slot+1)+"exp")) {
if (getJobLv(job,p)<40 && getJobExp(job,getAccountsConfig().getInt(p.getName().toLowerCase()+".jobs.job"+(slot+1)+"lv"))<=getAccountsConfig().getDouble(p.getName().toLowerCase()+".jobs.job"+(slot+1)+"exp")) {
//Level up! Level up! YEAH!
getAccountsConfig().set(p.getName()+".jobs.job"+(slot+1)+"exp", Double.valueOf(getAccountsConfig().getDouble(p.getName()+".jobs.job"+(slot+1)+"exp")-getJobExp(job,getAccountsConfig().getInt(p.getName()+".jobs.job"+(slot+1)+"lv"))));
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)+"exp", Double.valueOf(getAccountsConfig().getDouble(p.getName().toLowerCase()+".jobs.job"+(slot+1)+"exp")-getJobExp(job,getAccountsConfig().getInt(p.getName().toLowerCase()+".jobs.job"+(slot+1)+"lv"))));
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) {
@ -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;i<SPEED_CONTROL.size();i++) {
if (SPEED_CONTROL.get(i).p.getName().equalsIgnoreCase(p.getName())) {
if (SPEED_CONTROL.get(i).p.getName().equalsIgnoreCase(p.getName().toLowerCase())) {
SPEED_CONTROL.get(i).money_gained+=amount;
break;
}
@ -3802,7 +3804,7 @@ public void payDay(int time)
}
}
JobsDataInfo info = Jobsinfo[getJobSlot(job)];
economy.depositPlayer(p.getName(), amount*(1d+(info.moneymult*getAccountsConfig().getInt(p.getName()+".jobs.job"+slot+"lv"))));
economy.depositPlayer(p.getName().toLowerCase(), amount*(1d+(info.moneymult*getAccountsConfig().getInt(p.getName().toLowerCase()+".jobs.job"+slot+"lv"))));
}
public ChatColor getJobColor(String job) {
@ -3848,13 +3850,13 @@ public void payDay(int time)
int slot=-1;
//Check which slot contains our job.
for (int i=0;i<3;i++) {
if (getAccountsConfig().getString(p.getName()+".jobs.job"+(i+1)).equalsIgnoreCase(job)) {
if (getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job"+(i+1)).equalsIgnoreCase(job)) {
slot=i;
break;
}
}
if (slot!=-1) {
return getAccountsConfig().getDouble(p.getName()+".jobs.job"+(slot+1)+"exp");
return getAccountsConfig().getDouble(p.getName().toLowerCase()+".jobs.job"+(slot+1)+"exp");
} else {
return 0;
}
@ -4111,7 +4113,7 @@ public void payDay(int time)
public int getPlayerDataSlot(Player p) {
//Find my data.
for (int i=0;i<playerdata_list.size();i++) {
if (playerdata_list.get(i).data.getName().compareToIgnoreCase(p.getName())==0) {
if (playerdata_list.get(i).data.getName().compareToIgnoreCase(p.getName().toLowerCase())==0) {
return i;
}
}
@ -4123,13 +4125,13 @@ public void payDay(int time)
int slot=-1;
//Check which slot contains our job.
for (int i=0;i<3;i++) {
if (getAccountsConfig().getString(p.getName()+".jobs.job"+(i+1)).equalsIgnoreCase(job)) {
if (getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job"+(i+1)).equalsIgnoreCase(job)) {
slot=i;
break;
}
}
if (slot!=-1) {
return getAccountsConfig().getInt(p.getName()+".jobs.job"+(slot+1)+"lv");
return getAccountsConfig().getInt(p.getName().toLowerCase()+".jobs.job"+(slot+1)+"lv");
} else {
return 0;
}
@ -4141,7 +4143,7 @@ public void payDay(int time)
int totallv=0;
//Check which slot contains our job.
for (int i=0;i<3;i++) {
totallv+=getAccountsConfig().getInt(p.getName()+".jobs.job"+(i+1)+"lv");
totallv+=getAccountsConfig().getInt(p.getName().toLowerCase()+".jobs.job"+(i+1)+"lv");
}
return totallv;
}
@ -4149,7 +4151,7 @@ public void payDay(int time)
public int getStatPointTotal(Player p) {
int total=0;
for (int i=0;i<10;i++) {
total+=getAccountsConfig().getInt(p.getName()+".stats.stat"+(i+1));
total+=getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat"+(i+1));
}
return total;
}
@ -4532,40 +4534,40 @@ public void payDay(int time)
//Get their jobs.
String[] jobs = getJobs(p);
//We can remove them from this job.
if (job.equalsIgnoreCase(getAccountsConfig().getString(p.getName()+".jobs.job1"))) {
if (job.equalsIgnoreCase(getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job1"))) {
//Remove 1 from main config.
getConfig().set("jobs."+getAccountsConfig().getString(p.getName()+".jobs.job1"), Integer.valueOf(getConfig().getInt("jobs."+getAccountsConfig().getString(p.getName()+".jobs.job1"))-1));
getConfig().set("jobs."+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job1"), Integer.valueOf(getConfig().getInt("jobs."+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job1"))-1));
saveConfig();
//Remove from job 1.
Bukkit.broadcastMessage(p.getName()+" has left the "+getJobColor(getAccountsConfig().getString(p.getName()+".jobs.job1"))+getAccountsConfig().getString(p.getName()+".jobs.job1")+ChatColor.WHITE+" job!");
getAccountsConfig().set(p.getName()+".jobs.job1", String.valueOf("None"));
getAccountsConfig().set(p.getName()+".jobs.job1lv", Integer.valueOf(0));
getAccountsConfig().set(p.getName()+".jobs.job1exp", Double.valueOf(0));
saveAccountsConfig();
Bukkit.broadcastMessage(p.getName().toLowerCase()+" has left the "+getJobColor(getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job1"))+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job1")+ChatColor.WHITE+" job!");
getAccountsConfig().set(p.getName().toLowerCase()+".jobs.job1", String.valueOf("None"));
getAccountsConfig().set(p.getName().toLowerCase()+".jobs.job1lv", Integer.valueOf(0));
getAccountsConfig().set(p.getName().toLowerCase()+".jobs.job1exp", Double.valueOf(0));
//saveAccountsConfig();
return true;
} else
if (job.equalsIgnoreCase(getAccountsConfig().getString(p.getName()+".jobs.job2"))) {
if (job.equalsIgnoreCase(getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job2"))) {
//Remove 1 from main config.
getConfig().set("jobs."+getAccountsConfig().getString(p.getName()+".jobs.job2"), Integer.valueOf(getConfig().getInt("jobs."+getAccountsConfig().getString(p.getName()+".jobs.job2"))-1));
getConfig().set("jobs."+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job2"), Integer.valueOf(getConfig().getInt("jobs."+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job2"))-1));
saveConfig();
//Remove from job 2.
Bukkit.broadcastMessage(p.getName()+" has left the "+getJobColor(getAccountsConfig().getString(p.getName()+".jobs.job2"))+getAccountsConfig().getString(p.getName()+".jobs.job2")+ChatColor.WHITE+" job!");
getAccountsConfig().set(p.getName()+".jobs.job2", String.valueOf("None"));
getAccountsConfig().set(p.getName()+".jobs.job2lv", Integer.valueOf(0));
getAccountsConfig().set(p.getName()+".jobs.job2exp", Double.valueOf(0));
saveAccountsConfig();
Bukkit.broadcastMessage(p.getName().toLowerCase()+" has left the "+getJobColor(getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job2"))+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job2")+ChatColor.WHITE+" job!");
getAccountsConfig().set(p.getName().toLowerCase()+".jobs.job2", String.valueOf("None"));
getAccountsConfig().set(p.getName().toLowerCase()+".jobs.job2lv", Integer.valueOf(0));
getAccountsConfig().set(p.getName().toLowerCase()+".jobs.job2exp", Double.valueOf(0));
//saveAccountsConfig();
return true;
} else
if (job.equalsIgnoreCase(getAccountsConfig().getString(p.getName()+".jobs.job3"))) {
if (job.equalsIgnoreCase(getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job3"))) {
//Remove 1 from main config.
getConfig().set("jobs."+getAccountsConfig().getString(p.getName()+".jobs.job3"), Integer.valueOf(getConfig().getInt("jobs."+getAccountsConfig().getString(p.getName()+".jobs.job3"))-1));
getConfig().set("jobs."+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job3"), Integer.valueOf(getConfig().getInt("jobs."+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job3"))-1));
saveConfig();
//Remove from job 3.
Bukkit.broadcastMessage(p.getName()+" has left the "+getJobColor(getAccountsConfig().getString(p.getName()+".jobs.job3"))+getAccountsConfig().getString(p.getName()+".jobs.job3")+ChatColor.WHITE+" job!");
getAccountsConfig().set(p.getName()+".jobs.job3", String.valueOf("None"));
getAccountsConfig().set(p.getName()+".jobs.job3lv", Integer.valueOf(0));
getAccountsConfig().set(p.getName()+".jobs.job3exp", Double.valueOf(0));
saveAccountsConfig();
Bukkit.broadcastMessage(p.getName().toLowerCase()+" has left the "+getJobColor(getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job3"))+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job3")+ChatColor.WHITE+" job!");
getAccountsConfig().set(p.getName().toLowerCase()+".jobs.job3", String.valueOf("None"));
getAccountsConfig().set(p.getName().toLowerCase()+".jobs.job3lv", Integer.valueOf(0));
getAccountsConfig().set(p.getName().toLowerCase()+".jobs.job3exp", Double.valueOf(0));
//saveAccountsConfig();
return true;
}
Bukkit.broadcastMessage(ChatColor.RED+"[SEVERE]An internal error occurred, triggered by "+p.getName()+".");

@ -146,8 +146,8 @@ public class PlayerBuffData {
if (!p.isDead()) { //Don't even try to set things if we're dead.
base_hplv=20;
base_hplv+=hpbufflist.size()*10;
if (this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat8")>0) {
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;i<p.getEquipment().getArmorContents().length;i++) {
@ -184,14 +184,14 @@ public class PlayerBuffData {
} catch (ConcurrentModificationException ex_e) {
Bukkit.getLogger().warning("Potion Effect Collection not accessible while finalizing player speed.");
}
if (!hasabsorption && this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat4")>0) {
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<Main.SERVER_TICK_TIME) {
last_money_report_time=Main.SERVER_TICK_TIME;
if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify6")) {
if (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify6")) {
DecimalFormat df = new DecimalFormat("#0.00");
p.sendMessage(ChatColor.YELLOW+""+ChatColor.ITALIC+"You have earned $"+df.format(money_gained)+" from your jobs in the past hour.");
}
money_gained=0;
}
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()));
}
}
}

File diff suppressed because it is too large Load Diff

@ -338,8 +338,8 @@ public String convertToItemName(String val) {
if ((sender instanceof Player)) {
Player p = (Player)sender;
boolean status = this.plugin.getAccountsConfig().getBoolean(p.getName() + ".status");
int playerBankBalance = this.plugin.getAccountsConfig().getInt(p.getName() + ".money");
boolean status = this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase().toLowerCase() + ".status");
int playerBankBalance = this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase() + ".money");
String currencySingular = Main.economy.currencyNameSingular();
String currencyPlural = Main.economy.currencyNamePlural();
@ -348,30 +348,30 @@ public String convertToItemName(String val) {
p.sendMessage(this.prefix + " " + this.accountDisabled);
else if (status) {
if ((args.length == 0)) {
if (cmd.getName().equalsIgnoreCase("sp")) {
if (cmd.getName().toLowerCase().equalsIgnoreCase("sp")) {
//Show a list of all stat points and what you have currently allocated.
p.sendMessage("");
p.sendMessage("Stat Listing shown as: "+ChatColor.AQUA+"Cost, "+ChatColor.YELLOW+"Current Buff, "+ChatColor.RED+"Next Level, "+ChatColor.GREEN+" Description");
p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"#10 "+ChatColor.RESET+ChatColor.WHITE+"+"+this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat1")/6+" - "+ChatColor.AQUA+" 6 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat1")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat1")>0/*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)<this.plugin.getJobTotalLvs(p)/5+1) {
//Check if we have extra stat points.
p.sendMessage(ChatColor.GOLD+"Type "+ChatColor.BLUE+ChatColor.BOLD+"/sp #"+ChatColor.RESET+ChatColor.GOLD+" with the number of the buff you want to add a point to. (You have "+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+".)");
}
} else
if (cmd.getName().equalsIgnoreCase("tele")) {
if (cmd.getName().toLowerCase().equalsIgnoreCase("tele")) {
p.sendMessage("Usage: "+ChatColor.RED+"/tele to "+ChatColor.GREEN+" <player>"+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<String> temp_meta_lore = new ArrayList<String>();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<String>();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<String>();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<String>();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<String>();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<String>();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 <eventname>");
}
} 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<Enchantment,Integer> map = p.getItemInHand().getEnchantments();
for (Map.Entry<Enchantment,Integer> 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() + "<EFBFBD>˜a.");
target.sendMessage(this.prefix + " <EFBFBD>˜b" + p.getName() + " " + this.cmdTransferToTarget1 + " " + amount + currencyPlural + "<EFBFBD>˜a.");
p.sendMessage(this.prefix + " " + this.cmdTransferToPlayer1 + " " + amount + currencyPlural + " " + this.cmdTransferToPlayer2 + " " + target.getName().toLowerCase() + "<EFBFBD>˜a.");
target.sendMessage(this.prefix + " <EFBFBD>˜b" + p.getName().toLowerCase() + " " + this.cmdTransferToTarget1 + " " + amount + currencyPlural + "<EFBFBD>˜a.");
} else if (amount <= 1.0D) {
p.sendMessage(this.prefix + " " + this.cmdTransferToPlayer1 + " " + amount + currencySingular + " " + this.cmdTransferToPlayer2 + " " + target.getName() + "<EFBFBD>˜a.");
target.sendMessage(this.prefix + " <EFBFBD>˜b" + p.getName() + " " + this.cmdTransferToTarget1 + " " + amount + currencySingular + "<EFBFBD>˜a.");
p.sendMessage(this.prefix + " " + this.cmdTransferToPlayer1 + " " + amount + currencySingular + " " + this.cmdTransferToPlayer2 + " " + target.getName().toLowerCase() + "<EFBFBD>˜a.");
target.sendMessage(this.prefix + " <EFBFBD>˜b" + p.getName().toLowerCase() + " " + this.cmdTransferToTarget1 + " " + amount + currencySingular + "<EFBFBD>˜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 + "<EFBFBD>˜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 + "<EFBFBD>˜a " + target.getName() + this.cmdCheckReponsePlayer + " " + targetBalance + currencySingular);
p.sendMessage(this.prefix + "<EFBFBD>˜a " + target.getName().toLowerCase() + this.cmdCheckReponsePlayer + " " + targetBalance + currencySingular);
else if (targetBalance > 1)
p.sendMessage(this.prefix + "<EFBFBD>˜a " + target.getName() + this.cmdCheckReponsePlayer + " " + targetBalance + currencyPlural);
p.sendMessage(this.prefix + "<EFBFBD>˜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 + " <EFBFBD>˜a" + p.getName() + " " + this.cmdResetToTarget);
p.sendMessage(this.prefix + " " + this.cmdResetToPlayer1 + " " + target.getName().toLowerCase() + this.cmdResetToPlayer2);
target.sendMessage(this.prefix + " <EFBFBD>˜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() + "<EFBFBD>˜a.");
target.sendMessage(this.prefix + " <EFBFBD>˜b" + p.getName() + " " + this.cmdTransferToTarget1 + " " + amount + currencyPlural + "<EFBFBD>˜a.");
p.sendMessage(this.prefix + " " + this.cmdTransferToPlayer1 + " " + amount + currencyPlural + " " + this.cmdTransferToPlayer2 + " " + target.getName().toLowerCase() + "<EFBFBD>˜a.");
target.sendMessage(this.prefix + " <EFBFBD>˜b" + p.getName().toLowerCase() + " " + this.cmdTransferToTarget1 + " " + amount + currencyPlural + "<EFBFBD>˜a.");
} else if (amount <= 1.0D) {
p.sendMessage(this.prefix + " " + this.cmdTransferToPlayer1 + " " + amount + currencySingular + " " + this.cmdTransferToPlayer2 + " " + target.getName() + "<EFBFBD>˜a.");
target.sendMessage(this.prefix + " <EFBFBD>˜b" + p.getName() + " " + this.cmdTransferToTarget1 + " " + amount + currencySingular + "<EFBFBD>˜a.");
p.sendMessage(this.prefix + " " + this.cmdTransferToPlayer1 + " " + amount + currencySingular + " " + this.cmdTransferToPlayer2 + " " + target.getName().toLowerCase() + "<EFBFBD>˜a.");
target.sendMessage(this.prefix + " <EFBFBD>˜b" + p.getName().toLowerCase() + " " + this.cmdTransferToTarget1 + " " + amount + currencySingular + "<EFBFBD>˜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 + " <EFBFBD>˜b" + amount + currencyPlural + " " + this.cmdEditAmountSetPlayer2 + " " + target.getName() + this.cmdEditAmountSetPlayer3);
p.sendMessage(this.prefix + " " + this.cmdEditAmountSetPlayer1 + " <EFBFBD>˜b" + amount + currencyPlural + " " + this.cmdEditAmountSetPlayer2 + " " + target.getName().toLowerCase() + this.cmdEditAmountSetPlayer3);
else if (amount <= 1.0D)
p.sendMessage(this.prefix + " " + this.cmdEditAmountSetPlayer1 + " <EFBFBD>˜b" + amount + currencySingular + " " + this.cmdEditAmountSetPlayer2 + " " + target.getName() + this.cmdEditAmountSetPlayer3);
p.sendMessage(this.prefix + " " + this.cmdEditAmountSetPlayer1 + " <EFBFBD>˜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+" <player>"+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<joblist.length;i++) {
if (!joblist[i].equalsIgnoreCase("None")) {
int mylv=this.plugin.getAccountsConfig().getInt(p.getName()+".jobs.job"+(i+1)+"lv");
int mylv=this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase().toLowerCase()+".jobs.job"+(i+1)+"lv");
if (mylv==40) {
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"))+"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"))+"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<this.plugin.explorers.size();j++) {
if (this.plugin.explorers.get(j).name.compareToIgnoreCase(p.getName())==0 && this.plugin.explorers.get(j).event==0) {
if (this.plugin.explorers.get(j).name.compareToIgnoreCase(p.getName().toLowerCase().toLowerCase())==0 && this.plugin.explorers.get(j).event==0) {
discovered=true;
timeleft=this.plugin.explorers.get(j).expiretime-this.plugin.SERVER_TICK_TIME;
}
@ -1835,16 +1835,16 @@ public String convertToItemName(String val) {
if (Bukkit.getPlayer(args[1])!=null) {
//This is the player. Show job stats.
p.sendMessage("");
p.sendMessage(Bukkit.getPlayer(args[1]).getName()+"'s jobs:");
p.sendMessage(Bukkit.getPlayer(args[1]).getName().toLowerCase()+"'s jobs:");
String[] joblist=this.plugin.getJobs(Bukkit.getPlayer(args[1]));
for (int i=0;i<joblist.length;i++) {
if (!joblist[i].equalsIgnoreCase("None")) {
int mylv=this.plugin.getAccountsConfig().getInt(Bukkit.getPlayer(args[1]).getName()+".jobs.job"+(i+1)+"lv");
int mylv=this.plugin.getAccountsConfig().getInt(Bukkit.getPlayer(args[1]).getName().toLowerCase()+".jobs.job"+(i+1)+"lv");
if (mylv==40) {
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"))+"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"))+"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<this.plugin.explorers.size();j++) {
if (this.plugin.explorers.get(j).name.compareToIgnoreCase(Bukkit.getPlayer(args[1]).getName())==0 && this.plugin.explorers.get(j).event==0) {
if (this.plugin.explorers.get(j).name.compareToIgnoreCase(Bukkit.getPlayer(args[1]).getName().toLowerCase())==0 && this.plugin.explorers.get(j).event==0) {
discovered=true;
timeleft=this.plugin.explorers.get(j).expiretime-this.plugin.SERVER_TICK_TIME;
}
@ -1868,26 +1868,26 @@ public String convertToItemName(String val) {
if (!found) {
OfflinePlayer q = Bukkit.getOfflinePlayer(args[1]);
//Try a search in the config directly.
if (this.plugin.getAccountsConfig().contains(q.getName())) {
if (this.plugin.getAccountsConfig().contains(q.getName().toLowerCase())) {
//This player seems to exist. Check out their stats.
p.sendMessage("");
p.sendMessage(q.getName()+"'s jobs:");
String[] joblist=this.plugin.getJobs(q.getName());
p.sendMessage(q.getName().toLowerCase()+"'s jobs:");
String[] joblist=this.plugin.getJobs(q.getName().toLowerCase());
for (int i=0;i<joblist.length;i++) {
if (!joblist[i].equalsIgnoreCase("None")) {
int mylv=this.plugin.getAccountsConfig().getInt(q.getName()+".jobs.job"+(i+1)+"lv");
int mylv=this.plugin.getAccountsConfig().getInt(q.getName().toLowerCase()+".jobs.job"+(i+1)+"lv");
if (mylv==40) {
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"))+"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"))+"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<this.plugin.explorers.size();j++) {
if (this.plugin.explorers.get(j).name.compareToIgnoreCase(q.getName())==0 && this.plugin.explorers.get(j).event==0) {
if (this.plugin.explorers.get(j).name.compareToIgnoreCase(q.getName().toLowerCase())==0 && this.plugin.explorers.get(j).event==0) {
discovered=true;
timeleft=this.plugin.explorers.get(j).expiretime-this.plugin.SERVER_TICK_TIME;
}

Loading…
Cancel
Save