Fixed all references of string names for account configs to have

.toLowerCase() so that everything is consistent and the functions come
out properly.
dev
sigonasr2 11 years ago
parent 2b64b6ba3d
commit 2898e12506
  1. 38
      BankEconomyMod/src/me/kaZep/Base/Main.java
  2. 16
      BankEconomyMod/src/me/kaZep/Base/PlayerBuffData.java
  3. 298
      BankEconomyMod/src/me/kaZep/Base/PlayerListener.java
  4. 135
      BankEconomyMod/src/me/kaZep/Commands/commandBankEconomy.java

@ -3652,7 +3652,7 @@ public void payDay(int time)
return;
}
if (PlayerinJob(p,job)) {
getAccountsConfig().set(p.getName()+".jobs.ultimate", String.valueOf(ValidJobs[matchedjob]));
getAccountsConfig().set(p.getName().toLowerCase()+".jobs.ultimate", String.valueOf(ValidJobs[matchedjob]));
saveAccountsConfig();
p.sendMessage(ChatColor.YELLOW+"Set Declared Ultimate job to "+job);
} else {
@ -3717,9 +3717,9 @@ 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));
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!");
@ -3780,7 +3780,7 @@ public void payDay(int time)
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));
getAccountsConfig().set(p.getName().toLowerCase()+".jobs.job"+(slot+1)+"exp", Double.valueOf(newexp));
saveAccountsConfig();
}
@ -3807,16 +3807,16 @@ 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));
getAccountsConfig().set(p.getName().toLowerCase()+".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) {
//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")) {
//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));
getAccountsConfig().set(p.getName().toLowerCase()+".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().toLowerCase()+".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+".");
if (getJobTotalLvs(p)%5==0) {
Bukkit.broadcastMessage(ChatColor.GREEN+p.getName()+" has reached Level "+getJobTotalLvs(p)+"!");
@ -3852,7 +3852,7 @@ 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));
getAccountsConfig().set(p.getName().toLowerCase()+".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+".");
if (getJobTotalLvs(p)%5==0) {
Bukkit.broadcastMessage(ChatColor.GREEN+p.getName()+" has reached Level "+getJobTotalLvs(p)+"!");
@ -4630,9 +4630,9 @@ public void payDay(int time)
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));
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
@ -4642,9 +4642,9 @@ public void payDay(int time)
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));
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
@ -4654,9 +4654,9 @@ public void payDay(int time)
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));
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;
}

@ -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,7 +260,7 @@ 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.");
}

@ -321,7 +321,7 @@ implements Listener
if (this.plugin.getAccountsConfig().getBoolean("halloween-enabled")) {
e.setAmount(e.getAmount()*2);
}
if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify3")) {
if (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify3")) {
p.sendMessage(ChatColor.DARK_GREEN+""+ChatColor.ITALIC+"Gained "+e.getAmount()+" exp.");
}
}
@ -1517,50 +1517,50 @@ implements Listener
//This is a brand new player.
Main.economy.withdrawPlayer(p.getName(), Main.economy.getBalance(p.getName()));
Main.economy.depositPlayer(p.getName(), 70);
this.plugin.getAccountsConfig().set(p.getName() + ".status", Boolean.valueOf(true));
this.plugin.getAccountsConfig().set(p.getName() + ".money", Double.valueOf(this.plugin.getConfig().getDouble("start-balance")));
this.plugin.getAccountsConfig().set(p.getName() + ".revived", Boolean.valueOf(true));
this.plugin.getAccountsConfig().set(p.getName() + ".spleefrating", Double.valueOf(1000.0d));
this.plugin.getAccountsConfig().set(p.getName() + ".spleefwins", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName() + ".spleeflosses", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName() + ".jobs.job1", String.valueOf("None"));
this.plugin.getAccountsConfig().set(p.getName() + ".jobs.job1lv", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName() + ".jobs.job1exp", Double.valueOf(0.0d));
this.plugin.getAccountsConfig().set(p.getName() + ".jobs.job2", String.valueOf("None"));
this.plugin.getAccountsConfig().set(p.getName() + ".jobs.job2lv", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName() + ".jobs.job2exp", Double.valueOf(0.0d));
this.plugin.getAccountsConfig().set(p.getName() + ".jobs.job3", String.valueOf("None"));
this.plugin.getAccountsConfig().set(p.getName() + ".jobs.job3lv", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName() + ".jobs.job3exp", Double.valueOf(0.0d));
this.plugin.getAccountsConfig().set(p.getName() + ".jobs.ultimate", String.valueOf("None"));
this.plugin.getAccountsConfig().set(p.getName() + ".jobs.ultimatesealed", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat1", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat2", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat3", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat4", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat5", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat6", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat7", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat8", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat9", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat10", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName() + ".settings.notify1", Boolean.valueOf(true));
this.plugin.getAccountsConfig().set(p.getName() + ".settings.notify2", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName() + ".settings.notify3", Boolean.valueOf(true));
this.plugin.getAccountsConfig().set(p.getName() + ".settings.notify4", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName() + ".settings.notify5", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName() + ".settings.notify6", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest1", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest2", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest3", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest4", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest5", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest6", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest7", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest8", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest9", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest10", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName()+".bonus.witherskeleton", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".status", Boolean.valueOf(true));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".money", Double.valueOf(this.plugin.getConfig().getDouble("start-balance")));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".revived", Boolean.valueOf(true));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".spleefrating", Double.valueOf(1000.0d));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".spleefwins", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".spleeflosses", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".jobs.job1", String.valueOf("None"));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".jobs.job1lv", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".jobs.job1exp", Double.valueOf(0.0d));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".jobs.job2", String.valueOf("None"));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".jobs.job2lv", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".jobs.job2exp", Double.valueOf(0.0d));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".jobs.job3", String.valueOf("None"));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".jobs.job3lv", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".jobs.job3exp", Double.valueOf(0.0d));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".jobs.ultimate", String.valueOf("None"));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".jobs.ultimatesealed", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat1", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat2", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat3", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat4", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat5", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat6", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat7", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat8", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat9", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat10", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".settings.notify1", Boolean.valueOf(true));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".settings.notify2", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".settings.notify3", Boolean.valueOf(true));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".settings.notify4", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".settings.notify5", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".settings.notify6", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest1", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest2", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest3", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest4", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest5", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest6", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest7", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest8", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest9", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest10", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase()+".bonus.witherskeleton", Integer.valueOf(0));
this.plugin.saveAccountsConfig();
System.out.println("[BankEconomy] Bank account created for " + p.getName() + ".");
if (playerwhitelisted) {
@ -1580,34 +1580,34 @@ implements Listener
DecimalFormat df = new DecimalFormat("#0.00");
p.sendMessage(ChatColor.DARK_AQUA+"For a list of all changes made to this server, visit: http://z-gamers.net/changelog.html");
p.sendMessage("----------------------------");
p.sendMessage(ChatColor.YELLOW+"Current Money Balance: $ "+df.format(Main.economy.bankBalance(p.getName()).balance)+", Bank Balance: $"+df.format(this.plugin.getAccountsConfig().getDouble(p.getName()+".money")));
p.sendMessage(ChatColor.YELLOW+"Current Money Balance: $ "+df.format(Main.economy.bankBalance(p.getName()).balance)+", Bank Balance: $"+df.format(this.plugin.getAccountsConfig().getDouble(p.getName().toLowerCase()+".money")));
//Update account information for the stat point update.
if (!this.plugin.getAccountsConfig().contains(p.getName() + ".bonus.witherskeleton")) {
this.plugin.getAccountsConfig().set(p.getName()+".bonus.witherskeleton", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase()+".bonus.witherskeleton", Integer.valueOf(0));
this.plugin.saveAccountsConfig();
}
if (!this.plugin.getAccountsConfig().contains(p.getName() + ".stats.stat1")) {
this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat1", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat2", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat3", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat4", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat5", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat6", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat7", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat8", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat9", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat10", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat1", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat2", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat3", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat4", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat5", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat6", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat7", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat8", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat9", Integer.valueOf(0));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".stats.stat10", Integer.valueOf(0));
this.plugin.saveAccountsConfig();
System.out.println("Updated " + p.getName() + "'s data with stat point update.");
}
//Update account information for notification settings.
if (!this.plugin.getAccountsConfig().contains(p.getName() + ".settings.notify1")) {
this.plugin.getAccountsConfig().set(p.getName() + ".settings.notify1", Boolean.valueOf(true));
this.plugin.getAccountsConfig().set(p.getName() + ".settings.notify2", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName() + ".settings.notify3", Boolean.valueOf(true));
this.plugin.getAccountsConfig().set(p.getName() + ".settings.notify4", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName() + ".settings.notify5", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName() + ".settings.notify6", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".settings.notify1", Boolean.valueOf(true));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".settings.notify2", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".settings.notify3", Boolean.valueOf(true));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".settings.notify4", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".settings.notify5", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".settings.notify6", Boolean.valueOf(false));
this.plugin.saveAccountsConfig();
System.out.println("Updated " + p.getName() + "'s data with nofitications update.");
}
@ -1623,7 +1623,7 @@ implements Listener
}
if (!full) {
if (!this.plugin.getAccountsConfig().contains(p.getName() + ".join.halloween_book")) {
this.plugin.getAccountsConfig().set(p.getName() + ".join.halloween_book", Boolean.valueOf(true));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".join.halloween_book", Boolean.valueOf(true));
this.plugin.saveAccountsConfig();
System.out.println("Updated " + p.getName() + "'s data with a Halloween Book.");
ItemStack book = new ItemStack(Material.WRITTEN_BOOK);
@ -1641,7 +1641,7 @@ implements Listener
p.getInventory().addItem(book);
}
if (!this.plugin.getAccountsConfig().contains(p.getName() + ".join.halloween_vote_signs")) {
this.plugin.getAccountsConfig().set(p.getName() + ".join.halloween_vote_signs", Boolean.valueOf(true));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".join.halloween_vote_signs", Boolean.valueOf(true));
this.plugin.saveAccountsConfig();
ItemStack sign = new ItemStack(Material.SIGN,2);
ItemMeta meta = sign.getItemMeta();
@ -1656,25 +1656,25 @@ implements Listener
}
}
if (!this.plugin.getAccountsConfig().contains(p.getName() + ".halloween.chest1")) {
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest1", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest2", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest3", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest4", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest5", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest6", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest7", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest8", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest9", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest10", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest1", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest2", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest3", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest4", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest5", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest6", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest7", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest8", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest9", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.chest10", Boolean.valueOf(false));
this.plugin.saveAccountsConfig();
}
if (!this.plugin.getAccountsConfig().contains(p.getName() + ".jobs.ultimate")) {
this.plugin.getAccountsConfig().set(p.getName() + ".jobs.ultimate", String.valueOf("None"));
this.plugin.getAccountsConfig().set(p.getName() + ".jobs.ultimatesealed", Boolean.valueOf(false));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".jobs.ultimate", String.valueOf("None"));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".jobs.ultimatesealed", Boolean.valueOf(false));
this.plugin.saveAccountsConfig();
}
if (!this.plugin.getAccountsConfig().contains(p.getName() + ".halloween.wand")) {
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.wand", Long.valueOf(Main.SERVER_TICK_TIME));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".halloween.wand", Long.valueOf(Main.SERVER_TICK_TIME));
this.plugin.saveAccountsConfig();
}
}
@ -1685,8 +1685,8 @@ implements Listener
p.sendMessage(ChatColor.GOLD+"");
}
//Set Stat Point specific stuff here.
if (this.plugin.getAccountsConfig().getInt(p.getName() + ".stats.stat10")>0) {
p.setMaximumAir(300+this.plugin.getStatBonus(9, this.plugin.getAccountsConfig().getInt(p.getName() + ".stats.stat10"))*20);
if (this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase() + ".stats.stat10")>0) {
p.setMaximumAir(300+this.plugin.getStatBonus(9, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase() + ".stats.stat10"))*20);
}
if (p.getLocation().getY()>78.0d && p.getLocation().getZ()>53.0d && p.getLocation().getZ()<64.0d && p.getLocation().getX()<1627.0d && p.getLocation().getX()>1616.0d) {
//In a spleef zone. Kick this player out.
@ -5102,47 +5102,6 @@ implements Listener
Player p = e.getPlayer();
Bukkit.getPlayer("sigonasr2").sendMessage("Extacting "+e.getItemAmount()+" "+e.getItemType());
}*/
@EventHandler
public void onLeafDecay(LeavesDecayEvent e) {
Player[] list = Bukkit.getOnlinePlayers();
for (int i=0;i<list.length;i++) {
double distance=Math.abs(list[i].getLocation().getX()-e.getBlock().getX())+Math.abs(list[i].getLocation().getY()-e.getBlock().getY())+Math.abs(list[i].getLocation().getZ()-e.getBlock().getZ());
if (distance<50) {
if (this.plugin.PlayerinJob(list[i], "Woodcutter") && this.plugin.getJobLv("Woodcutter", list[i])>=20) {
//Increase sapling drops by 64%.
if (e.getBlock().getData()!=3) {
//This is not a jungle leaf block.
if (Math.random()*100<=25) {
//Produce a sapling.
Bukkit.getWorld("world").dropItem(e.getBlock().getLocation(), new ItemStack(Material.SAPLING,1,e.getBlock().getData()));
//list[i].sendMessage("You got an extra spawned sapling.");
}
} else {
if (Math.random()*100<=12.5) {
//Produce a sapling.
Bukkit.getWorld("world").dropItem(e.getBlock().getLocation(), new ItemStack(Material.SAPLING,1,e.getBlock().getData()));
}
}
} else
if (this.plugin.PlayerinJob(list[i], "Woodcutter") && this.plugin.getJobLv("Woodcutter", list[i])>=5) {
//Increase sapling drops by 40%.
if (e.getBlock().getData()!=3) {
//This is not a jungle leaf block.
if (Math.random()*100<=12) {
//Produce a sapling.
Bukkit.getWorld("world").dropItem(e.getBlock().getLocation(), new ItemStack(Material.SAPLING,1,e.getBlock().getData()));
//list[i].sendMessage("You got an extra spawned sapling.");
}
} else {
if (Math.random()*100<=6) {
//Produce a sapling.
Bukkit.getWorld("world").dropItem(e.getBlock().getLocation(), new ItemStack(Material.SAPLING,1,e.getBlock().getData()));
}
}
}
}
}
}
@EventHandler
public void onItemChange(PlayerItemHeldEvent e) {
@ -5214,19 +5173,6 @@ implements Listener
}
}
}
if (this.plugin.PlayerinJob(p, "Woodcutter") && this.plugin.getJobLv("Woodcutter", p)>=10) {
if (p.getInventory().getContents()[e.getNewSlot()]!=null &&
(p.getInventory().getContents()[e.getNewSlot()].getType()==Material.WOOD_AXE ||
p.getInventory().getContents()[e.getNewSlot()].getType()==Material.IRON_AXE ||
p.getInventory().getContents()[e.getNewSlot()].getType()==Material.GOLD_AXE ||
p.getInventory().getContents()[e.getNewSlot()].getType()==Material.DIAMOND_AXE ||
p.getInventory().getContents()[e.getNewSlot()].getType()==Material.STONE_AXE)) {
ItemStack currentitem = p.getInventory().getContents()[e.getNewSlot()];
if (!currentitem.containsEnchantment(Enchantment.getByName("DIG_SPEED"))) {
currentitem.addEnchantment(Enchantment.getByName("DIG_SPEED"), 1);
}
}
}
}
public ItemStack getGoodie() {
@ -6048,7 +5994,7 @@ implements Listener
if (f.getKiller()!=null && f.getKiller().getType()==EntityType.PLAYER) {
Player p = f.getKiller();
if (f.getType()==EntityType.SKELETON && ((Skeleton)f).getSkeletonType()==SkeletonType.WITHER) {
this.plugin.getAccountsConfig().set(p.getName()+".bonus.witherskeleton", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName()+".bonus.witherskeleton"))+1);
this.plugin.getAccountsConfig().set(p.getName().toLowerCase()+".bonus.witherskeleton", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".bonus.witherskeleton"))+1);
}
for (int x=-10;x<10;x++) {
for (int y=-3;y<3;y++) {
@ -6157,7 +6103,7 @@ implements Listener
this.plugin.gainMoneyExp(p,"Hunter",275.00,7800);
}
}
if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify3")) {
if (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify3")) {
p.sendMessage(ChatColor.DARK_GREEN+""+ChatColor.ITALIC+"Gained "+e.getDroppedExp()+" exp.");
}
if (this.plugin.getConfig().getBoolean("halloween-enabled") && p.getWorld().getName().equalsIgnoreCase("world") && (e.getEntity() instanceof Sheep)) {
@ -6199,8 +6145,8 @@ implements Listener
p.getScoreboard().getTeam(p.getName()).setSuffix(healthbar(p.getHealth(),p.getMaxHealth(),p.getFoodLevel()));
}
},5);
if (this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat9")>0) {
if (Math.random()<=this.plugin.getStatBonus(8, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat9"))/100.0d) {
if (this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat9")>0) {
if (Math.random()<=this.plugin.getStatBonus(8, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat9"))/100.0d) {
e.setFoodLevel(e.getFoodLevel()+1);
}
}
@ -6538,13 +6484,13 @@ implements Listener
if (e.getInventory().getContents()[m]!=null && e.getInventory().getContents()[m].getType()==Material.PUMPKIN_PIE) {
if (e.getInventory().getContents()[m].getItemMeta().getDisplayName()!=null && e.getInventory().getContents()[m].getItemMeta().getDisplayName().contains("Pie ")) {
int numb = Integer.valueOf(e.getInventory().getContents()[m].getItemMeta().getDisplayName().replace("Pie ",""));
if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".halloween.chest"+numb)) {
if (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".halloween.chest"+numb)) {
p.closeInventory();
p.sendMessage("You already got this magic pie!");
e.setCancelled(true);
} else {
//Show the user a fake inventory containing the magic pie.
this.plugin.getAccountsConfig().set(p.getName()+".halloween.chest"+numb, Boolean.valueOf(true));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase()+".halloween.chest"+numb, Boolean.valueOf(true));
this.plugin.saveAccountsConfig();
p.closeInventory();
e.setCancelled(true);
@ -6712,7 +6658,7 @@ implements Listener
}
}
final double player_starthp = p.getHealth();
if (p.getNoDamageTicks()<p.getMaximumNoDamageTicks()/2.0f && this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify5") && e.getCause()!=DamageCause.ENTITY_ATTACK && e.getCause()!=DamageCause.ENTITY_EXPLOSION && e.getDamage()!=0) {
if (p.getNoDamageTicks()<p.getMaximumNoDamageTicks()/2.0f && this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify5") && e.getCause()!=DamageCause.ENTITY_ATTACK && e.getCause()!=DamageCause.ENTITY_EXPLOSION && e.getDamage()!=0) {
final Main plugin = this.plugin;
Bukkit.getScheduler().scheduleSyncDelayedTask(this.plugin, new Runnable() {
@Override
@ -6823,8 +6769,8 @@ implements Listener
public void onPlayerOnFire(EntityCombustEvent e) {
if (e.getEntity().getType()==EntityType.PLAYER) {
Player p = (Player)e.getEntity();
if (this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat6")>0) {
p.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, (this.plugin.getStatBonus(5, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat6"))/3)*20, 0));
if (this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat6")>0) {
p.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, (this.plugin.getStatBonus(5, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat6"))/3)*20, 0));
}
}
}
@ -6868,8 +6814,8 @@ implements Listener
}, 1L);
}
}
if (this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat1")>0) {
e.setAmount(e.getAmount()+this.plugin.getStatBonus(0, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat1")/6));
if (this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat1")>0) {
e.setAmount(e.getAmount()+this.plugin.getStatBonus(0, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat1")/6));
}
}
}
@ -7060,7 +7006,7 @@ implements Listener
if (e.getDamager() instanceof LivingEntity) {
final double player_starthp = p.getHealth();
final LivingEntity l = (LivingEntity)e.getDamager();
if (p.getNoDamageTicks()<p.getMaximumNoDamageTicks()/2.0f && this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify5")) {
if (p.getNoDamageTicks()<p.getMaximumNoDamageTicks()/2.0f && this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify5")) {
final Main plug = this.plugin;
Bukkit.getScheduler().scheduleSyncDelayedTask(this.plugin, new Runnable() {
@Override
@ -7493,9 +7439,9 @@ implements Listener
}
//Bukkit.getLogger().info("Made it through 4.");
p.updateInventory();
if (this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat3")>0) {
if (this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat3")>0) {
double olddmg=e.getDamage();
e.setDamage(e.getDamage()*(((100-this.plugin.getStatBonus(2, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat3")/4))/100.0d)));
e.setDamage(e.getDamage()*(((100-this.plugin.getStatBonus(2, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat3")/4))/100.0d)));
//p.sendMessage("Damage set from "+olddmg+" to "+e.getDamage());
}
}
@ -7575,7 +7521,7 @@ implements Listener
if (throughdmg>e.getDamage()/2) {
if (p.getHealth()-throughdmg>0) {
p.setHealth(p.getHealth()-throughdmg);
if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify5") && e.getDamage()!=0) {
if (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify5") && e.getDamage()!=0) {
//p.sendMessage(ChatColor.DARK_PURPLE+""+ChatColor.ITALIC+"You were hurt for "+Math.round(throughdmg*10)/10+" damage from "+convertToItemName(e.getCause().name())+".");
}
} else {
@ -7608,7 +7554,7 @@ implements Listener
} else {
if (p.getHealth()-e.getDamage()/2>0) {
p.setHealth(p.getHealth()-e.getDamage()/2);
if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify5") && e.getDamage()!=0) {
if (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify5") && e.getDamage()!=0) {
//p.sendMessage(ChatColor.DARK_PURPLE+""+ChatColor.ITALIC+"You were hurt for "+Math.round(e.getDamage()/2*10)/10+" damage from "+convertToItemName(e.getCause().name())+".");
}
} else {
@ -7672,7 +7618,7 @@ implements Listener
if (throughdmg>e.getDamage()) {
if (p.getHealth()-throughdmg>0) {
p.setHealth(p.getHealth()-throughdmg);
if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify5") && e.getDamage()!=0) {
if (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify5") && e.getDamage()!=0) {
//p.sendMessage(ChatColor.DARK_PURPLE+""+ChatColor.ITALIC+"You were hurt for "+Math.round(throughdmg*10)/10+" damage from "+convertToItemName(e.getCause().name())+".");
}
} else {
@ -7710,7 +7656,7 @@ implements Listener
} else {
if (p.getHealth()-e.getDamage()>0) {
p.setHealth(p.getHealth()-e.getDamage());
if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify5") && e.getDamage()!=0) {
if (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify5") && e.getDamage()!=0) {
//p.sendMessage(ChatColor.DARK_PURPLE+""+ChatColor.ITALIC+"You were hurt for "+Math.round(e.getDamage()*10)/10+" damage from "+convertToItemName(e.getCause().name())+".");
}
} else {
@ -7889,24 +7835,24 @@ implements Listener
//Deal 2 extra damage.
e.setDamage(e.getDamage()+2);
}
if (this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat7")>0) {
e.setDamage(e.getDamage()+(this.plugin.getStatBonus(6, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat7"))/2));
if (this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat7")>0) {
e.setDamage(e.getDamage()+(this.plugin.getStatBonus(6, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat7"))/2));
}
//Add Armor penetration from the stat point, if any.
if (this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4)>0) {
armor_pen+=this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4);
if (this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat5")/4)>0) {
armor_pen+=this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat5")/4);
}
if (f.getNoDamageTicks()<f.getMaximumNoDamageTicks()/2.0f && armor_pen>0) {
double normaldmg=(this.plugin.DMGCALC.getDamage(f.getEquipment().getHelmet(), f.getEquipment().getChestplate(), f.getEquipment().getLeggings(), f.getEquipment().getBoots(), e.getDamage(), DamageCause.ENTITY_ATTACK, false));
double throughdmg=(this.plugin.DMGCALC.getDamage(new ItemStack(Material.AIR), new ItemStack(Material.AIR), new ItemStack(Material.AIR), new ItemStack(Material.AIR), e.getDamage(), DamageCause.ENTITY_ATTACK, false));
if (throughdmg>normaldmg+armor_pen) {
//This means some piercing can be done.
//e.setDamage(normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4));
//e.setDamage(normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat5")/4));
if (f.getHealth()-(normaldmg+armor_pen)>0) {
f.setHealth(f.getHealth()-(normaldmg+armor_pen));
armor_pen_dmg=(normaldmg+armor_pen);
if (f!=null) {
if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")) {
if (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify4")) {
if (f.getCustomName()!=null) {
//p.sendMessage(ChatColor.RED+""+ChatColor.ITALIC+" Dealt "+(Math.round(normaldmg+armor_pen)*10)/10+" damage to "+convertToItemName(f.getCustomName())+".");
} else {
@ -7923,7 +7869,7 @@ implements Listener
f.setHealth(f.getHealth()-throughdmg);
armor_pen_dmg=throughdmg;
if (f!=null) {
if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")) {
if (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify4")) {
if (f.getCustomName()!=null) {
//p.sendMessage(ChatColor.RED+""+ChatColor.ITALIC+" Dealt "+(Math.round(throughdmg)*10)/10+" damage to "+convertToItemName(f.getCustomName())+".");
} else {
@ -7938,7 +7884,7 @@ implements Listener
e.setDamage(0);
}
if (f.getNoDamageTicks()<f.getMaximumNoDamageTicks()/2.0f && e.getDamage()!=0) {
if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")) {
if (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify4")) {
if (f.getCustomName()!=null) {
//p.sendMessage(ChatColor.RED+""+ChatColor.ITALIC+" Dealt "+(Math.round((this.plugin.DMGCALC.getDamage(f.getEquipment().getHelmet(), f.getEquipment().getChestplate(), f.getEquipment().getLeggings(), f.getEquipment().getBoots(), e.getDamage(), DamageCause.ENTITY_ATTACK, false)))*10)/10+" damage to "+convertToItemName(f.getCustomName())+".");
} else {
@ -7946,7 +7892,7 @@ implements Listener
}
}
}
if (f.getNoDamageTicks()<f.getMaximumNoDamageTicks()/2.0f && this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")) {
if (f.getNoDamageTicks()<f.getMaximumNoDamageTicks()/2.0f && this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify4")) {
final double armor_dmg = armor_pen_dmg;
Bukkit.getScheduler().scheduleSyncDelayedTask(this.plugin, new Runnable() {
@Override
@ -8017,8 +7963,8 @@ implements Listener
e.setDamage(e.getDamage()+dmg);
}
//Add Armor penetration from the stat point, if any.
if (this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4)>0) {
armor_pen+=this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4);
if (this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat5")/4)>0) {
armor_pen+=this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat5")/4);
}
if (e.getEntity() instanceof LivingEntity) {
LivingEntity enemy = (LivingEntity)e.getEntity();
@ -8063,8 +8009,8 @@ implements Listener
//Deal 2 extra damage.
e.setDamage(e.getDamage()+2);
}
if (this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat7")>0) {
e.setDamage(e.getDamage()+(this.plugin.getStatBonus(6, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat7"))/2));
if (this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat7")>0) {
e.setDamage(e.getDamage()+(this.plugin.getStatBonus(6, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat7"))/2));
}
if (f.getNoDamageTicks()<f.getMaximumNoDamageTicks()/2.0f && armor_pen>0) {
double normaldmg=(this.plugin.DMGCALC.getDamage(f.getEquipment().getHelmet(), f.getEquipment().getChestplate(), f.getEquipment().getLeggings(), f.getEquipment().getBoots(), e.getDamage(), DamageCause.ENTITY_ATTACK, false));
@ -8073,11 +8019,11 @@ implements Listener
if (throughdmg>normaldmg+armor_pen) {
//This means some piercing can be done.
//e.setDamage(normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4));
//e.setDamage(normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat5")/4));
if (f.getHealth()-(normaldmg+armor_pen)>0) {
f.setHealth(f.getHealth()-(normaldmg+armor_pen));
armor_pen_dmg=(normaldmg+armor_pen);
if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")) {
if (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify4")) {
if (f.getCustomName()!=null) {
//p.sendMessage(ChatColor.RED+""+ChatColor.ITALIC+" Dealt "+(Math.round(normaldmg+armor_pen)*10)/10+" damage to "+convertToItemName(f.getCustomName())+".");
} else {
@ -8092,7 +8038,7 @@ implements Listener
if (f.getHealth()-throughdmg>0) {
f.setHealth(f.getHealth()-throughdmg);
armor_pen_dmg=throughdmg;
if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")) {
if (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify4")) {
if (f.getCustomName()!=null) {
//p.sendMessage(ChatColor.RED+""+ChatColor.ITALIC+" Dealt "+(Math.round(throughdmg)*10)/10+" damage to "+convertToItemName(f.getCustomName())+".");
} else {
@ -8106,7 +8052,7 @@ implements Listener
e.setDamage(0);
}
if (f.getNoDamageTicks()<f.getMaximumNoDamageTicks()/2.0f && e.getDamage()!=0) {
if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")) {
if (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify4")) {
if (f.getCustomName()!=null) {
//p.sendMessage(ChatColor.RED+""+ChatColor.ITALIC+" Dealt "+(Math.round((this.plugin.DMGCALC.getDamage(f.getEquipment().getHelmet(), f.getEquipment().getChestplate(), f.getEquipment().getLeggings(), f.getEquipment().getBoots(), e.getDamage(), DamageCause.ENTITY_ATTACK, false)))*10)/10+" damage to "+convertToItemName(f.getCustomName())+".");
} else {
@ -8114,7 +8060,7 @@ implements Listener
}
}
}
if (f.getNoDamageTicks()<f.getMaximumNoDamageTicks()/2.0f && this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")) {
if (f.getNoDamageTicks()<f.getMaximumNoDamageTicks()/2.0f && this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify4")) {
final double armor_dmg = armor_pen_dmg;
Bukkit.getScheduler().scheduleSyncDelayedTask(this.plugin, new Runnable() {
@Override
@ -11298,8 +11244,8 @@ implements Listener
list[i].playSound(list[i].getLocation(), Sound.NOTE_PLING, 8, 0.7f);
}
}
if (!this.plugin.getAccountsConfig().getBoolean(p.getName()+".revived")) {
this.plugin.getAccountsConfig().set(p.getName() + ".revived", Boolean.valueOf(true));
if (!this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".revived")) {
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".revived", Boolean.valueOf(true));
this.plugin.saveAccountsConfig();
}
if (this.plugin.getConfig().getBoolean("spleefinsession") && (p.getName().compareTo(this.plugin.getConfig().getString("spleefrequestaplayer"))==0 || p.getName().compareTo(this.plugin.getConfig().getString("spleefrequestbplayer"))==0)) {
@ -12161,8 +12107,8 @@ implements Listener
Action blockAction = e.getAction();
String currencySG = Main.economy.currencyNameSingular();
String currencyPL = Main.economy.currencyNamePlural();
boolean stats = this.plugin.getAccountsConfig().getBoolean(p.getName() + ".status");
double actMon = this.plugin.getAccountsConfig().getDouble(p.getName() + ".money");
boolean stats = this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase() + ".status");
double actMon = this.plugin.getAccountsConfig().getDouble(p.getName().toLowerCase() + ".money");
int actHand = (int)Main.economy.getBalance(p.getName());
if (this.plugin.PlayerinJob(p, "Explorer")) {
for (int i=0;i<this.plugin.explorerlist.size();i++) {
@ -12617,7 +12563,7 @@ implements Listener
/*double value = Double.parseDouble(arg0);
double total = actMon + value;
if (value <= actHand) {
this.plugin.getAccountsConfig().set(p.getName() + ".money", Double.valueOf(total));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".money", Double.valueOf(total));
this.plugin.saveAccountsConfig();
if (value <= 1)
p.sendMessage("<EFBFBD>ァ2[BankEconomy]" + ChatColor.AQUA + " You added " + value + " " + currencySG + " to your bank account.");
@ -12643,7 +12589,7 @@ implements Listener
/*int value = Integer.parseInt(sign.getLine(2));
double total = actMon - value;
if (value <= actMon) {
this.plugin.getAccountsConfig().set(p.getName() + ".money", Double.valueOf(total));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".money", Double.valueOf(total));
this.plugin.saveAccountsConfig();
if (value <= 1)
p.sendMessage("<EFBFBD>ァ2[BankEconomy]" + ChatColor.AQUA + " You withdrawn " + value + " " + currencySG + " from your bank account.");

@ -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() + ".status");
int playerBankBalance = this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase() + ".money");
String currencySingular = Main.economy.currencyNameSingular();
String currencyPlural = Main.economy.currencyNamePlural();
@ -352,16 +352,16 @@ public String convertToItemName(String val) {
//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()+".stats.stat1")/6+" - "+ChatColor.AQUA+" 6 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat1")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat1")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(0, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat1")/6)+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(0, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat1")/6+1):ChatColor.RED+"+"+this.plugin.getStatBonus(0, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat1")/6+1)):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(0, this.plugin.getAccountsConfig().getInt(p.getName().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()+".stats.stat2")/5+" - "+ChatColor.AQUA+" 5 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat2")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat2")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(1, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat2")/5)+"%"+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(1, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat2")/5+1)+"%":ChatColor.RED+"+"+this.plugin.getStatBonus(1, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat2")/5+1)+"%"):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(1, this.plugin.getAccountsConfig().getInt(p.getName().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()+".stats.stat3")/4+" - "+ChatColor.AQUA+" 4 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat3")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat3")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(2, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat3")/4)+"%"+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(2, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat3")/4+1)+"%":ChatColor.RED+"+"+this.plugin.getStatBonus(2, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat3")/4+1)+"%"):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(2, this.plugin.getAccountsConfig().getInt(p.getName().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()+".stats.stat5")/4+" - "+ChatColor.AQUA+" 4 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat5")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat5")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat5")/4)+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat5")/4+1):ChatColor.RED+"+"+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat5")/4+1)):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName().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()+".stats.stat4")/3+" - "+ChatColor.AQUA+" 3 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat4")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat4")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(3, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat4")/3)+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(3, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat4")/3+1):ChatColor.RED+"+"+this.plugin.getStatBonus(3, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat4")/3+1)):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(3, this.plugin.getAccountsConfig().getInt(p.getName().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()+".stats.stat6")/3+" - "+ChatColor.AQUA+" 3 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat6")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat6")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(5, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat6")/3)+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(5, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat6")/3+1):ChatColor.RED+"+"+this.plugin.getStatBonus(5, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat6")/3+1)):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(5, this.plugin.getAccountsConfig().getInt(p.getName().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()+".stats.stat7")/2+" - "+ChatColor.AQUA+" 2 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat7")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat7")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(6, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat7")/2)+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(6, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat7")/2+1):ChatColor.RED+"+"+this.plugin.getStatBonus(6, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat7")/2+1)):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(6, this.plugin.getAccountsConfig().getInt(p.getName().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()+".stats.stat8")/2+" - "+ChatColor.AQUA+" 2 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat8")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat8")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(7, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat8")/2)+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(7, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat8")/2+1):ChatColor.RED+"+"+this.plugin.getStatBonus(7, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat8")/2+1)):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(7, this.plugin.getAccountsConfig().getInt(p.getName().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()+".stats.stat9")/1+" - "+ChatColor.AQUA+" 1 pt: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat9")<25 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat9")>0/*Has a point in it.*/?ChatColor.YELLOW+"-"+this.plugin.getStatBonus(8, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat9")/1)+"%"+"/"+ChatColor.RED+"-"+this.plugin.getStatBonus(8, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat9")/1+1)+"%":ChatColor.RED+"-"+this.plugin.getStatBonus(8, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat9")/1+1)+"%"):(ChatColor.YELLOW+"-"+this.plugin.getStatBonus(8, this.plugin.getAccountsConfig().getInt(p.getName().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()+".stats.stat10")/1+" - "+ChatColor.AQUA+" 1 pt: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat10")<25 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat10")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(9, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat10")/1)+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(9, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat10")/1+1):ChatColor.RED+"+"+this.plugin.getStatBonus(9, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat10")/1+1)):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(9, this.plugin.getAccountsConfig().getInt(p.getName().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.
@ -379,22 +379,22 @@ 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()+".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()+".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()+".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()+".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()+".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()+".settings.notify6")?on:off));
p.openInventory(i);
} else
if (cmd.getName().equalsIgnoreCase("event")) {
@ -1191,7 +1191,7 @@ public String convertToItemName(String val) {
double totalWithdraw = playerBankBalance - amount;
double totalDeposit = amount + this.plugin.getAccountsConfig().getInt(target.getName() + ".money");
this.plugin.getAccountsConfig().set(p.getName() + ".money", Double.valueOf(totalWithdraw));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".money", Double.valueOf(totalWithdraw));
this.plugin.getAccountsConfig().set(target.getName() + ".money", Double.valueOf(totalDeposit));
this.plugin.saveAccountsConfig();
@ -1213,92 +1213,92 @@ public String convertToItemName(String val) {
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.getAccountsConfig().set(p.getName().toLowerCase()+".stats.stat1", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName().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()+".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.");
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()+".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()+".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.getAccountsConfig().set(p.getName().toLowerCase()+".stats.stat2", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName().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()+".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.");
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()+".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.getAccountsConfig().set(p.getName().toLowerCase()+".stats.stat3", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName().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()+".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.");
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()+".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.getAccountsConfig().set(p.getName().toLowerCase()+".stats.stat4", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName().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()+".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.");
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()+".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.getAccountsConfig().set(p.getName().toLowerCase()+".stats.stat5", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName().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()+".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.");
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()+".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.getAccountsConfig().set(p.getName().toLowerCase()+".stats.stat6", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName().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()+".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.");
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()+".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.getAccountsConfig().set(p.getName().toLowerCase()+".stats.stat7", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName().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()+".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.");
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()+".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.getAccountsConfig().set(p.getName().toLowerCase()+".stats.stat8", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName().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()+".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.");
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()+".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.getAccountsConfig().set(p.getName().toLowerCase()+".stats.stat9", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName().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()+".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.");
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()+".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.getAccountsConfig().set(p.getName().toLowerCase()+".stats.stat10", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName().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()+".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.");
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()+".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() + ".stats.stat10"))*20);
} else {
p.sendMessage(ChatColor.RED+"You do not have enough stat points to get that stat! (You need 1.)");
}
@ -1389,7 +1389,7 @@ public String convertToItemName(String val) {
double totalWithdraw = playerBankBalance - amount;
double totalDeposit = amount + this.plugin.getAccountsConfig().getInt(target.getName() + ".money");
this.plugin.getAccountsConfig().set(p.getName() + ".money", Double.valueOf(totalWithdraw));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".money", Double.valueOf(totalWithdraw));
this.plugin.getAccountsConfig().set(target.getName() + ".money", Double.valueOf(totalDeposit));
this.plugin.saveAccountsConfig();
@ -1452,12 +1452,12 @@ public String convertToItemName(String val) {
}
else if (cmd.getName().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() + ".deathpointX");
double deathY = this.plugin.getAccountsConfig().getDouble(p.getName().toLowerCase() + ".deathpointY");
double deathZ = this.plugin.getAccountsConfig().getDouble(p.getName().toLowerCase() + ".deathpointZ");
String deathWorld = this.plugin.getAccountsConfig().getString(p.getName().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() + ".revived")==false && this.plugin.SERVER_TICK_TIME-this.plugin.getAccountsConfig().getLong(p.getName().toLowerCase() + ".revivetime")<12000) {
double mincost = this.plugin.getConfig().getDouble("revive-cost-rate");
//p.sendMessage("Got 2.");
if (p.getBedSpawnLocation()!=null) {
@ -1465,16 +1465,16 @@ 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() + ".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.getAccountsConfig().set(p.getName().toLowerCase() + ".revived", Boolean.valueOf(true));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".money", mymoney-finalcost);
this.plugin.getAccountsConfig().set(p.getName().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));
@ -1535,7 +1535,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() + ".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;
@ -1545,7 +1545,7 @@ public String convertToItemName(String val) {
}
else if (cmd.getName().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() + ".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) {
@ -1560,19 +1560,19 @@ 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() == this.plugin.getAccountsConfig().getString(p.getName().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() + ".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.getAccountsConfig().set(p.getName().toLowerCase() + ".money", mymoney-finalcost);
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".teletime", Double.valueOf(0.0d));
this.plugin.saveAccountsConfig();
if (this.plugin.PlayerinJob(p, "Support")) {
//Give exp for doing so.
@ -1611,15 +1611,15 @@ 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() + ".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()));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".teletime", Double.valueOf(p.getPlayerTime()));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".teleplayer", String.valueOf(target.getName()));
} 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.");
}
@ -1640,15 +1640,15 @@ 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() + ".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()));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".teletime", Double.valueOf(p.getPlayerTime()));
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".teleplayer", String.valueOf(target.getName()));
} 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.");
}
@ -1706,7 +1706,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()+".jobs.job"+(slot+1)+"lv"));
} else {
Jobsinfo[i].sendOutput(p);
}
@ -1779,12 +1779,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()+".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()+".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()+".jobs.job"+(i+1)+"exp"))+"/"+Math.round(this.plugin.getJobExp(joblist[i], this.plugin.getAccountsConfig().getInt(p.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], p)>=10) {
@ -1848,6 +1848,9 @@ public String convertToItemName(String val) {
p.sendMessage(q.getName()+"'s jobs:");
String[] joblist=this.plugin.getJobs(q.getName());
for (int i=0;i<joblist.length;i++) {
if (joblist[i]!=null) {
Bukkit.getLogger().info("JobList "+i+": "+joblist[i]);
}
if (!joblist[i].equalsIgnoreCase("None")) {
int mylv=this.plugin.getAccountsConfig().getInt(q.getName()+".jobs.job"+(i+1)+"lv");
if (mylv==40) {

Loading…
Cancel
Save