Merge branch 'master' into dev
This commit is contained in:
commit
e05cdbe5cf
@ -24,6 +24,7 @@ import java.text.*;
|
||||
import me.kaZep.Commands.JobsDataInfo;
|
||||
import me.kaZep.Commands.JobsDataInfo.Job;
|
||||
import me.kaZep.Commands.commandBankEconomy;
|
||||
import net.jmhertlein.mctowns.MCTowns;
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
@ -67,6 +68,7 @@ import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.PlayerInventory;
|
||||
import org.bukkit.inventory.ShapedRecipe;
|
||||
import org.bukkit.inventory.meta.FireworkMeta;
|
||||
import org.bukkit.inventory.ShapelessRecipe;
|
||||
import org.bukkit.inventory.meta.FireworkMeta;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
@ -84,6 +86,7 @@ import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.bukkit.scheduler.BukkitScheduler;
|
||||
import org.bukkit.scoreboard.Team;
|
||||
import org.bukkit.util.Vector;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
|
||||
@ -223,6 +226,10 @@ public class Main extends JavaPlugin
|
||||
|
||||
cleaned=false;
|
||||
|
||||
if (Bukkit.getPluginManager().isPluginEnabled("MCTowns")) {
|
||||
Bukkit.getLogger().info("MCTowns loaded.");
|
||||
}
|
||||
|
||||
PluginDescriptionFile pdf = getDescription();
|
||||
System.out.println("[" + getDescription().getName() + "] Status: Activated (mb: kaZep)");
|
||||
System.out.println("[" + getDescription().getName() + "] PayDay: " + getConfig().getBoolean("payday.enabled"));
|
||||
@ -577,11 +584,11 @@ public class Main extends JavaPlugin
|
||||
Color.fromRGB(133, 184, 133),
|
||||
Color.fromRGB(133, 184, 159),
|
||||
Color.fromRGB(159, 184, 133)),
|
||||
"Thin and light armor made for" +
|
||||
"Thin and light armor made for\n" +
|
||||
"nimble and precise movement.",
|
||||
"When getting hit, you will gain" +
|
||||
"When getting hit, you will gain\n" +
|
||||
"40% movement speed.",
|
||||
"Every 20% of bonus movement speed" +
|
||||
"Every 20% of bonus movement speed\n" +
|
||||
"gives you 10% block chance.",
|
||||
"When jumping, you cannot be hit.");
|
||||
ItemSetList.addSet(set);
|
||||
@ -1064,6 +1071,7 @@ public class Main extends JavaPlugin
|
||||
|
||||
public void onDisable()
|
||||
{
|
||||
saveAccountsConfig();
|
||||
getConfig().set("server-tick-time", Long.valueOf(SERVER_TICK_TIME));
|
||||
saveConfig();
|
||||
saveAccountsConfig();
|
||||
@ -1078,31 +1086,31 @@ public void onDisable()
|
||||
//Get list of all players on the server.
|
||||
OfflinePlayer playerlist[] = Bukkit.getOfflinePlayers();
|
||||
for (int i=0;i<playerlist.length;i++) {
|
||||
if (getAccountsConfig().contains(playerlist[i].getName())) {
|
||||
if (getAccountsConfig().contains(playerlist[i].getName()+".spleefrating") && getAccountsConfig().getInt(playerlist[i].getName()+".spleefwins")+getAccountsConfig().getInt(playerlist[i].getName()+".spleeflosses")>=20) {
|
||||
if (getAccountsConfig().getDouble(playerlist[i].getName()+".spleefrating")>rating[0]) {
|
||||
if (getAccountsConfig().contains(playerlist[i].getName().toLowerCase())) {
|
||||
if (getAccountsConfig().contains(playerlist[i].getName().toLowerCase()+".spleefrating") && getAccountsConfig().getInt(playerlist[i].getName().toLowerCase()+".spleefwins")+getAccountsConfig().getInt(playerlist[i].getName().toLowerCase()+".spleeflosses")>=20) {
|
||||
if (getAccountsConfig().getDouble(playerlist[i].getName().toLowerCase()+".spleefrating")>rating[0]) {
|
||||
//This beats the top record, move everything down.
|
||||
name[2]=name[1];rating[2]=rating[1];wins[2]=wins[1];losses[2]=losses[1];
|
||||
name[1]=name[0];rating[1]=rating[0];wins[1]=wins[0];losses[1]=losses[0];
|
||||
name[0]=playerlist[i].getName();
|
||||
rating[0]=(int)getAccountsConfig().getDouble(playerlist[i].getName()+".spleefrating");
|
||||
wins[0]=getAccountsConfig().getInt(playerlist[i].getName()+".spleefwins");
|
||||
losses[0]=getAccountsConfig().getInt(playerlist[i].getName()+".spleeflosses");
|
||||
name[0]=playerlist[i].getName().toLowerCase();
|
||||
rating[0]=(int)getAccountsConfig().getDouble(playerlist[i].getName().toLowerCase()+".spleefrating");
|
||||
wins[0]=getAccountsConfig().getInt(playerlist[i].getName().toLowerCase()+".spleefwins");
|
||||
losses[0]=getAccountsConfig().getInt(playerlist[i].getName().toLowerCase()+".spleeflosses");
|
||||
} else
|
||||
if (getAccountsConfig().getDouble(playerlist[i].getName()+".spleefrating")>rating[1]) {
|
||||
if (getAccountsConfig().getDouble(playerlist[i].getName().toLowerCase()+".spleefrating")>rating[1]) {
|
||||
//This beats the 2nd record, move everything down.
|
||||
name[2]=name[1];rating[2]=rating[1];wins[2]=wins[1];losses[2]=losses[1];
|
||||
name[1]=playerlist[i].getName();
|
||||
rating[1]=(int)getAccountsConfig().getDouble(playerlist[i].getName()+".spleefrating");
|
||||
wins[1]=getAccountsConfig().getInt(playerlist[i].getName()+".spleefwins");
|
||||
losses[1]=getAccountsConfig().getInt(playerlist[i].getName()+".spleeflosses");
|
||||
name[1]=playerlist[i].getName().toLowerCase();
|
||||
rating[1]=(int)getAccountsConfig().getDouble(playerlist[i].getName().toLowerCase()+".spleefrating");
|
||||
wins[1]=getAccountsConfig().getInt(playerlist[i].getName().toLowerCase()+".spleefwins");
|
||||
losses[1]=getAccountsConfig().getInt(playerlist[i].getName().toLowerCase()+".spleeflosses");
|
||||
} else
|
||||
if (getAccountsConfig().getDouble(playerlist[i].getName()+".spleefrating")>rating[2]) {
|
||||
if (getAccountsConfig().getDouble(playerlist[i].getName().toLowerCase()+".spleefrating")>rating[2]) {
|
||||
//This beats the 3rd record, move everything down.
|
||||
name[2]=playerlist[i].getName();
|
||||
rating[2]=(int)getAccountsConfig().getDouble(playerlist[i].getName()+".spleefrating");
|
||||
wins[2]=getAccountsConfig().getInt(playerlist[i].getName()+".spleefwins");
|
||||
losses[2]=getAccountsConfig().getInt(playerlist[i].getName()+".spleeflosses");
|
||||
name[2]=playerlist[i].getName().toLowerCase();
|
||||
rating[2]=(int)getAccountsConfig().getDouble(playerlist[i].getName().toLowerCase()+".spleefrating");
|
||||
wins[2]=getAccountsConfig().getInt(playerlist[i].getName().toLowerCase()+".spleefwins");
|
||||
losses[2]=getAccountsConfig().getInt(playerlist[i].getName().toLowerCase()+".spleeflosses");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1312,7 +1320,7 @@ public void runTick() {
|
||||
Player p = Bukkit.getOnlinePlayers()[zx];
|
||||
//p.sendMessage("That's item slot #"+p.getInventory().getHeldItemSlot());
|
||||
/*
|
||||
if (p.getName().compareTo("sigonasr2")==0) {
|
||||
if (p.getName().toLowerCase().compareTo("sigonasr2")==0) {
|
||||
//Packet61WorldEvent packet = new Packet61WorldEvent(2004, p.getLocation().getBlockX(), p.getLocation().getBlockY(), p.getLocation().getBlockZ(), 0, false);
|
||||
|
||||
//((CraftPlayer)t).getHandle().netServerHandler.sendPacket(packet);
|
||||
@ -1424,7 +1432,6 @@ public void runTick() {
|
||||
}
|
||||
}
|
||||
if (nearbylist2.size()<5) {
|
||||
if (Math.random()<=0.2d) {
|
||||
int l=0;
|
||||
while (l<5) {
|
||||
//CreatureSpawner spawner = (CreatureSpawner)Bukkit.getWorld("world").getBlockAt(p.getLocation().getBlockX()+i,p.getLocation().getBlockY()+k,p.getLocation().getBlockZ()+j).getState();
|
||||
@ -1436,7 +1443,6 @@ public void runTick() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Math.abs(i)<4 && Math.abs(j)<4 && Math.abs(k)<4 &&Bukkit.getWorld("world").getBlockAt(p.getLocation().getBlockX()+i,p.getLocation().getBlockY()+k,p.getLocation().getBlockZ()+j).getType()==Material.COMMAND) {
|
||||
//Bukkit.getWorld("world").getBlockAt(p.getLocation().getBlockX()+i,p.getLocation().getBlockY()+k,p.getLocation().getBlockZ()+j).setType(Material.COBBLESTONE);
|
||||
List<Entity> nearby = p.getNearbyEntities(30, 30, 30);
|
||||
@ -2089,7 +2095,7 @@ public void runTick() {
|
||||
}
|
||||
}
|
||||
if (Main.SERVER_TICK_TIME%600==0) {
|
||||
saveAccountsConfig();
|
||||
saveAccountsConfig(); //Save account data once every 30 seconds.
|
||||
if (turnedon==false && Bukkit.getWorld("world").getTime()>13000) {
|
||||
//Bukkit.getPlayer("sigonasr2").sendMessage("It's night now...");
|
||||
turnedon=true;
|
||||
@ -2123,7 +2129,7 @@ public void runTick() {
|
||||
if (getConfig().getBoolean("spleef4insession")) {
|
||||
//Check to see if we fall off.
|
||||
if ((p.getLocation().getX()<1585 || p.getLocation().getX()>1600 || p.getLocation().getZ()<24 || p.getLocation().getZ()>39 || p.getLocation().getY()<86.5d) && (
|
||||
(p.getName().compareTo(getConfig().getString("spleefrequesta4player"))==0 || p.getName().compareTo(getConfig().getString("spleefrequestb4player"))==0
|
||||
(p.getName().toLowerCase().compareTo(getConfig().getString("spleefrequesta4player"))==0 || p.getName().compareTo(getConfig().getString("spleefrequestb4player"))==0
|
||||
|| p.getName().compareTo(getConfig().getString("spleefrequestc4player"))==0 || p.getName().compareTo(getConfig().getString("spleefrequestd4player"))==0))) {
|
||||
//You lose.
|
||||
//See if we're the winner.
|
||||
@ -2134,7 +2140,7 @@ public void runTick() {
|
||||
if (getConfig().getString("spleefrequesta4player").compareTo("none")==0) {
|
||||
countdead++;
|
||||
} else {
|
||||
if (getConfig().getString("spleefrequesta4player").compareTo(p.getName())==0) {
|
||||
if (getConfig().getString("spleefrequesta4player").compareTo(p.getName().toLowerCase())==0) {
|
||||
losingplayer=Bukkit.getPlayer(getConfig().getString("spleefrequesta4player"));
|
||||
} else {
|
||||
winningplayer=Bukkit.getPlayer(getConfig().getString("spleefrequesta4player"));
|
||||
@ -2143,7 +2149,7 @@ public void runTick() {
|
||||
if (getConfig().getString("spleefrequestb4player").compareTo("none")==0) {
|
||||
countdead++;
|
||||
} else {
|
||||
if (getConfig().getString("spleefrequestb4player").compareTo(p.getName())==0) {
|
||||
if (getConfig().getString("spleefrequestb4player").compareTo(p.getName().toLowerCase())==0) {
|
||||
losingplayer=Bukkit.getPlayer(getConfig().getString("spleefrequestb4player"));
|
||||
} else {
|
||||
winningplayer=Bukkit.getPlayer(getConfig().getString("spleefrequestb4player"));
|
||||
@ -2152,7 +2158,7 @@ public void runTick() {
|
||||
if (getConfig().getString("spleefrequestc4player").compareTo("none")==0) {
|
||||
countdead++;
|
||||
} else {
|
||||
if (getConfig().getString("spleefrequestc4player").compareTo(p.getName())==0) {
|
||||
if (getConfig().getString("spleefrequestc4player").compareTo(p.getName().toLowerCase())==0) {
|
||||
losingplayer=Bukkit.getPlayer(getConfig().getString("spleefrequestc4player"));
|
||||
} else {
|
||||
winningplayer=Bukkit.getPlayer(getConfig().getString("spleefrequestc4player"));
|
||||
@ -2161,7 +2167,7 @@ public void runTick() {
|
||||
if (getConfig().getString("spleefrequestd4player").compareTo("none")==0) {
|
||||
countdead++;
|
||||
} else {
|
||||
if (getConfig().getString("spleefrequestd4player").compareTo(p.getName())==0) {
|
||||
if (getConfig().getString("spleefrequestd4player").compareTo(p.getName().toLowerCase())==0) {
|
||||
losingplayer=Bukkit.getPlayer(getConfig().getString("spleefrequestd4player"));
|
||||
} else {
|
||||
winningplayer=Bukkit.getPlayer(getConfig().getString("spleefrequestd4player"));
|
||||
@ -2200,7 +2206,7 @@ public void runTick() {
|
||||
p.getInventory().clear();
|
||||
p.getInventory().clear(p.getInventory().getHeldItemSlot());
|
||||
//Give inventories back.
|
||||
if (getConfig().getString("spleefrequesta4player").compareTo(p.getName())==0) {
|
||||
if (getConfig().getString("spleefrequesta4player").compareTo(p.getName().toLowerCase())==0) {
|
||||
for (int i=0;i<spleef4_inventory_a.length;i++) {
|
||||
if (spleef4_inventory_a[i]!=null) {
|
||||
p.getInventory().addItem(spleef4_inventory_a[i]);
|
||||
@ -2208,7 +2214,7 @@ public void runTick() {
|
||||
}
|
||||
getConfig().set("spleefrequesta4player",String.valueOf("none"));
|
||||
} else
|
||||
if (getConfig().getString("spleefrequestb4player").compareTo(p.getName())==0) {
|
||||
if (getConfig().getString("spleefrequestb4player").compareTo(p.getName().toLowerCase())==0) {
|
||||
for (int i=0;i<spleef4_inventory_b.length;i++) {
|
||||
if (spleef4_inventory_b[i]!=null) {
|
||||
p.getInventory().addItem(spleef4_inventory_b[i]);
|
||||
@ -2216,7 +2222,7 @@ public void runTick() {
|
||||
}
|
||||
getConfig().set("spleefrequestb4player",String.valueOf("none"));
|
||||
} else
|
||||
if (getConfig().getString("spleefrequestc4player").compareTo(p.getName())==0) {
|
||||
if (getConfig().getString("spleefrequestc4player").compareTo(p.getName().toLowerCase())==0) {
|
||||
for (int i=0;i<spleef4_inventory_c.length;i++) {
|
||||
if (spleef4_inventory_c[i]!=null) {
|
||||
p.getInventory().addItem(spleef4_inventory_c[i]);
|
||||
@ -2224,7 +2230,7 @@ public void runTick() {
|
||||
}
|
||||
getConfig().set("spleefrequestc4player",String.valueOf("none"));
|
||||
} else
|
||||
if (getConfig().getString("spleefrequestd4player").compareTo(p.getName())==0) {
|
||||
if (getConfig().getString("spleefrequestd4player").compareTo(p.getName().toLowerCase())==0) {
|
||||
for (int i=0;i<spleef4_inventory_d.length;i++) {
|
||||
if (spleef4_inventory_d[i]!=null) {
|
||||
p.getInventory().addItem(spleef4_inventory_d[i]);
|
||||
@ -2258,7 +2264,7 @@ public void runTick() {
|
||||
winningplayer.getInventory().clear();
|
||||
winningplayer.getInventory().clear(winningplayer.getInventory().getHeldItemSlot());
|
||||
//Give inventories back.
|
||||
if (getConfig().getString("spleefrequesta4player").compareTo(winningplayer.getName())==0) {
|
||||
if (getConfig().getString("spleefrequesta4player").compareTo(winningplayer.getName().toLowerCase())==0) {
|
||||
for (int i=0;i<spleef4_inventory_a.length;i++) {
|
||||
if (spleef4_inventory_a[i]!=null) {
|
||||
winningplayer.getInventory().addItem(spleef4_inventory_a[i]);
|
||||
@ -2266,7 +2272,7 @@ public void runTick() {
|
||||
}
|
||||
getConfig().set("spleefrequesta4player",String.valueOf("none"));
|
||||
} else
|
||||
if (getConfig().getString("spleefrequestb4player").compareTo(winningplayer.getName())==0) {
|
||||
if (getConfig().getString("spleefrequestb4player").compareTo(winningplayer.getName().toLowerCase())==0) {
|
||||
for (int i=0;i<spleef4_inventory_b.length;i++) {
|
||||
if (spleef4_inventory_b[i]!=null) {
|
||||
winningplayer.getInventory().addItem(spleef4_inventory_b[i]);
|
||||
@ -2274,7 +2280,7 @@ public void runTick() {
|
||||
}
|
||||
getConfig().set("spleefrequestb4player",String.valueOf("none"));
|
||||
} else
|
||||
if (getConfig().getString("spleefrequestc4player").compareTo(winningplayer.getName())==0) {
|
||||
if (getConfig().getString("spleefrequestc4player").compareTo(winningplayer.getName().toLowerCase())==0) {
|
||||
for (int i=0;i<spleef4_inventory_c.length;i++) {
|
||||
if (spleef4_inventory_c[i]!=null) {
|
||||
winningplayer.getInventory().addItem(spleef4_inventory_c[i]);
|
||||
@ -2282,7 +2288,7 @@ public void runTick() {
|
||||
}
|
||||
getConfig().set("spleefrequestc4player",String.valueOf("none"));
|
||||
} else
|
||||
if (getConfig().getString("spleefrequestd4player").compareTo(winningplayer.getName())==0) {
|
||||
if (getConfig().getString("spleefrequestd4player").compareTo(winningplayer.getName().toLowerCase())==0) {
|
||||
for (int i=0;i<spleef4_inventory_d.length;i++) {
|
||||
if (spleef4_inventory_d[i]!=null) {
|
||||
winningplayer.getInventory().addItem(spleef4_inventory_d[i]);
|
||||
@ -2332,7 +2338,7 @@ public void runTick() {
|
||||
c.getBlockInventory().setItem((int)(Math.random()*27.0d), store_shovel);
|
||||
}
|
||||
*/
|
||||
Bukkit.broadcastMessage(ChatColor.RED+"[SPLEEF] "+ChatColor.YELLOW+winningplayer.getName()+"["+(int)getAccountsConfig().getDouble(winningplayer.getName()+".spleefrating")/10+"] is the winner of this 4-player spleef game!");
|
||||
Bukkit.broadcastMessage(ChatColor.RED+"[SPLEEF] "+ChatColor.YELLOW+winningplayer.getName().toLowerCase()+"["+(int)getAccountsConfig().getDouble(winningplayer.getName().toLowerCase().toLowerCase()+".spleefrating")/10+"] is the winner of this 4-player spleef game!");
|
||||
getConfig().set("spleeflastrequesttime",Double.valueOf(0.0d));
|
||||
getConfig().set("spleefrequesta4player", String.valueOf("none"));
|
||||
getConfig().set("spleefrequestb4player", String.valueOf("none"));
|
||||
@ -2365,7 +2371,7 @@ public void runTick() {
|
||||
p.getInventory().clear();
|
||||
p.getInventory().clear(p.getInventory().getHeldItemSlot());
|
||||
//Give inventories back.
|
||||
if (getConfig().getString("spleefrequesta4player").compareTo(p.getName())==0) {
|
||||
if (getConfig().getString("spleefrequesta4player").compareTo(p.getName().toLowerCase())==0) {
|
||||
for (int i=0;i<spleef4_inventory_a.length;i++) {
|
||||
if (spleef4_inventory_a[i]!=null) {
|
||||
p.getInventory().addItem(spleef4_inventory_a[i]);
|
||||
@ -2373,7 +2379,7 @@ public void runTick() {
|
||||
}
|
||||
getConfig().set("spleefrequesta4player",String.valueOf("none"));
|
||||
} else
|
||||
if (getConfig().getString("spleefrequestb4player").compareTo(p.getName())==0) {
|
||||
if (getConfig().getString("spleefrequestb4player").compareTo(p.getName().toLowerCase())==0) {
|
||||
for (int i=0;i<spleef4_inventory_b.length;i++) {
|
||||
if (spleef4_inventory_b[i]!=null) {
|
||||
p.getInventory().addItem(spleef4_inventory_b[i]);
|
||||
@ -2381,7 +2387,7 @@ public void runTick() {
|
||||
}
|
||||
getConfig().set("spleefrequestb4player",String.valueOf("none"));
|
||||
} else
|
||||
if (getConfig().getString("spleefrequestc4player").compareTo(p.getName())==0) {
|
||||
if (getConfig().getString("spleefrequestc4player").compareTo(p.getName().toLowerCase())==0) {
|
||||
for (int i=0;i<spleef4_inventory_c.length;i++) {
|
||||
if (spleef4_inventory_c[i]!=null) {
|
||||
p.getInventory().addItem(spleef4_inventory_c[i]);
|
||||
@ -2389,7 +2395,7 @@ public void runTick() {
|
||||
}
|
||||
getConfig().set("spleefrequestc4player",String.valueOf("none"));
|
||||
} else
|
||||
if (getConfig().getString("spleefrequestd4player").compareTo(p.getName())==0) {
|
||||
if (getConfig().getString("spleefrequestd4player").compareTo(p.getName().toLowerCase())==0) {
|
||||
for (int i=0;i<spleef4_inventory_d.length;i++) {
|
||||
if (spleef4_inventory_d[i]!=null) {
|
||||
p.getInventory().addItem(spleef4_inventory_d[i]);
|
||||
@ -2402,10 +2408,10 @@ public void runTick() {
|
||||
}
|
||||
}
|
||||
//Check to see if we are a player in spleef.
|
||||
if (getConfig().getString("spleefrequesta4player").compareTo(p.getName())==0 ||
|
||||
getConfig().getString("spleefrequestb4player").compareTo(p.getName())==0 ||
|
||||
getConfig().getString("spleefrequestc4player").compareTo(p.getName())==0 ||
|
||||
getConfig().getString("spleefrequestd4player").compareTo(p.getName())==0) {
|
||||
if (getConfig().getString("spleefrequesta4player").compareTo(p.getName().toLowerCase())==0 ||
|
||||
getConfig().getString("spleefrequestb4player").compareTo(p.getName().toLowerCase())==0 ||
|
||||
getConfig().getString("spleefrequestc4player").compareTo(p.getName().toLowerCase())==0 ||
|
||||
getConfig().getString("spleefrequestd4player").compareTo(p.getName().toLowerCase())==0) {
|
||||
//If they are holding something, remove it.
|
||||
if (p.getItemInHand()!=null) {
|
||||
p.getInventory().remove(p.getInventory().getHeldItemSlot());
|
||||
@ -2413,11 +2419,11 @@ public void runTick() {
|
||||
}
|
||||
}
|
||||
|
||||
if (getConfig().getBoolean("spleefinsession") && (p.getName().compareTo(getConfig().getString("spleefrequestaplayer"))==0 || p.getName().compareTo(getConfig().getString("spleefrequestbplayer"))==0)) {
|
||||
if (getConfig().getBoolean("spleefinsession") && (p.getName().toLowerCase().compareTo(getConfig().getString("spleefrequestaplayer"))==0 || p.getName().compareTo(getConfig().getString("spleefrequestbplayer"))==0)) {
|
||||
//Determine if we're still playing.
|
||||
int blockwinner=0;
|
||||
if (getConfig().getString("spleefrequestaplayer").compareTo(p.getName())==0 ||
|
||||
getConfig().getString("spleefrequestbplayer").compareTo(p.getName())==0) {
|
||||
if (getConfig().getString("spleefrequestaplayer").compareTo(p.getName().toLowerCase())==0 ||
|
||||
getConfig().getString("spleefrequestbplayer").compareTo(p.getName().toLowerCase())==0) {
|
||||
//If they are holding something, remove it.
|
||||
if (p.getItemInHand()!=null) {
|
||||
p.getInventory().remove(p.getInventory().getHeldItemSlot());
|
||||
@ -2452,48 +2458,48 @@ public void runTick() {
|
||||
getConfig().set("spleefinsession", Boolean.valueOf(false));
|
||||
//Find out if we're player A, or player B.
|
||||
Player winningplayer,losingplayer;
|
||||
if (p.getName().compareTo(getConfig().getString("spleefrequestaplayer"))==0 || blockwinner==2) {
|
||||
if (p.getName().toLowerCase().compareTo(getConfig().getString("spleefrequestaplayer"))==0 || blockwinner==2) {
|
||||
//We're player A.
|
||||
//Bukkit.broadcastMessage(ChatColor.RED+"[SPLEEF] "+ChatColor.YELLOW+getConfig().getString("spleefrequestbplayer")+" is the winner of this spleef game! "+getConfig().getString("spleefrequestaplayer")+" loses.");
|
||||
losingplayer=p;
|
||||
winningplayer=Bukkit.getPlayer(getConfig().getString("spleefrequestbplayer"));
|
||||
|
||||
double val1,val2,value,newval1,newval2;
|
||||
if (getAccountsConfig().contains(winningplayer.getName()+".spleefrating")) {
|
||||
val1 = getAccountsConfig().getDouble(winningplayer.getName()+".spleefrating");
|
||||
if (getAccountsConfig().contains(winningplayer.getName().toLowerCase()+".spleefrating")) {
|
||||
val1 = getAccountsConfig().getDouble(winningplayer.getName().toLowerCase()+".spleefrating");
|
||||
} else {
|
||||
val1 = 1000.0d;
|
||||
}
|
||||
if (getAccountsConfig().contains(losingplayer.getName()+".spleefrating")) {
|
||||
val2 = getAccountsConfig().getDouble(losingplayer.getName()+".spleefrating");
|
||||
if (getAccountsConfig().contains(losingplayer.getName().toLowerCase()+".spleefrating")) {
|
||||
val2 = getAccountsConfig().getDouble(losingplayer.getName().toLowerCase()+".spleefrating");
|
||||
} else {
|
||||
val2 = 1000.0d;
|
||||
}
|
||||
value = 1.0d/(1.0d+Math.pow(10.0d, ((val2-val1)/400.0d)));
|
||||
if (getAccountsConfig().contains(winningplayer.getName()+".spleefwins")) {
|
||||
getAccountsConfig().set(winningplayer.getName()+".spleefwins", Integer.valueOf(getAccountsConfig().getInt(winningplayer.getName()+".spleefwins")+1));
|
||||
if (getAccountsConfig().contains(winningplayer.getName().toLowerCase()+".spleefwins")) {
|
||||
getAccountsConfig().set(winningplayer.getName().toLowerCase()+".spleefwins", Integer.valueOf(getAccountsConfig().getInt(winningplayer.getName().toLowerCase()+".spleefwins")+1));
|
||||
} else {
|
||||
getAccountsConfig().set(winningplayer.getName()+".spleefwins", Integer.valueOf(1));
|
||||
getAccountsConfig().set(winningplayer.getName().toLowerCase()+".spleefwins", Integer.valueOf(1));
|
||||
}
|
||||
if (getAccountsConfig().contains(winningplayer.getName()+".spleeflosses")) {
|
||||
getAccountsConfig().set(winningplayer.getName()+".spleeflosses", Integer.valueOf(getAccountsConfig().getInt(winningplayer.getName()+".spleeflosses")));
|
||||
if (getAccountsConfig().contains(winningplayer.getName().toLowerCase()+".spleeflosses")) {
|
||||
getAccountsConfig().set(winningplayer.getName().toLowerCase()+".spleeflosses", Integer.valueOf(getAccountsConfig().getInt(winningplayer.getName().toLowerCase()+".spleeflosses")));
|
||||
} else {
|
||||
getAccountsConfig().set(winningplayer.getName()+".spleeflosses", Integer.valueOf(0));
|
||||
getAccountsConfig().set(winningplayer.getName().toLowerCase()+".spleeflosses", Integer.valueOf(0));
|
||||
}
|
||||
if (getAccountsConfig().contains(losingplayer.getName()+".spleefwins")) {
|
||||
getAccountsConfig().set(losingplayer.getName()+".spleefwins", Integer.valueOf(getAccountsConfig().getInt(losingplayer.getName()+".spleefwins")));
|
||||
if (getAccountsConfig().contains(losingplayer.getName().toLowerCase()+".spleefwins")) {
|
||||
getAccountsConfig().set(losingplayer.getName().toLowerCase()+".spleefwins", Integer.valueOf(getAccountsConfig().getInt(losingplayer.getName().toLowerCase()+".spleefwins")));
|
||||
} else {
|
||||
getAccountsConfig().set(losingplayer.getName()+".spleefwins", Integer.valueOf(0));
|
||||
getAccountsConfig().set(losingplayer.getName().toLowerCase()+".spleefwins", Integer.valueOf(0));
|
||||
}
|
||||
if (getAccountsConfig().contains(losingplayer.getName()+".spleeflosses")) {
|
||||
getAccountsConfig().set(losingplayer.getName()+".spleeflosses", Integer.valueOf(getAccountsConfig().getInt(losingplayer.getName()+".spleeflosses")+1));
|
||||
if (getAccountsConfig().contains(losingplayer.getName().toLowerCase()+".spleeflosses")) {
|
||||
getAccountsConfig().set(losingplayer.getName().toLowerCase()+".spleeflosses", Integer.valueOf(getAccountsConfig().getInt(losingplayer.getName().toLowerCase()+".spleeflosses")+1));
|
||||
} else {
|
||||
getAccountsConfig().set(losingplayer.getName()+".spleeflosses", Integer.valueOf(1));
|
||||
getAccountsConfig().set(losingplayer.getName().toLowerCase()+".spleeflosses", Integer.valueOf(1));
|
||||
}
|
||||
newval1 = (val1+Math.round(((50.0d/((getAccountsConfig().getDouble(winningplayer.getName()+".spleefwins")+getAccountsConfig().getDouble(winningplayer.getName()+".spleeflosses"))/20.0d))*(1.0d-value))));
|
||||
newval2 = (val2+Math.round(((50.0d/((getAccountsConfig().getDouble(losingplayer.getName()+".spleefwins")+getAccountsConfig().getDouble(losingplayer.getName()+".spleeflosses"))/20.0d))*(0.0d-value))));
|
||||
getAccountsConfig().set(winningplayer.getName()+".spleefrating",Double.valueOf(newval1));
|
||||
getAccountsConfig().set(losingplayer.getName()+".spleefrating",Double.valueOf(newval2));
|
||||
newval1 = (val1+Math.round(((50.0d/((getAccountsConfig().getDouble(winningplayer.getName().toLowerCase()+".spleefwins")+getAccountsConfig().getDouble(winningplayer.getName().toLowerCase()+".spleeflosses"))/20.0d))*(1.0d-value))));
|
||||
newval2 = (val2+Math.round(((50.0d/((getAccountsConfig().getDouble(losingplayer.getName().toLowerCase()+".spleefwins")+getAccountsConfig().getDouble(losingplayer.getName().toLowerCase()+".spleeflosses"))/20.0d))*(0.0d-value))));
|
||||
getAccountsConfig().set(winningplayer.getName().toLowerCase()+".spleefrating",Double.valueOf(newval1));
|
||||
getAccountsConfig().set(losingplayer.getName().toLowerCase()+".spleefrating",Double.valueOf(newval2));
|
||||
Location newloc = winningplayer.getLocation();
|
||||
|
||||
Bukkit.broadcastMessage(ChatColor.RED+"[SPLEEF] "+ChatColor.YELLOW+getConfig().getString("spleefrequestbplayer")+"["+(int)newval1/10+"] is the winner of this spleef game! "+getConfig().getString("spleefrequestaplayer")+"["+(int)newval2/10+"] loses.");
|
||||
@ -2509,41 +2515,41 @@ public void runTick() {
|
||||
losingplayer=p;
|
||||
winningplayer=Bukkit.getPlayer(getConfig().getString("spleefrequestaplayer"));
|
||||
double val1,val2,value,newval1,newval2;
|
||||
if (getAccountsConfig().contains(winningplayer.getName()+".spleefrating")) {
|
||||
val1 = getAccountsConfig().getDouble(winningplayer.getName()+".spleefrating");
|
||||
if (getAccountsConfig().contains(winningplayer.getName().toLowerCase()+".spleefrating")) {
|
||||
val1 = getAccountsConfig().getDouble(winningplayer.getName().toLowerCase()+".spleefrating");
|
||||
} else {
|
||||
val1 = 1000.0d;
|
||||
}
|
||||
if (getAccountsConfig().contains(losingplayer.getName()+".spleefrating")) {
|
||||
val2 = getAccountsConfig().getDouble(losingplayer.getName()+".spleefrating");
|
||||
if (getAccountsConfig().contains(losingplayer.getName().toLowerCase()+".spleefrating")) {
|
||||
val2 = getAccountsConfig().getDouble(losingplayer.getName().toLowerCase()+".spleefrating");
|
||||
} else {
|
||||
val2 = 1000.0d;
|
||||
}
|
||||
value = 1.0d/(1.0d+Math.pow(10.0d, ((val2-val1)/400.0d)));
|
||||
if (getAccountsConfig().contains(winningplayer.getName()+".spleefwins")) {
|
||||
getAccountsConfig().set(winningplayer.getName()+".spleefwins", Integer.valueOf(getAccountsConfig().getInt(winningplayer.getName()+".spleefwins")+1));
|
||||
if (getAccountsConfig().contains(winningplayer.getName().toLowerCase()+".spleefwins")) {
|
||||
getAccountsConfig().set(winningplayer.getName().toLowerCase()+".spleefwins", Integer.valueOf(getAccountsConfig().getInt(winningplayer.getName().toLowerCase()+".spleefwins")+1));
|
||||
} else {
|
||||
getAccountsConfig().set(winningplayer.getName()+".spleefwins", Integer.valueOf(1));
|
||||
getAccountsConfig().set(winningplayer.getName().toLowerCase()+".spleefwins", Integer.valueOf(1));
|
||||
}
|
||||
if (getAccountsConfig().contains(winningplayer.getName()+".spleeflosses")) {
|
||||
getAccountsConfig().set(winningplayer.getName()+".spleeflosses", Integer.valueOf(getAccountsConfig().getInt(winningplayer.getName()+".spleeflosses")));
|
||||
if (getAccountsConfig().contains(winningplayer.getName().toLowerCase()+".spleeflosses")) {
|
||||
getAccountsConfig().set(winningplayer.getName().toLowerCase()+".spleeflosses", Integer.valueOf(getAccountsConfig().getInt(winningplayer.getName().toLowerCase()+".spleeflosses")));
|
||||
} else {
|
||||
getAccountsConfig().set(winningplayer.getName()+".spleeflosses", Integer.valueOf(0));
|
||||
getAccountsConfig().set(winningplayer.getName().toLowerCase()+".spleeflosses", Integer.valueOf(0));
|
||||
}
|
||||
if (getAccountsConfig().contains(losingplayer.getName()+".spleefwins")) {
|
||||
getAccountsConfig().set(losingplayer.getName()+".spleefwins", Integer.valueOf(getAccountsConfig().getInt(losingplayer.getName()+".spleefwins")));
|
||||
if (getAccountsConfig().contains(losingplayer.getName().toLowerCase()+".spleefwins")) {
|
||||
getAccountsConfig().set(losingplayer.getName().toLowerCase()+".spleefwins", Integer.valueOf(getAccountsConfig().getInt(losingplayer.getName().toLowerCase()+".spleefwins")));
|
||||
} else {
|
||||
getAccountsConfig().set(losingplayer.getName()+".spleefwins", Integer.valueOf(0));
|
||||
getAccountsConfig().set(losingplayer.getName().toLowerCase()+".spleefwins", Integer.valueOf(0));
|
||||
}
|
||||
if (getAccountsConfig().contains(losingplayer.getName()+".spleeflosses")) {
|
||||
getAccountsConfig().set(losingplayer.getName()+".spleeflosses", Integer.valueOf(getAccountsConfig().getInt(losingplayer.getName()+".spleeflosses")+1));
|
||||
if (getAccountsConfig().contains(losingplayer.getName().toLowerCase()+".spleeflosses")) {
|
||||
getAccountsConfig().set(losingplayer.getName().toLowerCase()+".spleeflosses", Integer.valueOf(getAccountsConfig().getInt(losingplayer.getName().toLowerCase()+".spleeflosses")+1));
|
||||
} else {
|
||||
getAccountsConfig().set(losingplayer.getName()+".spleeflosses", Integer.valueOf(1));
|
||||
getAccountsConfig().set(losingplayer.getName().toLowerCase()+".spleeflosses", Integer.valueOf(1));
|
||||
}
|
||||
newval1 = ((val1+Math.round((50.0d/((getAccountsConfig().getDouble(winningplayer.getName()+".spleefwins")+getAccountsConfig().getDouble(winningplayer.getName()+".spleeflosses"))/20.0d))*(1.0d-value))));
|
||||
newval2 = ((val2+Math.round((50.0d/((getAccountsConfig().getDouble(losingplayer.getName()+".spleefwins")+getAccountsConfig().getDouble(losingplayer.getName()+".spleeflosses"))/20.0d))*(0.0d-value))));
|
||||
getAccountsConfig().set(winningplayer.getName()+".spleefrating",Double.valueOf(newval1));
|
||||
getAccountsConfig().set(losingplayer.getName()+".spleefrating",Double.valueOf(newval2));
|
||||
newval1 = ((val1+Math.round((50.0d/((getAccountsConfig().getDouble(winningplayer.getName().toLowerCase()+".spleefwins")+getAccountsConfig().getDouble(winningplayer.getName().toLowerCase()+".spleeflosses"))/20.0d))*(1.0d-value))));
|
||||
newval2 = ((val2+Math.round((50.0d/((getAccountsConfig().getDouble(losingplayer.getName().toLowerCase()+".spleefwins")+getAccountsConfig().getDouble(losingplayer.getName().toLowerCase()+".spleeflosses"))/20.0d))*(0.0d-value))));
|
||||
getAccountsConfig().set(winningplayer.getName().toLowerCase()+".spleefrating",Double.valueOf(newval1));
|
||||
getAccountsConfig().set(losingplayer.getName().toLowerCase()+".spleefrating",Double.valueOf(newval2));
|
||||
Location newloc = winningplayer.getLocation();
|
||||
|
||||
Bukkit.broadcastMessage(ChatColor.RED+"[SPLEEF] "+ChatColor.YELLOW+getConfig().getString("spleefrequestaplayer")+"["+(int)newval1/10+"] is the winner of this spleef game! "+getConfig().getString("spleefrequestbplayer")+"["+(int)newval2/10+"] loses.");
|
||||
@ -2607,7 +2613,7 @@ public void runTick() {
|
||||
//Bukkit.getPlayer(getConfig().getString("spleefrequestbplayer")).updateInventory();
|
||||
}
|
||||
} else {
|
||||
if (getConfig().getBoolean("spleefinsession") && (p.getName().compareTo(getConfig().getString("spleefrequestaplayer"))!=0 && p.getName().compareTo(getConfig().getString("spleefrequestbplayer"))!=0)) {
|
||||
if (getConfig().getBoolean("spleefinsession") && (p.getName().toLowerCase().compareTo(getConfig().getString("spleefrequestaplayer"))!=0 && p.getName().compareTo(getConfig().getString("spleefrequestbplayer"))!=0)) {
|
||||
if (p.getLocation().getY()>78.0d && p.getLocation().getZ()>53.0d && p.getLocation().getZ()<64.0d && p.getLocation().getX()<1627.0d && p.getLocation().getX()>1616.0d) {
|
||||
Location newloc = p.getLocation();
|
||||
newloc.setX(1622.5d);
|
||||
@ -2625,7 +2631,7 @@ public void runTick() {
|
||||
}
|
||||
|
||||
public String healthbar(double curHP,double maxHP) {
|
||||
//笆<EFBFBD>笆<EFBFBD>
|
||||
//隨<EFBFBD>ソス隨<EFBFBD>ソス
|
||||
int bits=(int)(Math.ceil(curHP/maxHP*10));
|
||||
String bar=" ";
|
||||
if (bits>6) {
|
||||
@ -2647,7 +2653,7 @@ public String healthbar(double curHP,double maxHP) {
|
||||
}
|
||||
|
||||
public String healthbar(double curHP,double maxHP,int hunger) {
|
||||
//笆<EFBFBD>笆<EFBFBD>
|
||||
//隨<EFBFBD>ソス隨<EFBFBD>ソス
|
||||
int bits=(int)(Math.ceil(curHP/maxHP*10));
|
||||
String bar=" ";
|
||||
if (hunger>=17) {
|
||||
@ -2705,7 +2711,7 @@ public void checkJukeboxes() {
|
||||
Player p = Bukkit.getPlayer(explorers.get(i).name);
|
||||
if (explorers.get(i).event==1 && Bukkit.getPlayer(explorers.get(i).name)!=null && !Bukkit.getPlayer(explorers.get(i).name).isDead()) {
|
||||
if (getJobLv("Explorer", p)>=10) {
|
||||
PersistentExplorerList eve = new PersistentExplorerList(p.getName());
|
||||
PersistentExplorerList eve = new PersistentExplorerList(p.getName().toLowerCase());
|
||||
eve.event=1;
|
||||
eve.data=p.getExp();
|
||||
eve.data2=p.getLevel();
|
||||
@ -2713,12 +2719,12 @@ public void checkJukeboxes() {
|
||||
explorers.add(eve);
|
||||
}
|
||||
}
|
||||
if (explorers.get(i).event==1 && explorers.get(i).name.compareTo(p.getName())==0) {
|
||||
if (explorers.get(i).event==1 && explorers.get(i).name.compareTo(p.getName().toLowerCase())==0) {
|
||||
exppoint=i;
|
||||
//p.setTotalExperience(p.getTotalExperience()+explorers.get(j).data);
|
||||
//p.sendMessage("Your experience: "+explorers.get(i).data+"/"+p.getTotalExperience());
|
||||
} else
|
||||
if (explorers.get(i).event==2 && explorers.get(i).name.compareTo(p.getName())==0) {
|
||||
if (explorers.get(i).event==2 && explorers.get(i).name.compareTo(p.getName().toLowerCase())==0) {
|
||||
deadpoint=i;
|
||||
}
|
||||
if (exppoint!=-1 && deadpoint!=-1) {
|
||||
@ -2965,7 +2971,13 @@ public void checkJukeboxes() {
|
||||
}
|
||||
}
|
||||
}
|
||||
list[i].getScoreboard().getTeam(list[i].getName()).setSuffix(healthbar(list[i].getHealth(),list[i].getMaxHealth(),list[i].getFoodLevel()));
|
||||
list[i].getScoreboard().getTeam(list[i].getName().toLowerCase()).setSuffix(healthbar(list[i].getHealth(),list[i].getMaxHealth(),list[i].getFoodLevel()));
|
||||
|
||||
/* Team t = list[i].getScoreboard().getTeam(list[i].getName());
|
||||
double hp = list[i].getHealth();
|
||||
double maxhp = list[i].getMaxHealth();
|
||||
int food = list[i].getFoodLevel();
|
||||
t.setSuffix(healthbar(hp, maxhp, food)); */
|
||||
}
|
||||
LOGGING_UPDATE_COUNTS++; //3
|
||||
for (int i=0;i<supportmoblist.size();i++) {
|
||||
@ -3425,16 +3437,16 @@ public void payDay(int time)
|
||||
allOnlineP.sendMessage(ChatColor.DARK_GREEN+"<=========["+ChatColor.LIGHT_PURPLE+"Interest"+ChatColor.DARK_GREEN+"]=========>");
|
||||
DecimalFormat df = new DecimalFormat("#0.00");
|
||||
allOnlineP.sendMessage(ChatColor.GOLD+"The money interest has been delivered to all players. ("+df.format((double)(Main.this.getConfig().getDouble("payday.amount")*100))+"% interest rate)");
|
||||
allOnlineP.sendMessage(ChatColor.GOLD+"Your Balance: $"+df.format((getAccountsConfig().getDouble(allOnlineP.getName() + ".money")))+" -> $"+df.format(((Main.this.getConfig().getDouble("payday.amount")*(getAccountsConfig().getDouble(allOnlineP.getName() + ".money"))+getAccountsConfig().getDouble(allOnlineP.getName() + ".money")))));
|
||||
allOnlineP.sendMessage(ChatColor.GOLD+"Your Balance: $"+df.format((getAccountsConfig().getDouble(allOnlineP.getName().toLowerCase() + ".money")))+" -> $"+df.format(((Main.this.getConfig().getDouble("payday.amount")*(getAccountsConfig().getDouble(allOnlineP.getName().toLowerCase() + ".money"))+getAccountsConfig().getDouble(allOnlineP.getName().toLowerCase() + ".money")))));
|
||||
allOnlineP.sendMessage(ChatColor.DARK_GREEN+"<==========================>");
|
||||
getAccountsConfig().set(allOnlineP.getName() + ".money", ((Main.this.getConfig().getDouble("payday.amount")*(getAccountsConfig().getDouble(allOnlineP.getName() + ".money"))+getAccountsConfig().getDouble(allOnlineP.getName() + ".money"))));
|
||||
//Main.economy.depositPlayer(allOnlineP.getName(), (Main.this.getConfig().getDouble("payday.amount")*Main.economy.bankBalance(allOnlineP.getName()).balance));
|
||||
getAccountsConfig().set(allOnlineP.getName().toLowerCase() + ".money", ((Main.this.getConfig().getDouble("payday.amount")*(getAccountsConfig().getDouble(allOnlineP.getName().toLowerCase() + ".money"))+getAccountsConfig().getDouble(allOnlineP.getName().toLowerCase() + ".money"))));
|
||||
//Main.economy.depositPlayer(allOnlineP.getName().toLowerCase(), (Main.this.getConfig().getDouble("payday.amount")*Main.economy.bankBalance(allOnlineP.getName().toLowerCase()).balance));
|
||||
}
|
||||
for (OfflinePlayer allOnlineP : Bukkit.getOfflinePlayers()) {
|
||||
if (!allOnlineP.isOnline()) {
|
||||
getAccountsConfig().set(allOnlineP.getName() + ".money", ((Main.this.getConfig().getDouble("payday.amount")*(getAccountsConfig().getDouble(allOnlineP.getName() + ".money"))+getAccountsConfig().getDouble(allOnlineP.getName() + ".money"))));
|
||||
getAccountsConfig().set(allOnlineP.getName().toLowerCase() + ".money", ((Main.this.getConfig().getDouble("payday.amount")*(getAccountsConfig().getDouble(allOnlineP.getName().toLowerCase() + ".money"))+getAccountsConfig().getDouble(allOnlineP.getName().toLowerCase() + ".money"))));
|
||||
}
|
||||
//Main.economy.depositPlayer(allOnlineP.getName(), (Main.this.getConfig().getDouble("payday.amount")*Main.economy.bankBalance(allOnlineP.getName()).balance));
|
||||
//Main.economy.depositPlayer(allOnlineP.getName().toLowerCase(), (Main.this.getConfig().getDouble("payday.amount")*Main.economy.bankBalance(allOnlineP.getName().toLowerCase()).balance));
|
||||
}
|
||||
//saveAccountsConfig() //Commented out;
|
||||
List<UUID> expired_uuids = new ArrayList<UUID>();
|
||||
@ -3668,6 +3680,13 @@ public void payDay(int time)
|
||||
p.sendMessage(ChatColor.GOLD+"Sorry, there are already "+getConfig().getInt("jobs.MAX_JOBS")+" people in this job!");
|
||||
return false;
|
||||
}
|
||||
if (getConfig().getInt("jobs."+ValidJobs[matchedjob])==0) {
|
||||
//Simply set the string.
|
||||
getConfig().set("jobs."+ValidJobs[matchedjob]+"_members",String.valueOf(p.getName().toLowerCase()));
|
||||
} else {
|
||||
//Append to list.
|
||||
getConfig().set("jobs."+ValidJobs[matchedjob]+"_members",String.valueOf(getConfig().getString("jobs."+ValidJobs[matchedjob]+"_members")+", "+p.getName().toLowerCase()));
|
||||
}
|
||||
if (getConfig().getInt("jobs."+ValidJobs[matchedjob])==0) {
|
||||
//Simply set the string.
|
||||
getConfig().set("jobs."+ValidJobs[matchedjob]+"_members",String.valueOf(p.getName().toLowerCase()));
|
||||
@ -3691,7 +3710,7 @@ public void payDay(int time)
|
||||
}
|
||||
}
|
||||
if (ValidJobs[matchedjob].compareTo("Explorer")==0) {
|
||||
explorerlist.add(new ExplorerData(p.getName(), p.getLocation().getX(), p.getLocation().getZ()));
|
||||
explorerlist.add(new ExplorerData(p.getName().toLowerCase(), p.getLocation().getX(), p.getLocation().getZ()));
|
||||
}
|
||||
if (ValidJobs[matchedjob].compareTo("Support")==0) {
|
||||
supportplayers.add(new SupportPlayer(p));
|
||||
@ -3705,7 +3724,7 @@ public void payDay(int time)
|
||||
getAccountsConfig().set(p.getName().toLowerCase()+".jobs.job"+(openslot+1)+"exp", Double.valueOf(0));
|
||||
//saveAccountsConfig() //Commented out;
|
||||
Bukkit.getLogger().info("Set job data.");
|
||||
Bukkit.broadcastMessage(p.getName()+" has joined the "+JobColors[matchedjob]+ValidJobs[matchedjob]+ChatColor.WHITE+" job!");
|
||||
Bukkit.broadcastMessage(p.getName().toLowerCase()+" has joined the "+JobColors[matchedjob]+ValidJobs[matchedjob]+ChatColor.WHITE+" job!");
|
||||
p.sendMessage("You can check out your job progress anytime with "+ChatColor.GOLD+"/jobs stats"+ChatColor.WHITE+".");
|
||||
return true;
|
||||
}
|
||||
@ -3715,11 +3734,13 @@ public void payDay(int time)
|
||||
}
|
||||
|
||||
public String[] getJobs(String p) {
|
||||
p=p.toLowerCase();
|
||||
String[] string= {getAccountsConfig().getString(p.toLowerCase()+".jobs.job1"),getAccountsConfig().getString(p.toLowerCase()+".jobs.job2"),getAccountsConfig().getString(p.toLowerCase()+".jobs.job3")};
|
||||
return string;
|
||||
}
|
||||
|
||||
public boolean PlayerinJob(String p,String job) {
|
||||
p=p.toLowerCase();
|
||||
String[] jobs = getJobs(p);
|
||||
for (int i=0;i<jobs.length;i++) {
|
||||
if (job.equalsIgnoreCase(jobs[i])) {
|
||||
@ -3785,7 +3806,7 @@ public void payDay(int time)
|
||||
}
|
||||
//Add to how much we've earned so far.
|
||||
for (int i=0;i<SPEED_CONTROL.size();i++) {
|
||||
if (SPEED_CONTROL.get(i).p.getName().equalsIgnoreCase(p.getName())) {
|
||||
if (SPEED_CONTROL.get(i).p.getName().equalsIgnoreCase(p.getName().toLowerCase())) {
|
||||
SPEED_CONTROL.get(i).money_gained+=amount;
|
||||
break;
|
||||
}
|
||||
@ -3875,7 +3896,7 @@ public void payDay(int time)
|
||||
}
|
||||
//Add to how much we've earned so far.
|
||||
for (int i=0;i<SPEED_CONTROL.size();i++) {
|
||||
if (SPEED_CONTROL.get(i).p.getName().equalsIgnoreCase(p.getName())) {
|
||||
if (SPEED_CONTROL.get(i).p.getName().equalsIgnoreCase(p.getName().toLowerCase())) {
|
||||
SPEED_CONTROL.get(i).money_gained+=amount;
|
||||
break;
|
||||
}
|
||||
@ -4176,6 +4197,7 @@ public void payDay(int time)
|
||||
}
|
||||
|
||||
public int getJobLv(String job, String p) {
|
||||
p=p.toLowerCase();
|
||||
if (PlayerinJob(p,job)) {
|
||||
int slot=-1;
|
||||
//Check which slot contains our job.
|
||||
@ -4697,10 +4719,18 @@ public void payDay(int time)
|
||||
String[] jobs = getJobs(p);
|
||||
//We can remove them from this job.
|
||||
if (job.equalsIgnoreCase(getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job1"))) {
|
||||
//Remove from job members list.
|
||||
getConfig().set("jobs."+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job1")+"_members", getConfig().getString("jobs."+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job1")+"_members").replace(", "+p.getName().toLowerCase(), ""));
|
||||
/*Try again in case it's the only entry.*/
|
||||
getConfig().set("jobs."+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job1")+"_members", getConfig().getString("jobs."+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job1")+"_members").replace(p.getName().toLowerCase(), ""));
|
||||
String[] s = getConfig().getString("jobs."+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job1")+"_members").split(", ");
|
||||
String s2 = "";
|
||||
for (int i=0;i<s.length;i++) {
|
||||
if (!s[i].equalsIgnoreCase(p.getName().toLowerCase())) {
|
||||
if (s2.equals("")) {
|
||||
s2 = s[i];
|
||||
} else {
|
||||
s2 += ", "+s[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
getConfig().set("jobs."+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job1")+"_members", s2);
|
||||
//Remove 1 from main config.
|
||||
getConfig().set("jobs."+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job1"), Integer.valueOf(getConfig().getInt("jobs."+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job1"))-1));
|
||||
saveConfig();
|
||||
@ -4714,11 +4744,18 @@ public void payDay(int time)
|
||||
return true;
|
||||
} else
|
||||
if (job.equalsIgnoreCase(getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job2"))) {
|
||||
//Remove from job members list.
|
||||
getConfig().set("jobs."+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job2")+"_members", getConfig().getString("jobs."+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job2")+"_members").replace(", "+p.getName().toLowerCase(), ""));
|
||||
/*Try again in case it's the only entry.*/
|
||||
getConfig().set("jobs."+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job2")+"_members", getConfig().getString("jobs."+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job2")+"_members").replace(p.getName().toLowerCase(), ""));
|
||||
//Remove 1 from main config.
|
||||
String[] s = getConfig().getString("jobs."+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job2")+"_members").split(", ");
|
||||
String s2 = "";
|
||||
for (int i=0;i<s.length;i++) {
|
||||
if (!s[i].equalsIgnoreCase(p.getName().toLowerCase())) {
|
||||
if (s2.equals("")) {
|
||||
s2 = s[i];
|
||||
} else {
|
||||
s2 += ", "+s[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
getConfig().set("jobs."+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job2")+"_members", s2);
|
||||
getConfig().set("jobs."+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job2"), Integer.valueOf(getConfig().getInt("jobs."+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job2"))-1));
|
||||
saveConfig();
|
||||
//Remove from job 2.
|
||||
@ -4731,11 +4768,18 @@ public void payDay(int time)
|
||||
return true;
|
||||
} else
|
||||
if (job.equalsIgnoreCase(getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job3"))) {
|
||||
//Remove from job members list.
|
||||
getConfig().set("jobs."+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job3")+"_members", getConfig().getString("jobs."+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job3")+"_members").replace(", "+p.getName().toLowerCase(), ""));
|
||||
/*Try again in case it's the only entry.*/
|
||||
getConfig().set("jobs."+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job3")+"_members", getConfig().getString("jobs."+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job3")+"_members").replace(p.getName().toLowerCase(), ""));
|
||||
//Remove 1 from main config.
|
||||
String[] s = getConfig().getString("jobs."+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job3")+"_members").split(", ");
|
||||
String s2 = "";
|
||||
for (int i=0;i<s.length;i++) {
|
||||
if (!s[i].equalsIgnoreCase(p.getName().toLowerCase())) {
|
||||
if (s2.equals("")) {
|
||||
s2 = s[i];
|
||||
} else {
|
||||
s2 += ", "+s[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
getConfig().set("jobs."+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job3")+"_members", s2);
|
||||
getConfig().set("jobs."+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job3"), Integer.valueOf(getConfig().getInt("jobs."+getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job3"))-1));
|
||||
saveConfig();
|
||||
//Remove from job 3.
|
||||
@ -4823,6 +4867,100 @@ public void payDay(int time)
|
||||
return false;
|
||||
}
|
||||
|
||||
public int get_LootChestTier(ItemStack chest) {
|
||||
if (chest.hasItemMeta() && chest.getItemMeta().hasLore()) {
|
||||
//Check to see if the Lore contains anything.
|
||||
for (int i=0;i<chest.getItemMeta().getLore().size();i++) {
|
||||
if (chest.getItemMeta().getLore().get(i).equalsIgnoreCase(ChatColor.GRAY+""+ChatColor.ITALIC+"Something is rattling")) {
|
||||
return 1; // Single loot
|
||||
}
|
||||
if (chest.getItemMeta().getLore().get(i).equalsIgnoreCase(ChatColor.GRAY+""+ChatColor.ITALIC+"You feel powerful magic")) {
|
||||
return 2; // Mythic loot
|
||||
}
|
||||
if (chest.getItemMeta().getLore().get(i).equalsIgnoreCase(ChatColor.GRAY+""+ChatColor.ITALIC+"It is very heavy; there")) {
|
||||
return 3; // Quantity loot
|
||||
}
|
||||
if (chest.getItemMeta().getLore().get(i).equalsIgnoreCase(ChatColor.GRAY+""+ChatColor.ITALIC+"You can feel a variety of")) {
|
||||
return 4; // Multiloot
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public ItemStack generate_LootChest() {
|
||||
return generate_LootChest(-1);
|
||||
}
|
||||
|
||||
public ItemStack generate_LootChest(int tier) {
|
||||
ItemStack chest = new ItemStack(Material.CHEST);
|
||||
ItemMeta chest_name = chest.getItemMeta();
|
||||
List<String> chestlore = new ArrayList<String>();
|
||||
double rand = 1; // Randomly generated number determined by fair dice roll.
|
||||
|
||||
if (tier == -1) {
|
||||
rand = Math.random();
|
||||
// No argument, randomize
|
||||
}
|
||||
if (tier == 0) {
|
||||
// Invalid chest, don't return anything
|
||||
Bukkit.getLogger().warning("Invalid loot chest detected! This should never happen.");
|
||||
return null;
|
||||
}
|
||||
|
||||
if (rand < 0.005 || tier == 2) {
|
||||
// Generate a mythic chest
|
||||
chest_name.setDisplayName(ChatColor.LIGHT_PURPLE+"Mythic Chest");
|
||||
|
||||
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"A mysterious chest!");
|
||||
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"");
|
||||
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"You feel powerful magic");
|
||||
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"emanating from within;");
|
||||
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"it must contain epic");
|
||||
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"equipment!");
|
||||
chest_name.setLore(chestlore);
|
||||
|
||||
chest.setItemMeta(chest_name);
|
||||
} else if (rand < 0.02 || tier == 3) {
|
||||
// Generate a loaded goods chest
|
||||
chest_name.setDisplayName(ChatColor.AQUA+"Heavy Chest");
|
||||
|
||||
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"A mysterious chest!");
|
||||
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"");
|
||||
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"It is very heavy; there");
|
||||
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"may be lots of loot within!");
|
||||
chest_name.setLore(chestlore);
|
||||
|
||||
chest.setItemMeta(chest_name);
|
||||
} else if (rand < 0.1 || tier == 4) {
|
||||
// Generate a double chest
|
||||
chest_name.setDisplayName(ChatColor.YELLOW+"Closed Chest");
|
||||
|
||||
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"A mysterious chest!");
|
||||
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"");
|
||||
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"You can feel a variety of");
|
||||
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"items rattling around inside.");
|
||||
chest_name.setLore(chestlore);
|
||||
|
||||
chest.setItemMeta(chest_name);
|
||||
} else {
|
||||
chest_name.setDisplayName(ChatColor.YELLOW+"Closed Chest");
|
||||
|
||||
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"A mysterious chest!");
|
||||
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"");
|
||||
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"Something is rattling");
|
||||
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"around inside; it may");
|
||||
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"contain valuables!");
|
||||
chest_name.setLore(chestlore);
|
||||
|
||||
chest.setItemMeta(chest_name);
|
||||
}
|
||||
|
||||
return chest;
|
||||
}
|
||||
|
||||
public PlayerListener.Cube get_ItemCubeType(ItemStack item_cube) {
|
||||
if (item_cube.hasItemMeta() && item_cube.getItemMeta().hasLore()) {
|
||||
//Check to see if the Lore contains anything.
|
||||
|
@ -266,7 +266,7 @@ public class PlayerBuffData {
|
||||
}
|
||||
money_gained=0;
|
||||
}
|
||||
p.getScoreboard().getTeam(p.getName()).setSuffix(healthbar(p.getHealth(),p.getMaxHealth(),p.getFoodLevel()));
|
||||
p.getScoreboard().getTeam(p.getName().toLowerCase()).setSuffix(healthbar(p.getHealth(),p.getMaxHealth(),p.getFoodLevel()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -4,10 +4,16 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import me.kaZep.Base.Main;
|
||||
import net.jmhertlein.mctowns.MCTowns;
|
||||
import net.jmhertlein.mctowns.MCTownsPlugin;
|
||||
import net.jmhertlein.mctowns.database.TownManager;
|
||||
import net.jmhertlein.mctowns.structure.Town;
|
||||
import me.kaZep.Commands.JobsDataInfo.Job;
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
|
||||
@ -55,7 +61,7 @@ public class commandBankEconomy
|
||||
String usage = "<EFBFBD>˜bUsage:";
|
||||
String invARG = "<EFBFBD>˜cInvalid argument. Please use <20>˜2/bankeconomy<6D>˜c to see a full list of commands.";
|
||||
String invARGT2 = "<EFBFBD>˜cInvalid argument or insufficient permissions.";
|
||||
String offlinePlayer = "<EFBFBD>˜cPlayer not found.";
|
||||
String offlinePlayer = "<EFBFBD>˜cPlayer / Town not found.";
|
||||
String accountDisabled = "<EFBFBD>˜cYour account is disabled.";
|
||||
|
||||
String cmdInfo = "<EFBFBD>˜aYour bank balance is<69>˜b";
|
||||
@ -76,9 +82,9 @@ public class commandBankEconomy
|
||||
String notEnoughMoney = "<EFBFBD>˜aYou do not own that amount of money.";
|
||||
String succesfullDeposited = "<EFBFBD>˜aYou have deposited<65>˜b";
|
||||
String succesfullWithdraw = "<EFBFBD>˜aYou have withdrawn<77>˜b";
|
||||
String cmdTransferToPlayer1 = "<EFBFBD>˜aYou have transfered<EFBFBD>˜b";
|
||||
String cmdTransferToPlayer1 = "<EFBFBD>˜aYou have transferred<EFBFBD>˜b";
|
||||
String cmdTransferToPlayer2 = "<EFBFBD>˜ato<EFBFBD>˜b";
|
||||
String cmdTransferToTarget1 = "<EFBFBD>˜ahas transfered to you<6F>˜b";
|
||||
String cmdTransferToTarget1 = "<EFBFBD>˜ahas transferred to you<6F>˜b";
|
||||
String cmdTransferSameNick = "<EFBFBD>˜aYou can't transfer money to yourself.";
|
||||
String cmdEditAvaibleActions = "<EFBFBD>˜aAvaible actions: status, balance";
|
||||
String cmdEditDisabledToPlayer1 = "<EFBFBD>˜aYou have disabled";
|
||||
@ -349,7 +355,7 @@ public String convertToItemName(String val) {
|
||||
p.sendMessage(this.prefix + " " + this.accountDisabled);
|
||||
else if (status) {
|
||||
if ((args.length == 0)) {
|
||||
if (cmd.getName().equalsIgnoreCase("sp")) {
|
||||
if (cmd.getName().toLowerCase().equalsIgnoreCase("sp")) {
|
||||
//Show a list of all stat points and what you have currently allocated.
|
||||
p.sendMessage("");
|
||||
p.sendMessage("Stat Listing shown as: "+ChatColor.AQUA+"Cost, "+ChatColor.YELLOW+"Current Buff, "+ChatColor.RED+"Next Level, "+ChatColor.GREEN+" Description");
|
||||
@ -369,10 +375,10 @@ public String convertToItemName(String val) {
|
||||
p.sendMessage(ChatColor.GOLD+"Type "+ChatColor.BLUE+ChatColor.BOLD+"/sp #"+ChatColor.RESET+ChatColor.GOLD+" with the number of the buff you want to add a point to. (You have "+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+".)");
|
||||
}
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("tele")) {
|
||||
if (cmd.getName().toLowerCase().equalsIgnoreCase("tele")) {
|
||||
p.sendMessage("Usage: "+ChatColor.RED+"/tele to "+ChatColor.GREEN+" <player>"+ChatColor.WHITE+" - Teleport to a player for a cost.");
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("settings")) {
|
||||
if (cmd.getName().toLowerCase().equalsIgnoreCase("settings")) {
|
||||
Inventory i = Bukkit.createInventory(p, 27, "Notification Options");
|
||||
int count=-1;
|
||||
ItemStack temp,on,off;
|
||||
@ -398,12 +404,12 @@ public String convertToItemName(String val) {
|
||||
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")) {
|
||||
if (cmd.getName().toLowerCase().equalsIgnoreCase("event")) {
|
||||
if (p.hasPermission("maintenance-mode-admin")) {
|
||||
p.sendMessage("Events available: halloween, thanksgiving. Use: /event <eventname>");
|
||||
}
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("maintenance")) {
|
||||
if (cmd.getName().toLowerCase().equalsIgnoreCase("maintenance")) {
|
||||
if (p.hasPermission("maintenance-mode-admin")) {
|
||||
if (this.plugin.getConfig().getBoolean("maintenance-mode")) {
|
||||
this.plugin.getConfig().set("maintenance-mode", Boolean.valueOf(false));
|
||||
@ -415,13 +421,13 @@ public String convertToItemName(String val) {
|
||||
this.plugin.saveConfig();
|
||||
}
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("transfer")) {
|
||||
if (cmd.getName().toLowerCase().equalsIgnoreCase("transfer")) {
|
||||
p.sendMessage("Usage: "+ChatColor.RED+"/transfer name money"+ChatColor.WHITE+" - Transfer money to a player.");
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("revive")) {
|
||||
if (cmd.getName().toLowerCase().equalsIgnoreCase("revive")) {
|
||||
p.sendMessage("Usage: "+ChatColor.RED+"/revive me "+ChatColor.WHITE+" - Revive to the last location you died at.");
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("unenchant")) {
|
||||
if (cmd.getName().toLowerCase().equalsIgnoreCase("unenchant")) {
|
||||
Map<Enchantment,Integer> map = p.getItemInHand().getEnchantments();
|
||||
for (Map.Entry<Enchantment,Integer> entry : map.entrySet()) {
|
||||
p.getItemInHand().removeEnchantment(entry.getKey());
|
||||
@ -483,11 +489,11 @@ public String convertToItemName(String val) {
|
||||
}
|
||||
}
|
||||
else
|
||||
if (cmd.getName().equalsIgnoreCase("ticktime")) {
|
||||
if (cmd.getName().toLowerCase().equalsIgnoreCase("ticktime")) {
|
||||
p.sendMessage("Current Server Time: "+ChatColor.GRAY+""+ChatColor.ITALIC+Main.SERVER_TICK_TIME);
|
||||
}
|
||||
else
|
||||
if (cmd.getName().equalsIgnoreCase("jobs")) {
|
||||
if (cmd.getName().toLowerCase().equalsIgnoreCase("jobs")) {
|
||||
FileConfiguration config = this.plugin.getConfig();
|
||||
int MAXJOBS = config.getInt("jobs.MAX_JOBS");
|
||||
p.sendMessage(ChatColor.GOLD+" Blacksmith ("+config.getInt("jobs.Blacksmith")+"/"+MAXJOBS+")");
|
||||
@ -543,7 +549,7 @@ public String convertToItemName(String val) {
|
||||
"- Reloads config and accounts.");
|
||||
}
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("event") && args.length==1 && p.hasPermission("maintenance-mode-admin")) {
|
||||
if (cmd.getName().toLowerCase().equalsIgnoreCase("event") && args.length==1 && p.hasPermission("maintenance-mode-admin")) {
|
||||
if (args[0].equalsIgnoreCase("halloween")) {
|
||||
if (this.plugin.getConfig().getBoolean("halloween-enabled")) {
|
||||
this.plugin.getConfig().set("halloween-enabled", Boolean.valueOf(false));
|
||||
@ -565,21 +571,7 @@ public String convertToItemName(String val) {
|
||||
this.plugin.saveConfig();
|
||||
}
|
||||
if (args[0].equalsIgnoreCase("loot")) {
|
||||
ItemStack chest = new ItemStack(Material.CHEST);
|
||||
ItemMeta chest_name = chest.getItemMeta();
|
||||
chest_name.setDisplayName(ChatColor.YELLOW+"Closed Chest");
|
||||
|
||||
List<String> chestlore = new ArrayList<String>();
|
||||
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"A mysterious chest!");
|
||||
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"");
|
||||
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"It feels heavy; there");
|
||||
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"might be items inside.");
|
||||
chest_name.setLore(chestlore);
|
||||
|
||||
chest.setItemMeta(chest_name);
|
||||
|
||||
p.getWorld().dropItemNaturally(p.getLocation(), chest);
|
||||
}
|
||||
p.getWorld().dropItemNaturally(p.getLocation(), this.plugin.generate_LootChest()); }
|
||||
if (args[0].equalsIgnoreCase("thanksgiving")) {
|
||||
if (this.plugin.getConfig().getBoolean("thanksgiving-enabled")) {
|
||||
this.plugin.getConfig().set("thanksgiving-enabled", Boolean.valueOf(false));
|
||||
@ -607,7 +599,7 @@ public String convertToItemName(String val) {
|
||||
p.getWorld().dropItemNaturally(p.getLocation(), chest);
|
||||
}
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("event") && args.length==2 && p.hasPermission("maintenance-mode-admin")) {
|
||||
if (cmd.getName().toLowerCase().equalsIgnoreCase("event") && args.length==2 && p.hasPermission("maintenance-mode-admin")) {
|
||||
if (args[0].equalsIgnoreCase("head")) {
|
||||
ItemStack m = new ItemStack(Material.SKULL_ITEM, 64, (short)SkullType.PLAYER.ordinal());
|
||||
SkullMeta skullMeta = (SkullMeta) m.getItemMeta();
|
||||
@ -1262,44 +1254,44 @@ public String convertToItemName(String val) {
|
||||
this.plugin.saveConfig();
|
||||
}
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("dungeon") && p.hasPermission("maintenance-mode-admin") && args.length==1) {
|
||||
if (cmd.getName().toLowerCase().equalsIgnoreCase("dungeon") && p.hasPermission("maintenance-mode-admin") && args.length==1) {
|
||||
//Dungeon x = new Dungeon(new Location(Bukkit.getWorld("world"),-8990,0,-4),new Location(Bukkit.getWorld("world"),50,255,50),Integer.valueOf(args[0]));
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("transfer") && args.length==1) {
|
||||
if (cmd.getName().toLowerCase().equalsIgnoreCase("transfer") && args.length==1) {
|
||||
p.sendMessage("Usage: "+ChatColor.RED+"/transfer name money"+ChatColor.WHITE+" - Transfer money to a player.");
|
||||
}
|
||||
else
|
||||
if (cmd.getName().equalsIgnoreCase("transfer") && args.length==2) {
|
||||
if (cmd.getName().toLowerCase().equalsIgnoreCase("transfer") && args.length==2) {
|
||||
double amount = Double.parseDouble(args[1].replaceAll("[^0-9\\.]", ""));
|
||||
Player target = p.getServer().getPlayer(args[0]);
|
||||
if (target == null) {
|
||||
p.sendMessage(this.prefix + " " + this.offlinePlayer);
|
||||
}
|
||||
else if (target.getName() == p.getName()) {
|
||||
else if (target.getName().toLowerCase() == p.getName().toLowerCase()) {
|
||||
p.sendMessage(this.prefix + " " + this.cmdTransferSameNick);
|
||||
}
|
||||
else if (amount > playerBankBalance) {
|
||||
p.sendMessage(this.prefix + " " + this.notEnoughMoney);
|
||||
} else if (amount <= playerBankBalance) {
|
||||
double totalWithdraw = playerBankBalance - amount;
|
||||
double totalDeposit = amount + this.plugin.getAccountsConfig().getInt(target.getName() + ".money");
|
||||
double totalDeposit = amount + this.plugin.getAccountsConfig().getInt(target.getName().toLowerCase() + ".money");
|
||||
|
||||
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".money", Double.valueOf(totalWithdraw));
|
||||
this.plugin.getAccountsConfig().set(target.getName() + ".money", Double.valueOf(totalDeposit));
|
||||
this.plugin.saveAccountsConfig();
|
||||
|
||||
if (amount > 1.0D) {
|
||||
p.sendMessage(this.prefix + " " + this.cmdTransferToPlayer1 + " " + amount + currencyPlural + " " + this.cmdTransferToPlayer2 + " " + target.getName() + "<EFBFBD>˜a.");
|
||||
target.sendMessage(this.prefix + " <20>˜b" + p.getName() + " " + this.cmdTransferToTarget1 + " " + amount + currencyPlural + "<EFBFBD>˜a.");
|
||||
p.sendMessage(this.prefix + " " + this.cmdTransferToPlayer1 + " " + amount + currencyPlural + " " + this.cmdTransferToPlayer2 + " " + target.getName().toLowerCase() + "<EFBFBD>˜a.");
|
||||
target.sendMessage(this.prefix + " <20>˜b" + p.getName().toLowerCase() + " " + this.cmdTransferToTarget1 + " " + amount + currencyPlural + "<EFBFBD>˜a.");
|
||||
} else if (amount <= 1.0D) {
|
||||
p.sendMessage(this.prefix + " " + this.cmdTransferToPlayer1 + " " + amount + currencySingular + " " + this.cmdTransferToPlayer2 + " " + target.getName() + "<EFBFBD>˜a.");
|
||||
target.sendMessage(this.prefix + " <20>˜b" + p.getName() + " " + this.cmdTransferToTarget1 + " " + amount + currencySingular + "<EFBFBD>˜a.");
|
||||
p.sendMessage(this.prefix + " " + this.cmdTransferToPlayer1 + " " + amount + currencySingular + " " + this.cmdTransferToPlayer2 + " " + target.getName().toLowerCase() + "<EFBFBD>˜a.");
|
||||
target.sendMessage(this.prefix + " <20>˜b" + p.getName().toLowerCase() + " " + this.cmdTransferToTarget1 + " " + amount + currencySingular + "<EFBFBD>˜a.");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
if (cmd.getName().equalsIgnoreCase("sp") && args.length==1) {
|
||||
if (cmd.getName().toLowerCase().equalsIgnoreCase("sp") && args.length==1) {
|
||||
try {
|
||||
int readvalue = Integer.valueOf(args[0]);
|
||||
if (readvalue<=10 && readvalue>=1) {
|
||||
@ -1403,7 +1395,7 @@ public String convertToItemName(String val) {
|
||||
p.sendMessage(ChatColor.RED+"The inputted slot is not a valid number.");
|
||||
}
|
||||
}
|
||||
else if (cmd.getName().equalsIgnoreCase("bankeconomy") && (args[0].equalsIgnoreCase("info")) && (p.hasPermission("bankeconomy.info"))) {
|
||||
else if (cmd.getName().toLowerCase().equalsIgnoreCase("bankeconomy") && (args[0].equalsIgnoreCase("info")) && (p.hasPermission("bankeconomy.info"))) {
|
||||
if (args.length == 1) {
|
||||
if (playerBankBalance <= 1)
|
||||
p.sendMessage(this.prefix + " " + this.cmdInfo + " " + playerBankBalance + currencySingular + "<EFBFBD>˜a.");
|
||||
@ -1413,7 +1405,7 @@ public String convertToItemName(String val) {
|
||||
else
|
||||
p.sendMessage(this.invARG);
|
||||
}
|
||||
else if (cmd.getName().equalsIgnoreCase("bankeconomy") && (args[0].equalsIgnoreCase("check")) && (p.hasPermission("bankeconomy.check"))) {
|
||||
else if (cmd.getName().toLowerCase().equalsIgnoreCase("bankeconomy") && (args[0].equalsIgnoreCase("check")) && (p.hasPermission("bankeconomy.check"))) {
|
||||
if (args.length == 1) {
|
||||
p.sendMessage(this.prefix + " " + this.usage + " " + this.cmdCheckARG1);
|
||||
} else if (args.length == 2) {
|
||||
@ -1422,18 +1414,18 @@ public String convertToItemName(String val) {
|
||||
if (target == null) {
|
||||
p.sendMessage(this.prefix + " " + this.offlinePlayer);
|
||||
} else {
|
||||
int targetBalance = this.plugin.getAccountsConfig().getInt(target.getName() + ".money");
|
||||
int targetBalance = this.plugin.getAccountsConfig().getInt(target.getName().toLowerCase() + ".money");
|
||||
|
||||
if (targetBalance <= 1)
|
||||
p.sendMessage(this.prefix + "<EFBFBD>˜a " + target.getName() + this.cmdCheckReponsePlayer + " " + targetBalance + currencySingular);
|
||||
p.sendMessage(this.prefix + "<EFBFBD>˜a " + target.getName().toLowerCase() + this.cmdCheckReponsePlayer + " " + targetBalance + currencySingular);
|
||||
else if (targetBalance > 1)
|
||||
p.sendMessage(this.prefix + "<EFBFBD>˜a " + target.getName() + this.cmdCheckReponsePlayer + " " + targetBalance + currencyPlural);
|
||||
p.sendMessage(this.prefix + "<EFBFBD>˜a " + target.getName().toLowerCase() + this.cmdCheckReponsePlayer + " " + targetBalance + currencyPlural);
|
||||
}
|
||||
}
|
||||
else {
|
||||
p.sendMessage(this.invARG);
|
||||
}
|
||||
} else if (cmd.getName().equalsIgnoreCase("bankeconomy") && (args[0].equalsIgnoreCase("reset")) && (p.hasPermission("bankeconomy.reset"))) {
|
||||
} else if (cmd.getName().toLowerCase().equalsIgnoreCase("bankeconomy") && (args[0].equalsIgnoreCase("reset")) && (p.hasPermission("bankeconomy.reset"))) {
|
||||
if (args.length == 1) {
|
||||
p.sendMessage(this.prefix + " " + this.usage + " " + this.cmdResetARG1);
|
||||
} else if (args.length == 2) {
|
||||
@ -1442,11 +1434,11 @@ public String convertToItemName(String val) {
|
||||
if (target == null) {
|
||||
p.sendMessage(this.prefix + " " + this.offlinePlayer);
|
||||
} else {
|
||||
this.plugin.getAccountsConfig().set(target.getName() + ".money", Integer.valueOf(0));
|
||||
this.plugin.saveAccountsConfig();
|
||||
this.plugin.getAccountsConfig().set(target.getName().toLowerCase() + ".money", Integer.valueOf(0));
|
||||
//this.plugin.saveAccountsConfig();
|
||||
|
||||
p.sendMessage(this.prefix + " " + this.cmdResetToPlayer1 + " " + target.getName() + this.cmdResetToPlayer2);
|
||||
target.sendMessage(this.prefix + " <20>˜a" + p.getName() + " " + this.cmdResetToTarget);
|
||||
p.sendMessage(this.prefix + " " + this.cmdResetToPlayer1 + " " + target.getName().toLowerCase() + this.cmdResetToPlayer2);
|
||||
target.sendMessage(this.prefix + " <20>˜a" + p.getName().toLowerCase() + " " + this.cmdResetToTarget);
|
||||
}
|
||||
} else {
|
||||
p.sendMessage(this.invARG);
|
||||
@ -1461,7 +1453,7 @@ public String convertToItemName(String val) {
|
||||
}
|
||||
p.sendMessage(this.invARG);
|
||||
}
|
||||
else if (cmd.getName().equalsIgnoreCase("bankeconomy") && (args[0].equalsIgnoreCase("transfer")) && (p.hasPermission("bankeconomy.transfer"))) {
|
||||
else if (cmd.getName().toLowerCase().equalsIgnoreCase("bankeconomy") && (args[0].equalsIgnoreCase("transfer")) && (p.hasPermission("bankeconomy.transfer"))) {
|
||||
if (args.length == 1) {
|
||||
p.sendMessage(this.prefix + " " + this.usage + " " + this.cmdTransferARG1);
|
||||
} else if (args.length == 2) {
|
||||
@ -1473,25 +1465,25 @@ public String convertToItemName(String val) {
|
||||
if (target == null) {
|
||||
p.sendMessage(this.prefix + " " + this.offlinePlayer);
|
||||
}
|
||||
else if (target.getName() == p.getName()) {
|
||||
else if (target.getName().toLowerCase() == p.getName().toLowerCase()) {
|
||||
p.sendMessage(this.prefix + " " + this.cmdTransferSameNick);
|
||||
}
|
||||
else if (amount > playerBankBalance) {
|
||||
p.sendMessage(this.prefix + " " + this.notEnoughMoney);
|
||||
} else if (amount <= playerBankBalance) {
|
||||
double totalWithdraw = playerBankBalance - amount;
|
||||
double totalDeposit = amount + this.plugin.getAccountsConfig().getInt(target.getName() + ".money");
|
||||
double totalDeposit = amount + this.plugin.getAccountsConfig().getInt(target.getName().toLowerCase() + ".money");
|
||||
|
||||
this.plugin.getAccountsConfig().set(p.getName().toLowerCase() + ".money", Double.valueOf(totalWithdraw));
|
||||
this.plugin.getAccountsConfig().set(target.getName() + ".money", Double.valueOf(totalDeposit));
|
||||
this.plugin.saveAccountsConfig();
|
||||
|
||||
if (amount > 1.0D) {
|
||||
p.sendMessage(this.prefix + " " + this.cmdTransferToPlayer1 + " " + amount + currencyPlural + " " + this.cmdTransferToPlayer2 + " " + target.getName() + "<EFBFBD>˜a.");
|
||||
target.sendMessage(this.prefix + " <20>˜b" + p.getName() + " " + this.cmdTransferToTarget1 + " " + amount + currencyPlural + "<EFBFBD>˜a.");
|
||||
p.sendMessage(this.prefix + " " + this.cmdTransferToPlayer1 + " " + amount + currencyPlural + " " + this.cmdTransferToPlayer2 + " " + target.getName().toLowerCase() + "<EFBFBD>˜a.");
|
||||
target.sendMessage(this.prefix + " <20>˜b" + p.getName().toLowerCase() + " " + this.cmdTransferToTarget1 + " " + amount + currencyPlural + "<EFBFBD>˜a.");
|
||||
} else if (amount <= 1.0D) {
|
||||
p.sendMessage(this.prefix + " " + this.cmdTransferToPlayer1 + " " + amount + currencySingular + " " + this.cmdTransferToPlayer2 + " " + target.getName() + "<EFBFBD>˜a.");
|
||||
target.sendMessage(this.prefix + " <20>˜b" + p.getName() + " " + this.cmdTransferToTarget1 + " " + amount + currencySingular + "<EFBFBD>˜a.");
|
||||
p.sendMessage(this.prefix + " " + this.cmdTransferToPlayer1 + " " + amount + currencySingular + " " + this.cmdTransferToPlayer2 + " " + target.getName().toLowerCase() + "<EFBFBD>˜a.");
|
||||
target.sendMessage(this.prefix + " <20>˜b" + p.getName().toLowerCase() + " " + this.cmdTransferToTarget1 + " " + amount + currencySingular + "<EFBFBD>˜a.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1499,7 +1491,7 @@ public String convertToItemName(String val) {
|
||||
{
|
||||
p.sendMessage(this.invARG);
|
||||
}
|
||||
} else if (cmd.getName().equalsIgnoreCase("bankeconomy") && (args[0].equalsIgnoreCase("edit")) && (p.hasPermission("bankeconomy.edit"))) {
|
||||
} else if (cmd.getName().toLowerCase().equalsIgnoreCase("bankeconomy") && (args[0].equalsIgnoreCase("edit")) && (p.hasPermission("bankeconomy.edit"))) {
|
||||
if (args.length == 1) {
|
||||
p.sendMessage(this.prefix + " " + this.usage + " " + this.cmdEditARG1);
|
||||
p.sendMessage(this.prefix + " " + this.cmdEditAvaibleActions);
|
||||
@ -1516,24 +1508,24 @@ public String convertToItemName(String val) {
|
||||
}
|
||||
else if (args[1].equalsIgnoreCase("status")) {
|
||||
if (amount == 1.0D) {
|
||||
this.plugin.getAccountsConfig().set(target.getName() + ".status", Boolean.valueOf(true));
|
||||
this.plugin.saveAccountsConfig();
|
||||
this.plugin.getAccountsConfig().set(target.getName().toLowerCase() + ".status", Boolean.valueOf(true));
|
||||
//this.plugin.saveAccountsConfig();
|
||||
|
||||
p.sendMessage(this.prefix + " " + this.cmdEditEnableToPlayer1 + " " + p.getName() + this.cmdEditEnableToPlayer2);
|
||||
p.sendMessage(this.prefix + " " + this.cmdEditEnableToPlayer1 + " " + p.getName().toLowerCase() + this.cmdEditEnableToPlayer2);
|
||||
} else if (amount == 0.0D) {
|
||||
this.plugin.getAccountsConfig().set(target.getName() + ".status", Boolean.valueOf(false));
|
||||
this.plugin.saveAccountsConfig();
|
||||
this.plugin.getAccountsConfig().set(target.getName().toLowerCase() + ".status", Boolean.valueOf(false));
|
||||
//this.plugin.saveAccountsConfig();
|
||||
|
||||
p.sendMessage(this.prefix + " " + this.cmdEditDisabledToPlayer1 + " " + p.getName() + this.cmdEditDisabledToPlayer2);
|
||||
p.sendMessage(this.prefix + " " + this.cmdEditDisabledToPlayer1 + " " + p.getName().toLowerCase() + this.cmdEditDisabledToPlayer2);
|
||||
}
|
||||
} else if (args[1].equalsIgnoreCase("balance")) {
|
||||
this.plugin.getAccountsConfig().set(target.getName() + ".money", Double.valueOf(amount));
|
||||
this.plugin.saveAccountsConfig();
|
||||
this.plugin.getAccountsConfig().set(target.getName().toLowerCase() + ".money", Double.valueOf(amount));
|
||||
//this.plugin.saveAccountsConfig();
|
||||
|
||||
if (amount > 1.0D)
|
||||
p.sendMessage(this.prefix + " " + this.cmdEditAmountSetPlayer1 + " <20>˜b" + amount + currencyPlural + " " + this.cmdEditAmountSetPlayer2 + " " + target.getName() + this.cmdEditAmountSetPlayer3);
|
||||
p.sendMessage(this.prefix + " " + this.cmdEditAmountSetPlayer1 + " <20>˜b" + amount + currencyPlural + " " + this.cmdEditAmountSetPlayer2 + " " + target.getName().toLowerCase() + this.cmdEditAmountSetPlayer3);
|
||||
else if (amount <= 1.0D)
|
||||
p.sendMessage(this.prefix + " " + this.cmdEditAmountSetPlayer1 + " <20>˜b" + amount + currencySingular + " " + this.cmdEditAmountSetPlayer2 + " " + target.getName() + this.cmdEditAmountSetPlayer3);
|
||||
p.sendMessage(this.prefix + " " + this.cmdEditAmountSetPlayer1 + " <20>˜b" + amount + currencySingular + " " + this.cmdEditAmountSetPlayer2 + " " + target.getName().toLowerCase() + this.cmdEditAmountSetPlayer3);
|
||||
}
|
||||
else {
|
||||
p.sendMessage(this.prefix + " " + this.cmdEditAvaibleActions);
|
||||
@ -1543,7 +1535,7 @@ public String convertToItemName(String val) {
|
||||
p.sendMessage(this.invARG);
|
||||
}
|
||||
}
|
||||
else if (cmd.getName().equalsIgnoreCase("revive") && args[0].equalsIgnoreCase("me")) {
|
||||
else if (cmd.getName().toLowerCase().equalsIgnoreCase("revive") && args[0].equalsIgnoreCase("me")) {
|
||||
DecimalFormat df = new DecimalFormat("#0.00");
|
||||
double deathX = this.plugin.getAccountsConfig().getDouble(p.getName().toLowerCase() + ".deathpointX");
|
||||
double deathY = this.plugin.getAccountsConfig().getDouble(p.getName().toLowerCase() + ".deathpointY");
|
||||
@ -1607,17 +1599,17 @@ public String convertToItemName(String val) {
|
||||
p2.setMaximumNoDamageTicks(20);
|
||||
}
|
||||
},100);
|
||||
Bukkit.broadcastMessage(ChatColor.GREEN+p.getName()+ChatColor.WHITE+" decided to revive.");
|
||||
Bukkit.broadcastMessage(ChatColor.GREEN+p.getName().toLowerCase()+ChatColor.WHITE+" decided to revive.");
|
||||
} else {
|
||||
p.sendMessage("You cannot revive. You need to have $"+df.format(finalcost)+" to do so.");
|
||||
}
|
||||
} else {
|
||||
p.sendMessage("You haven't died. So you cannot revive.");
|
||||
}
|
||||
this.plugin.saveAccountsConfig();
|
||||
//this.plugin.saveAccountsConfig();
|
||||
return true;
|
||||
}
|
||||
else if (cmd.getName().equalsIgnoreCase("revive") && (args[0].equalsIgnoreCase("amount"))) {
|
||||
else if (cmd.getName().toLowerCase().equalsIgnoreCase("revive") && (args[0].equalsIgnoreCase("amount"))) {
|
||||
DecimalFormat df = new DecimalFormat("#0.00");
|
||||
double deathX = p.getLocation().getX();
|
||||
double deathY = p.getLocation().getY();
|
||||
@ -1636,7 +1628,7 @@ public String convertToItemName(String val) {
|
||||
p.sendMessage("You need to have $"+df.format(finalcost)+" to revive.");
|
||||
return true;
|
||||
}
|
||||
else if (cmd.getName().equalsIgnoreCase("tele") && (args[0].equalsIgnoreCase("to"))) {
|
||||
else if (cmd.getName().toLowerCase().equalsIgnoreCase("tele") && (args[0].equalsIgnoreCase("to"))) {
|
||||
DecimalFormat df = new DecimalFormat("#0.00");
|
||||
if (p.getPlayerTime()-this.plugin.getAccountsConfig().getDouble(p.getName().toLowerCase() + ".teletime")<400) {
|
||||
if (args.length==1) {
|
||||
@ -1645,7 +1637,96 @@ public String convertToItemName(String val) {
|
||||
//Teleport.
|
||||
Player target = p.getServer().getPlayer(args[1]);
|
||||
if (target == null) {
|
||||
//It could be a town name. Check
|
||||
TownManager t = MCTownsPlugin.getPlugin().getTownManager();
|
||||
Bukkit.getLogger().info("Town Manager started:"+ t.toString());
|
||||
Town teleport_town = null;
|
||||
Collection<Town> towns = t.getTownsCollection();
|
||||
for (Town towny : towns) {
|
||||
if (towny!=null) {
|
||||
if (towny.getTownName().equalsIgnoreCase(args[1])) {
|
||||
teleport_town = towny;
|
||||
break;
|
||||
} else {
|
||||
Bukkit.getLogger().info("This was town "+towny.getTownName());
|
||||
}
|
||||
}
|
||||
}
|
||||
//Iterate through collection, seeing if we can find the town.
|
||||
if (teleport_town == null) {
|
||||
p.sendMessage(this.prefix + " " + this.offlinePlayer);
|
||||
} else {
|
||||
boolean is_in_vehicle = false;
|
||||
Entity vehicle = null;
|
||||
if (p.isInsideVehicle()) {
|
||||
is_in_vehicle=true;
|
||||
vehicle = p.getVehicle();
|
||||
}
|
||||
if (teleport_town.getTownName().equalsIgnoreCase(this.plugin.getAccountsConfig().getString(p.getName().toLowerCase() + ".teleplayer"))) {
|
||||
//Determine distance of player to other player.
|
||||
double otherx = teleport_town.getSpawn(Bukkit.getServer()).getX();
|
||||
double othery = teleport_town.getSpawn(Bukkit.getServer()).getY();
|
||||
double otherz = teleport_town.getSpawn(Bukkit.getServer()).getZ();
|
||||
double mymoney = this.plugin.getAccountsConfig().getDouble(p.getName().toLowerCase().toLowerCase() + ".money");
|
||||
double finalcost = Math.abs(p.getLocation().getX()-otherx)+Math.abs(p.getLocation().getY()-othery)+Math.abs(p.getLocation().getZ()-otherz);
|
||||
//Bukkit.getLogger().info("finalcost1:"+finalcost);
|
||||
finalcost *= this.plugin.getConfig().getDouble("teleport-cost-rate");
|
||||
//Bukkit.getLogger().info("finalcost2:"+finalcost);
|
||||
finalcost += finalcost * 15 * ((p.getMaxHealth()-p.getHealth())/p.getMaxHealth());
|
||||
//Bukkit.getLogger().info("finalcost3:"+finalcost);
|
||||
//finalcost += mymoney*this.plugin.getConfig().getDouble("teleport-cost-tax");
|
||||
if (mymoney>=finalcost) {
|
||||
//Allow teleport to occur.
|
||||
this.plugin.getAccountsConfig().set(p.getName().toLowerCase().toLowerCase() + ".money", mymoney-finalcost);
|
||||
this.plugin.getAccountsConfig().set(p.getName().toLowerCase().toLowerCase() + ".teletime", Double.valueOf(0.0d));
|
||||
//this.plugin.saveAccountsConfig();
|
||||
if (this.plugin.PlayerinJob(p, "Support")) {
|
||||
//Give exp for doing so.
|
||||
//this.plugin.gainMoneyExp(p,"Support",0,100);
|
||||
}
|
||||
p.sendMessage("Teleported to "+ChatColor.GREEN+teleport_town.getTownName()+ChatColor.WHITE+" for $"+ChatColor.YELLOW+df.format(finalcost)+ChatColor.WHITE+". New Account balance: $"+df.format(mymoney-finalcost));
|
||||
Bukkit.broadcastMessage(ChatColor.GREEN+p.getName()+ChatColor.WHITE+" teleported to "+ChatColor.YELLOW+teleport_town.getTownName()+".");
|
||||
if (is_in_vehicle) {
|
||||
vehicle.eject();
|
||||
p.eject();
|
||||
final Player p2 = p;
|
||||
final Town target2 = teleport_town;
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(this.plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
p2.teleport(target2.getSpawn(Bukkit.getServer()));
|
||||
}
|
||||
},5);
|
||||
} else {
|
||||
p.teleport(teleport_town.getSpawn(Bukkit.getServer()));
|
||||
}
|
||||
} else {
|
||||
p.sendMessage("You need $"+ChatColor.YELLOW+df.format(finalcost)+" in the bank to teleport to "+ChatColor.GREEN+teleport_town.getTownName()+ChatColor.WHITE+"!");
|
||||
}
|
||||
} else {
|
||||
//Setup another town.
|
||||
//Determine distance of player to new town.
|
||||
double otherx = teleport_town.getSpawn(Bukkit.getServer()).getX();
|
||||
double othery = teleport_town.getSpawn(Bukkit.getServer()).getY();
|
||||
double otherz = teleport_town.getSpawn(Bukkit.getServer()).getZ();
|
||||
double mymoney = this.plugin.getAccountsConfig().getDouble(p.getName().toLowerCase().toLowerCase() + ".money");
|
||||
double finalcost = Math.abs(p.getLocation().getX()-otherx)+Math.abs(p.getLocation().getY()-othery)+Math.abs(p.getLocation().getZ()-otherz);
|
||||
Bukkit.getLogger().info("finalcost1:"+finalcost);
|
||||
finalcost *= this.plugin.getConfig().getDouble("teleport-cost-rate");
|
||||
Bukkit.getLogger().info("finalcost2:"+finalcost);
|
||||
finalcost += finalcost * 15 * ((p.getMaxHealth()-p.getHealth())/p.getMaxHealth());
|
||||
Bukkit.getLogger().info("finalcost3:"+finalcost);
|
||||
//finalcost += mymoney*this.plugin.getConfig().getDouble("teleport-cost-tax");
|
||||
if (mymoney>=finalcost) {
|
||||
//Allow teleport to occur.
|
||||
p.sendMessage("Teleporting to "+ChatColor.GREEN+teleport_town.getTownName()+ChatColor.WHITE+" costs $"+ChatColor.YELLOW+df.format(finalcost)+". Type the command again to teleport.");
|
||||
this.plugin.getAccountsConfig().set(p.getName().toLowerCase().toLowerCase() + ".teletime", Double.valueOf(p.getPlayerTime()));
|
||||
this.plugin.getAccountsConfig().set(p.getName().toLowerCase().toLowerCase() + ".teleplayer", String.valueOf(teleport_town.getTownName()));
|
||||
} else {
|
||||
p.sendMessage("Teleporting to "+ChatColor.GREEN+teleport_town.getTownName()+ChatColor.WHITE+" costs $"+ChatColor.YELLOW+df.format(finalcost)+". You do not have enough in the bank for that.");
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
boolean is_in_vehicle = false;
|
||||
Entity vehicle = null;
|
||||
@ -1660,7 +1741,11 @@ public String convertToItemName(String val) {
|
||||
double otherz = target.getLocation().getZ();
|
||||
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);
|
||||
//Bukkit.getLogger().info("finalcost1:"+finalcost);
|
||||
finalcost *= this.plugin.getConfig().getDouble("teleport-cost-rate");
|
||||
//Bukkit.getLogger().info("finalcost2:"+finalcost);
|
||||
finalcost += finalcost * 15 * ((p.getMaxHealth()-p.getHealth())/p.getMaxHealth());
|
||||
//Bukkit.getLogger().info("finalcost3:"+finalcost);
|
||||
//finalcost += mymoney*this.plugin.getConfig().getDouble("teleport-cost-tax");
|
||||
if (mymoney>=finalcost) {
|
||||
//Allow teleport to occur.
|
||||
@ -1706,7 +1791,11 @@ public String convertToItemName(String val) {
|
||||
double otherz = target.getLocation().getZ();
|
||||
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);
|
||||
Bukkit.getLogger().info("finalcost1:"+finalcost);
|
||||
finalcost *= this.plugin.getConfig().getDouble("teleport-cost-rate");
|
||||
Bukkit.getLogger().info("finalcost2:"+finalcost);
|
||||
finalcost += finalcost * 15 * ((p.getMaxHealth()-p.getHealth())/p.getMaxHealth());
|
||||
Bukkit.getLogger().info("finalcost3:"+finalcost);
|
||||
//finalcost += mymoney*this.plugin.getConfig().getDouble("teleport-cost-tax");
|
||||
if (mymoney>=finalcost) {
|
||||
//Allow teleport to occur.
|
||||
@ -1714,7 +1803,7 @@ public String convertToItemName(String val) {
|
||||
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.");
|
||||
p.sendMessage("Teleporting to "+ChatColor.GREEN+target.getName().toLowerCase()+ChatColor.WHITE+" costs $"+ChatColor.YELLOW+df.format(finalcost)+". You do not have enough in the bank for that.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1727,7 +1816,47 @@ public String convertToItemName(String val) {
|
||||
//Teleport.
|
||||
Player target = p.getServer().getPlayer(args[1]);
|
||||
if (target == null) {
|
||||
//It could be a town name. Check
|
||||
TownManager t = MCTownsPlugin.getPlugin().getTownManager();
|
||||
Bukkit.getLogger().info("Town Manager started:"+ t.toString());
|
||||
Town teleport_town = null;
|
||||
Collection<Town> towns = t.getTownsCollection();
|
||||
for (Town towny : towns) {
|
||||
if (towny!=null) {
|
||||
if (towny.getTownName().equalsIgnoreCase(args[1])) {
|
||||
teleport_town = towny;
|
||||
break;
|
||||
} else {
|
||||
Bukkit.getLogger().info("This was town "+towny.getTownName());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (teleport_town == null) {
|
||||
p.sendMessage(this.prefix + " " + this.offlinePlayer);
|
||||
} else {
|
||||
//We can attempt to teleport to this town's spawn point. Find out the point and how much it costs.
|
||||
Location spawn_point = teleport_town.getSpawn(Bukkit.getServer());
|
||||
//Determine distance of player to town..
|
||||
double otherx = spawn_point.getX();
|
||||
double othery = spawn_point.getY();
|
||||
double otherz = spawn_point.getZ();
|
||||
double mymoney = this.plugin.getAccountsConfig().getDouble(p.getName().toLowerCase().toLowerCase() + ".money");
|
||||
double finalcost = Math.abs(p.getLocation().getX()-otherx)+Math.abs(p.getLocation().getY()-othery)+Math.abs(p.getLocation().getZ()-otherz);
|
||||
//Bukkit.getLogger().info("finalcost1:"+finalcost);
|
||||
finalcost *= this.plugin.getConfig().getDouble("teleport-cost-rate");
|
||||
//Bukkit.getLogger().info("finalcost2:"+finalcost);
|
||||
finalcost += finalcost * 15 * ((p.getMaxHealth()-p.getHealth())/p.getMaxHealth());
|
||||
//Bukkit.getLogger().info("finalcost3:"+finalcost);
|
||||
//finalcost += mymoney*this.plugin.getConfig().getDouble("teleport-cost-tax");
|
||||
if (mymoney>=finalcost) {
|
||||
//Allow teleport to occur.
|
||||
p.sendMessage("Teleporting to "+ChatColor.GREEN+teleport_town.getTownName()+ChatColor.WHITE+" costs $"+ChatColor.YELLOW+df.format(finalcost)+". Type the command again to teleport.");
|
||||
this.plugin.getAccountsConfig().set(p.getName().toLowerCase().toLowerCase() + ".teletime", Double.valueOf(p.getPlayerTime()));
|
||||
this.plugin.getAccountsConfig().set(p.getName().toLowerCase().toLowerCase() + ".teleplayer", String.valueOf(teleport_town.getTownName().toLowerCase()));
|
||||
} else {
|
||||
p.sendMessage("Teleporting to "+ChatColor.GREEN+teleport_town.getTownName()+ChatColor.WHITE+" costs $"+ChatColor.YELLOW+df.format(finalcost)+". You do not have enough in the bank for that.");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//Determine distance of player to other player.
|
||||
double otherx = target.getLocation().getX();
|
||||
@ -1735,7 +1864,11 @@ public String convertToItemName(String val) {
|
||||
double otherz = target.getLocation().getZ();
|
||||
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);
|
||||
//Bukkit.getLogger().info("finalcost1:"+finalcost);
|
||||
finalcost *= this.plugin.getConfig().getDouble("teleport-cost-rate");
|
||||
//Bukkit.getLogger().info("finalcost2:"+finalcost);
|
||||
finalcost += finalcost * 15 * ((p.getMaxHealth()-p.getHealth())/p.getMaxHealth());
|
||||
//Bukkit.getLogger().info("finalcost3:"+finalcost);
|
||||
//finalcost += mymoney*this.plugin.getConfig().getDouble("teleport-cost-tax");
|
||||
if (mymoney>=finalcost) {
|
||||
//Allow teleport to occur.
|
||||
@ -1743,31 +1876,34 @@ public String convertToItemName(String val) {
|
||||
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.");
|
||||
p.sendMessage("Teleporting to "+ChatColor.GREEN+target.getName().toLowerCase()+ChatColor.WHITE+" costs $"+ChatColor.YELLOW+df.format(finalcost)+". You do not have enough in the bank for that.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("jobs") && args.length == 1 && args[0].equalsIgnoreCase("info")) {
|
||||
if (cmd.getName().toLowerCase().equalsIgnoreCase("jobs") && args.length == 1 && args[0].equalsIgnoreCase("info")) {
|
||||
p.sendMessage("Usage: "+ChatColor.GREEN+"/jobs info [JobName]"+ChatColor.WHITE+" - Get information about a job.");
|
||||
p.sendMessage("Usage: "+ChatColor.GREEN+"/jobs info [JobName] "+ChatColor.LIGHT_PURPLE+"[lv]"+ChatColor.WHITE+" - Get information about a job at a certain job level.");
|
||||
p.sendMessage(" Type /jobs to see the jobs.");
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("jobs") && args.length == 1 && args[0].equalsIgnoreCase("join")) {
|
||||
if (cmd.getName().toLowerCase().equalsIgnoreCase("jobs") && args.length == 1 && args[0].equalsIgnoreCase("join")) {
|
||||
p.sendMessage("Usage: "+ChatColor.GREEN+"/jobs join [JobName]"+ChatColor.WHITE+" - Join a job. Type /jobs to see the jobs.");
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("jobs") && args.length == 1 && args[0].equalsIgnoreCase("members")) {
|
||||
p.sendMessage("Usage: "+ChatColor.GREEN+"/jobs members [JobName]"+ChatColor.WHITE+" - Check all members in a job.");
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("jobs") && args.length == 1 && args[0].equalsIgnoreCase("leave")) {
|
||||
if (cmd.getName().equalsIgnoreCase("jobs") && args.length == 1 && args[0].equalsIgnoreCase("members")) {
|
||||
p.sendMessage("Usage: "+ChatColor.GREEN+"/jobs members [JobName]"+ChatColor.WHITE+" - Check all members in a job.");
|
||||
} else
|
||||
if (cmd.getName().toLowerCase().equalsIgnoreCase("jobs") && args.length == 1 && args[0].equalsIgnoreCase("leave")) {
|
||||
p.sendMessage("Usage: "+ChatColor.GREEN+"/jobs leave [JobName]"+ChatColor.WHITE+" - Leave a job. Type /jobs stats to see your jobs.");
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("jobs") && args.length == 1 && args[0].equalsIgnoreCase("buffs")) {
|
||||
p.sendMessage("Usage: "+ChatColor.GREEN+"/jobs buffs [JobName]"+ChatColor.WHITE+" - Get buffs information about a job. Type /jobs to see the jobs.");
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("jobs") && args.length == 2 && args[0].equalsIgnoreCase("ultimate")) {
|
||||
if (cmd.getName().toLowerCase().equalsIgnoreCase("jobs") && args.length == 2 && args[0].equalsIgnoreCase("ultimate")) {
|
||||
//Attempt to join the job.
|
||||
this.plugin.setUltimate(p,args[1]);
|
||||
} else
|
||||
@ -1775,11 +1911,11 @@ public String convertToItemName(String val) {
|
||||
//Attempt to level up the job.
|
||||
this.plugin.levelUpJob(p,args[1]);
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("jobs") && args.length == 2 && args[0].equalsIgnoreCase("join")) {
|
||||
if (cmd.getName().toLowerCase().equalsIgnoreCase("jobs") && args.length == 2 && args[0].equalsIgnoreCase("join")) {
|
||||
//Attempt to join the job.
|
||||
this.plugin.joinJob(p,args[1]);
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("jobs") && args.length == 2 && args[0].equalsIgnoreCase("leave")) {
|
||||
if (cmd.getName().toLowerCase().equalsIgnoreCase("jobs") && args.length == 2 && args[0].equalsIgnoreCase("leave")) {
|
||||
//Attempt to join the job.
|
||||
this.plugin.leaveJob(p,args[1]);
|
||||
} else
|
||||
@ -1831,7 +1967,67 @@ public String convertToItemName(String val) {
|
||||
p.sendMessage(ChatColor.RED+"Sorry, that is not a valid job!");
|
||||
}
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("jobs") && (args.length == 2 || args.length==3) && args[0].equalsIgnoreCase("info")) {
|
||||
if (cmd.getName().equalsIgnoreCase("jobs") && args.length == 2 && args[0].equalsIgnoreCase("members")) {
|
||||
JobsDataInfo[] Jobsinfo = {this.plugin.Woodcutter_job,this.plugin.Miner_job,this.plugin.Builder_job,this.plugin.Digger_job,this.plugin.Farmer_job,this.plugin.Hunter_job,this.plugin.Fisherman_job,this.plugin.Weaponsmith_job,this.plugin.Blacksmith_job,this.plugin.Cook_job,this.plugin.Brewer_job,this.plugin.Enchanter_job,this.plugin.Breeder_job,this.plugin.Explorer_job,this.plugin.Support_job};
|
||||
boolean found=false;
|
||||
String job = "";
|
||||
ChatColor job_color = null;
|
||||
for (int i=0;i<this.plugin.ValidJobs.length;i++) {
|
||||
if (this.plugin.ValidJobs[i].toLowerCase().equalsIgnoreCase(args[1])) {
|
||||
found=true;
|
||||
job = this.plugin.ValidJobs[i];
|
||||
job_color = this.plugin.getJobColor(this.plugin.ValidJobs[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found) {
|
||||
if (this.plugin.getConfig().contains("jobs."+job+"_members")) {
|
||||
p.sendMessage("Players in the "+job_color+job+" job:");
|
||||
String[] players = this.plugin.getConfig().getString("jobs."+job+"_members").split(", ");
|
||||
int lowest = 999999;
|
||||
List<String> sorted_players = new ArrayList<String>();
|
||||
for (int i=0;i<players.length;i++) {
|
||||
sorted_players.add(players[i]); //Add everyone to the list.
|
||||
Bukkit.getLogger().info("Add player "+players[i]);
|
||||
}
|
||||
//Sort them.
|
||||
List<String> sorted_list_players = new ArrayList<String>();
|
||||
int lowest_slot = -1;
|
||||
while (sorted_players.size()>0) {
|
||||
for (int i=0;i<sorted_players.size();i++) {
|
||||
if (sorted_players.get(i).length()>0) { //If it's 0, for some reason it didn't read this name right....Skip it.
|
||||
if (this.plugin.getJobLv(job, sorted_players.get(i))<lowest) {
|
||||
lowest=this.plugin.getJobLv(job, sorted_players.get(i));
|
||||
lowest_slot=i;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (lowest_slot!=-1) {
|
||||
sorted_list_players.add(sorted_players.get(lowest_slot));
|
||||
sorted_players.remove(lowest_slot);
|
||||
lowest_slot=-1;
|
||||
lowest=999999;
|
||||
} else {
|
||||
p.sendMessage(ChatColor.GOLD+"Sorry, something bad happened! Please report this to an administrator. (EC1)");
|
||||
break; //Something bad happened.
|
||||
}
|
||||
}
|
||||
if (sorted_list_players.size()>0) {
|
||||
for (int i=0;i<sorted_list_players.size();i++) {
|
||||
OfflinePlayer q = Bukkit.getOfflinePlayer(sorted_list_players.get(i));
|
||||
p.sendMessage(" "+q.getName()+ChatColor.GRAY+ChatColor.ITALIC+" (Lv"+this.plugin.getJobLv(job, q.getName().toLowerCase())+")");
|
||||
}
|
||||
} else {
|
||||
p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"- No one in this job yet. -");
|
||||
}
|
||||
} else {
|
||||
p.sendMessage(ChatColor.GOLD+"Sorry, something bad happened! Please report this to an administrator. (EC0)");
|
||||
}
|
||||
} else {
|
||||
p.sendMessage(ChatColor.RED+"Sorry, that is not a valid job!");
|
||||
}
|
||||
} else
|
||||
if (cmd.getName().toLowerCase().equalsIgnoreCase("jobs") && (args.length == 2 || args.length==3) && args[0].equalsIgnoreCase("info")) {
|
||||
JobsDataInfo[] Jobsinfo = {this.plugin.Woodcutter_job,this.plugin.Miner_job,this.plugin.Builder_job,this.plugin.Digger_job,this.plugin.Hunter_job,this.plugin.Fisherman_job,this.plugin.Weaponsmith_job,this.plugin.Blacksmith_job,this.plugin.Cook_job,this.plugin.Brewer_job,this.plugin.Enchanter_job,this.plugin.Breeder_job,this.plugin.Explorer_job,this.plugin.Support_job};
|
||||
boolean found=false;
|
||||
int matchedjob=0;
|
||||
@ -1885,7 +2081,7 @@ public String convertToItemName(String val) {
|
||||
}
|
||||
p.sendMessage("");
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("jobs") && (args.length == 2) && args[0].equalsIgnoreCase("buffs")) {
|
||||
if (cmd.getName().toLowerCase().equalsIgnoreCase("jobs") && (args.length == 2) && args[0].equalsIgnoreCase("buffs")) {
|
||||
JobsDataInfo[] Jobsinfo = {this.plugin.Woodcutter_job,this.plugin.Miner_job,this.plugin.Builder_job,this.plugin.Digger_job,this.plugin.Hunter_job,this.plugin.Fisherman_job,this.plugin.Weaponsmith_job,this.plugin.Blacksmith_job,this.plugin.Cook_job,this.plugin.Brewer_job,this.plugin.Enchanter_job,this.plugin.Breeder_job,this.plugin.Explorer_job,this.plugin.Support_job};
|
||||
boolean found=false;
|
||||
int slot=0;
|
||||
@ -1919,7 +2115,7 @@ public String convertToItemName(String val) {
|
||||
p.sendMessage(ChatColor.ITALIC+"Note that only one ultimate buff can be chosen. And CANNOT BE CHANGED.");
|
||||
}
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("jobs") && (args.length == 1 || args.length==2) && args[0].equalsIgnoreCase("stats")) {
|
||||
if (cmd.getName().toLowerCase().equalsIgnoreCase("jobs") && (args.length == 1 || args.length==2) && args[0].equalsIgnoreCase("stats")) {
|
||||
if (args.length==1) {
|
||||
//Show your stats.
|
||||
p.sendMessage("");
|
||||
@ -1940,7 +2136,7 @@ public String convertToItemName(String val) {
|
||||
boolean discovered=false;
|
||||
long timeleft=0;
|
||||
for (int j=0;j<this.plugin.explorers.size();j++) {
|
||||
if (this.plugin.explorers.get(j).name.compareToIgnoreCase(p.getName())==0 && this.plugin.explorers.get(j).event==0) {
|
||||
if (this.plugin.explorers.get(j).name.compareToIgnoreCase(p.getName().toLowerCase().toLowerCase())==0 && this.plugin.explorers.get(j).event==0) {
|
||||
discovered=true;
|
||||
timeleft=this.plugin.explorers.get(j).expiretime-this.plugin.SERVER_TICK_TIME;
|
||||
}
|
||||
@ -1957,16 +2153,16 @@ public String convertToItemName(String val) {
|
||||
if (Bukkit.getPlayer(args[1])!=null) {
|
||||
//This is the player. Show job stats.
|
||||
p.sendMessage("");
|
||||
p.sendMessage(Bukkit.getPlayer(args[1]).getName()+"'s jobs:");
|
||||
p.sendMessage(Bukkit.getPlayer(args[1]).getName().toLowerCase()+"'s jobs:");
|
||||
String[] joblist=this.plugin.getJobs(Bukkit.getPlayer(args[1]));
|
||||
for (int i=0;i<joblist.length;i++) {
|
||||
if (!joblist[i].equalsIgnoreCase("None")) {
|
||||
int mylv=this.plugin.getAccountsConfig().getInt(Bukkit.getPlayer(args[1]).getName()+".jobs.job"+(i+1)+"lv");
|
||||
int mylv=this.plugin.getAccountsConfig().getInt(Bukkit.getPlayer(args[1]).getName().toLowerCase()+".jobs.job"+(i+1)+"lv");
|
||||
|
||||
if (mylv==40) {
|
||||
p.sendMessage("Lv"+mylv+" "+this.plugin.getJobColor(joblist[i])+joblist[i]+ChatColor.WHITE+": "+Math.round(this.plugin.getAccountsConfig().getInt(Bukkit.getPlayer(args[1]).getName()+".jobs.job"+(i+1)+"exp"))+"xp "+ChatColor.BLUE+(mylv>=5?"+Lv5 Buff":"")+ChatColor.GREEN+(mylv>=10?" +Lv10 Buff":"")+ChatColor.GOLD+(mylv>=20?" +Lv20 Buff":""));
|
||||
p.sendMessage("Lv"+mylv+" "+this.plugin.getJobColor(joblist[i])+joblist[i]+ChatColor.WHITE+": "+Math.round(this.plugin.getAccountsConfig().getInt(Bukkit.getPlayer(args[1]).getName().toLowerCase()+".jobs.job"+(i+1)+"exp"))+"xp "+ChatColor.BLUE+(mylv>=5?"+Lv5 Buff":"")+ChatColor.GREEN+(mylv>=10?" +Lv10 Buff":"")+ChatColor.GOLD+(mylv>=20?" +Lv20 Buff":""));
|
||||
} else {
|
||||
p.sendMessage("Lv"+mylv+" "+this.plugin.getJobColor(joblist[i])+joblist[i]+ChatColor.WHITE+": "+Math.round(this.plugin.getAccountsConfig().getInt(Bukkit.getPlayer(args[1]).getName()+".jobs.job"+(i+1)+"exp"))+"/"+Math.round(this.plugin.getJobExp(joblist[i], this.plugin.getAccountsConfig().getInt(Bukkit.getPlayer(args[1]).getName()+".jobs.job"+(i+1)+"lv")))+"xp "+ChatColor.BLUE+(mylv>=5?"+Lv5 Buff":"")+ChatColor.GREEN+(mylv>=10?" +Lv10 Buff":"")+ChatColor.GOLD+(mylv>=20?" +Lv20 Buff":""));
|
||||
p.sendMessage("Lv"+mylv+" "+this.plugin.getJobColor(joblist[i])+joblist[i]+ChatColor.WHITE+": "+Math.round(this.plugin.getAccountsConfig().getInt(Bukkit.getPlayer(args[1]).getName().toLowerCase()+".jobs.job"+(i+1)+"exp"))+"/"+Math.round(this.plugin.getJobExp(joblist[i], this.plugin.getAccountsConfig().getInt(Bukkit.getPlayer(args[1]).getName().toLowerCase()+".jobs.job"+(i+1)+"lv")))+"xp "+ChatColor.BLUE+(mylv>=5?"+Lv5 Buff":"")+ChatColor.GREEN+(mylv>=10?" +Lv10 Buff":"")+ChatColor.GOLD+(mylv>=20?" +Lv20 Buff":""));
|
||||
}
|
||||
|
||||
if (joblist[i].equalsIgnoreCase("Explorer") && this.plugin.getJobLv(joblist[i], Bukkit.getPlayer(args[1]))>=10) {
|
||||
@ -1974,7 +2170,7 @@ public String convertToItemName(String val) {
|
||||
boolean discovered=false;
|
||||
long timeleft=0;
|
||||
for (int j=0;j<this.plugin.explorers.size();j++) {
|
||||
if (this.plugin.explorers.get(j).name.compareToIgnoreCase(Bukkit.getPlayer(args[1]).getName())==0 && this.plugin.explorers.get(j).event==0) {
|
||||
if (this.plugin.explorers.get(j).name.compareToIgnoreCase(Bukkit.getPlayer(args[1]).getName().toLowerCase())==0 && this.plugin.explorers.get(j).event==0) {
|
||||
discovered=true;
|
||||
timeleft=this.plugin.explorers.get(j).expiretime-this.plugin.SERVER_TICK_TIME;
|
||||
}
|
||||
@ -1990,29 +2186,29 @@ public String convertToItemName(String val) {
|
||||
if (!found) {
|
||||
OfflinePlayer q = Bukkit.getOfflinePlayer(args[1]);
|
||||
//Try a search in the config directly.
|
||||
if (this.plugin.getAccountsConfig().contains(q.getName())) {
|
||||
if (this.plugin.getAccountsConfig().contains(q.getName().toLowerCase())) {
|
||||
//This player seems to exist. Check out their stats.
|
||||
p.sendMessage("");
|
||||
p.sendMessage(q.getName()+"'s jobs:");
|
||||
String[] joblist=this.plugin.getJobs(q.getName());
|
||||
p.sendMessage(q.getName().toLowerCase()+"'s jobs:");
|
||||
String[] joblist=this.plugin.getJobs(q.getName().toLowerCase());
|
||||
for (int i=0;i<joblist.length;i++) {
|
||||
if (joblist[i]!=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");
|
||||
int mylv=this.plugin.getAccountsConfig().getInt(q.getName().toLowerCase()+".jobs.job"+(i+1)+"lv");
|
||||
if (mylv==40) {
|
||||
p.sendMessage("Lv"+mylv+" "+this.plugin.getJobColor(joblist[i])+joblist[i]+ChatColor.WHITE+": "+Math.round(this.plugin.getAccountsConfig().getInt(q.getName()+".jobs.job"+(i+1)+"exp"))+"xp "+ChatColor.BLUE+(mylv>=5?"+Lv5 Buff":"")+ChatColor.GREEN+(mylv>=10?" +Lv10 Buff":"")+ChatColor.GOLD+(mylv>=20?" +Lv20 Buff":""));
|
||||
p.sendMessage("Lv"+mylv+" "+this.plugin.getJobColor(joblist[i])+joblist[i]+ChatColor.WHITE+": "+Math.round(this.plugin.getAccountsConfig().getInt(q.getName().toLowerCase()+".jobs.job"+(i+1)+"exp"))+"xp "+ChatColor.BLUE+(mylv>=5?"+Lv5 Buff":"")+ChatColor.GREEN+(mylv>=10?" +Lv10 Buff":"")+ChatColor.GOLD+(mylv>=20?" +Lv20 Buff":""));
|
||||
} else {
|
||||
p.sendMessage("Lv"+mylv+" "+this.plugin.getJobColor(joblist[i])+joblist[i]+ChatColor.WHITE+": "+Math.round(this.plugin.getAccountsConfig().getInt(q.getName()+".jobs.job"+(i+1)+"exp"))+"/"+Math.round(this.plugin.getJobExp(joblist[i], this.plugin.getAccountsConfig().getInt(q.getName()+".jobs.job"+(i+1)+"lv")))+"xp "+ChatColor.BLUE+(mylv>=5?"+Lv5 Buff":"")+ChatColor.GREEN+(mylv>=10?" +Lv10 Buff":"")+ChatColor.GOLD+(mylv>=20?" +Lv20 Buff":""));
|
||||
p.sendMessage("Lv"+mylv+" "+this.plugin.getJobColor(joblist[i])+joblist[i]+ChatColor.WHITE+": "+Math.round(this.plugin.getAccountsConfig().getInt(q.getName().toLowerCase()+".jobs.job"+(i+1)+"exp"))+"/"+Math.round(this.plugin.getJobExp(joblist[i], this.plugin.getAccountsConfig().getInt(q.getName().toLowerCase()+".jobs.job"+(i+1)+"lv")))+"xp "+ChatColor.BLUE+(mylv>=5?"+Lv5 Buff":"")+ChatColor.GREEN+(mylv>=10?" +Lv10 Buff":"")+ChatColor.GOLD+(mylv>=20?" +Lv20 Buff":""));
|
||||
}
|
||||
}
|
||||
if (joblist[i].equalsIgnoreCase("Explorer") && this.plugin.getJobLv(joblist[i], q.getName())>=10) {
|
||||
if (joblist[i].equalsIgnoreCase("Explorer") && this.plugin.getJobLv(joblist[i], q.getName().toLowerCase())>=10) {
|
||||
//Check to see if the buff is on cooldown for this player or not.
|
||||
boolean discovered=false;
|
||||
long timeleft=0;
|
||||
for (int j=0;j<this.plugin.explorers.size();j++) {
|
||||
if (this.plugin.explorers.get(j).name.compareToIgnoreCase(q.getName())==0 && this.plugin.explorers.get(j).event==0) {
|
||||
if (this.plugin.explorers.get(j).name.compareToIgnoreCase(q.getName().toLowerCase())==0 && this.plugin.explorers.get(j).event==0) {
|
||||
discovered=true;
|
||||
timeleft=this.plugin.explorers.get(j).expiretime-this.plugin.SERVER_TICK_TIME;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user