Add in ability to select ultimate, and defined a portal that can take
you to the dungeon area if you are allowed to.
This commit is contained in:
parent
124ec993ea
commit
163949e354
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -452,16 +452,16 @@ public class Main extends JavaPlugin
|
|||||||
Farmer_job.addData("CACTUS", 0.00, 3, 0);
|
Farmer_job.addData("CACTUS", 0.00, 3, 0);
|
||||||
Farmer_job.addData("BROWN MUSHROOM", 0.00, 3, 0);
|
Farmer_job.addData("BROWN MUSHROOM", 0.00, 3, 0);
|
||||||
Farmer_job.addData("RED MUSHROOM", 0.00, 3, 0);
|
Farmer_job.addData("RED MUSHROOM", 0.00, 3, 0);
|
||||||
Farmer_job.addData("WHEAT", 0.01, 2, 0);
|
Farmer_job.addData("WHEAT", 0.005, 2, 0);
|
||||||
Farmer_job.addData("CARROT", 0.01, 2, 0);
|
Farmer_job.addData("CARROT", 0.005, 2, 0);
|
||||||
Farmer_job.addData("POTATO", 0.03, 3, 0);
|
Farmer_job.addData("POTATO", 0.015, 3, 0);
|
||||||
Farmer_job.addData("NETHER WART", 0.03, 3, 0);
|
Farmer_job.addData("NETHER WART", 0.015, 3, 0);
|
||||||
//Farmer_job.addData("PUMPKIN SEEDS", 0.02, 4, 0);
|
//Farmer_job.addData("PUMPKIN SEEDS", 0.02, 4, 0);
|
||||||
//Farmer_job.addData("PUMPKIN", 0.04, 8, 0);
|
//Farmer_job.addData("PUMPKIN", 0.04, 8, 0);
|
||||||
Farmer_job.addData("MELON", 0.10, 10, 0);
|
Farmer_job.addData("MELON", 0.05, 10, 0);
|
||||||
Farmer_job.addData("SEEDS", 0.005, 1, 1);
|
Farmer_job.addData("SEEDS", 0.0025, 1, 1);
|
||||||
Farmer_job.addData("PUMPKIN SEEDS", 0.01, 2, 1);
|
Farmer_job.addData("PUMPKIN SEEDS", 0.005, 2, 1);
|
||||||
Farmer_job.addData("MELON SEEDS", 0.01, 2, 1);
|
Farmer_job.addData("MELON SEEDS", 0.005, 2, 1);
|
||||||
//Farmer_job.addData("PUMPKIN", 0.00, -16, 1);
|
//Farmer_job.addData("PUMPKIN", 0.00, -16, 1);
|
||||||
Farmer_job.setBuffData("Hoes do not lose durability when used.",
|
Farmer_job.setBuffData("Hoes do not lose durability when used.",
|
||||||
"Killing skeletons yields triple the amount of bones.",
|
"Killing skeletons yields triple the amount of bones.",
|
||||||
@ -3138,6 +3138,26 @@ public void payDay(int time)
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setUltimate(Player p, String job) {
|
||||||
|
boolean valid=false;
|
||||||
|
int matchedjob=0;
|
||||||
|
for (int i=0;i<ValidJobs.length;i++) {
|
||||||
|
if (job.equalsIgnoreCase(ValidJobs[i])) {
|
||||||
|
valid=true;
|
||||||
|
matchedjob=i;
|
||||||
|
Bukkit.getLogger().info("Found the job to set ultimate to.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!valid) {
|
||||||
|
p.sendMessage(ChatColor.GOLD+"Sorry, that is not a valid job!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
getAccountsConfig().set(p.getName()+".jobs.ultimate", String.valueOf(ValidJobs[matchedjob]));
|
||||||
|
saveAccountsConfig();
|
||||||
|
p.sendMessage(ChatColor.YELLOW+"Set Declared Ultimate job to "+job);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean joinJob(Player p, String job) {
|
public boolean joinJob(Player p, String job) {
|
||||||
//Verify this is a valid job we can join.
|
//Verify this is a valid job we can join.
|
||||||
boolean valid=false;
|
boolean valid=false;
|
||||||
|
@ -128,6 +128,7 @@ import org.bukkit.event.player.PlayerPickupItemEvent;
|
|||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
import org.bukkit.event.player.PlayerRespawnEvent;
|
import org.bukkit.event.player.PlayerRespawnEvent;
|
||||||
import org.bukkit.event.player.PlayerShearEntityEvent;
|
import org.bukkit.event.player.PlayerShearEntityEvent;
|
||||||
|
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||||
import org.bukkit.event.player.PlayerToggleSneakEvent;
|
import org.bukkit.event.player.PlayerToggleSneakEvent;
|
||||||
import org.bukkit.event.server.ServerListPingEvent;
|
import org.bukkit.event.server.ServerListPingEvent;
|
||||||
import org.bukkit.event.vehicle.VehicleEnterEvent;
|
import org.bukkit.event.vehicle.VehicleEnterEvent;
|
||||||
@ -1179,6 +1180,8 @@ public class PlayerListener
|
|||||||
this.plugin.getAccountsConfig().set(p.getName() + ".jobs.job3", String.valueOf("None"));
|
this.plugin.getAccountsConfig().set(p.getName() + ".jobs.job3", String.valueOf("None"));
|
||||||
this.plugin.getAccountsConfig().set(p.getName() + ".jobs.job3lv", Integer.valueOf(0));
|
this.plugin.getAccountsConfig().set(p.getName() + ".jobs.job3lv", Integer.valueOf(0));
|
||||||
this.plugin.getAccountsConfig().set(p.getName() + ".jobs.job3exp", Double.valueOf(0.0d));
|
this.plugin.getAccountsConfig().set(p.getName() + ".jobs.job3exp", Double.valueOf(0.0d));
|
||||||
|
this.plugin.getAccountsConfig().set(p.getName() + ".jobs.ultimate", String.valueOf("None"));
|
||||||
|
this.plugin.getAccountsConfig().set(p.getName() + ".jobs.ultimatesealed", Boolean.valueOf(false));
|
||||||
this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat1", Integer.valueOf(0));
|
this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat1", Integer.valueOf(0));
|
||||||
this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat2", Integer.valueOf(0));
|
this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat2", Integer.valueOf(0));
|
||||||
this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat3", Integer.valueOf(0));
|
this.plugin.getAccountsConfig().set(p.getName() + ".stats.stat3", Integer.valueOf(0));
|
||||||
@ -1195,6 +1198,16 @@ public class PlayerListener
|
|||||||
this.plugin.getAccountsConfig().set(p.getName() + ".settings.notify4", Boolean.valueOf(false));
|
this.plugin.getAccountsConfig().set(p.getName() + ".settings.notify4", Boolean.valueOf(false));
|
||||||
this.plugin.getAccountsConfig().set(p.getName() + ".settings.notify5", Boolean.valueOf(false));
|
this.plugin.getAccountsConfig().set(p.getName() + ".settings.notify5", Boolean.valueOf(false));
|
||||||
this.plugin.getAccountsConfig().set(p.getName() + ".settings.notify6", Boolean.valueOf(false));
|
this.plugin.getAccountsConfig().set(p.getName() + ".settings.notify6", Boolean.valueOf(false));
|
||||||
|
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest1", Boolean.valueOf(false));
|
||||||
|
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest2", Boolean.valueOf(false));
|
||||||
|
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest3", Boolean.valueOf(false));
|
||||||
|
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest4", Boolean.valueOf(false));
|
||||||
|
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest5", Boolean.valueOf(false));
|
||||||
|
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest6", Boolean.valueOf(false));
|
||||||
|
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest7", Boolean.valueOf(false));
|
||||||
|
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest8", Boolean.valueOf(false));
|
||||||
|
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest9", Boolean.valueOf(false));
|
||||||
|
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest10", Boolean.valueOf(false));
|
||||||
this.plugin.saveAccountsConfig();
|
this.plugin.saveAccountsConfig();
|
||||||
System.out.println("[BankEconomy] Bank account created for " + p.getName() + ".");
|
System.out.println("[BankEconomy] Bank account created for " + p.getName() + ".");
|
||||||
if (playerwhitelisted) {
|
if (playerwhitelisted) {
|
||||||
@ -1283,6 +1296,10 @@ public class PlayerListener
|
|||||||
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest9", Boolean.valueOf(false));
|
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest9", Boolean.valueOf(false));
|
||||||
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest10", Boolean.valueOf(false));
|
this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest10", Boolean.valueOf(false));
|
||||||
}
|
}
|
||||||
|
if (!this.plugin.getAccountsConfig().contains(p.getName() + ".jobs.ultimate")) {
|
||||||
|
this.plugin.getAccountsConfig().set(p.getName() + ".jobs.ultimate", String.valueOf("None"));
|
||||||
|
this.plugin.getAccountsConfig().set(p.getName() + ".jobs.ultimatesealed", Boolean.valueOf(false));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//Check if this player has unallocated stat points.
|
//Check if this player has unallocated stat points.
|
||||||
if (this.plugin.getStatPointTotal(p)<this.plugin.getJobTotalLvs(p)/5+1) {
|
if (this.plugin.getStatPointTotal(p)<this.plugin.getJobTotalLvs(p)/5+1) {
|
||||||
@ -1348,6 +1365,22 @@ public class PlayerListener
|
|||||||
updateTopSPLEEFSigns();
|
updateTopSPLEEFSigns();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPortalEnter(PlayerTeleportEvent e) {
|
||||||
|
if (e.getPlayer().getLocation().distanceSquared(new Location(Bukkit.getWorld("world"),1606d,66d,-365d))<900) {
|
||||||
|
//This is a player trying to enter a portal. Verify if they have selected their ultimate.
|
||||||
|
if (this.plugin.getAccountsConfig().contains(e.getPlayer().getName()+".jobs.ultimate")) {
|
||||||
|
//Check if this job's ultimate level is high enough.
|
||||||
|
if (this.plugin.getJobLv(this.plugin.getAccountsConfig().getString(e.getPlayer().getName()+".jobs.ultimate"), e.getPlayer())>=40) {
|
||||||
|
//Allow this teleport.
|
||||||
|
e.setTo(new Location(Bukkit.getWorld("world"),-8990,68,-4));
|
||||||
|
} else {
|
||||||
|
e.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerInteract(PlayerInteractEntityEvent ev) {
|
public void onPlayerInteract(PlayerInteractEntityEvent ev) {
|
||||||
Entity theAnimal = ev.getRightClicked();
|
Entity theAnimal = ev.getRightClicked();
|
||||||
@ -2722,13 +2755,13 @@ public class PlayerListener
|
|||||||
this.plugin.gainMoneyExp(p,"Farmer",0.03,3);
|
this.plugin.gainMoneyExp(p,"Farmer",0.03,3);
|
||||||
}
|
}
|
||||||
if (e.getBlock().getType()==Material.BROWN_MUSHROOM) {
|
if (e.getBlock().getType()==Material.BROWN_MUSHROOM) {
|
||||||
this.plugin.gainMoneyExp(p,"Farmer",0.00,1);
|
this.plugin.gainMoneyExp(p,"Farmer",0.00,3);
|
||||||
}
|
}
|
||||||
if (e.getBlock().getType()==Material.RED_MUSHROOM) {
|
if (e.getBlock().getType()==Material.RED_MUSHROOM) {
|
||||||
this.plugin.gainMoneyExp(p,"Farmer",0.00,1);
|
this.plugin.gainMoneyExp(p,"Farmer",0.00,3);
|
||||||
}
|
}
|
||||||
if (e.getBlock().getType()==Material.NETHER_WARTS && e.getBlock().getData()==3) {
|
if (e.getBlock().getType()==Material.NETHER_WARTS && e.getBlock().getData()==3) {
|
||||||
this.plugin.gainMoneyExp(p,"Farmer",0.00,1);
|
this.plugin.gainMoneyExp(p,"Farmer",0.03,3);
|
||||||
}
|
}
|
||||||
/*if (e.getBlock().getType()==Material.PUMPKIN) {
|
/*if (e.getBlock().getType()==Material.PUMPKIN) {
|
||||||
this.plugin.gainMoneyExp(p,"Farmer",0.00,1);
|
this.plugin.gainMoneyExp(p,"Farmer",0.00,1);
|
||||||
|
@ -716,6 +716,10 @@ public class commandBankEconomy
|
|||||||
if (cmd.getName().equalsIgnoreCase("jobs") && args.length == 1 && args[0].equalsIgnoreCase("buffs")) {
|
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.");
|
p.sendMessage("Usage: "+ChatColor.GREEN+"/jobs buffs [JobName]"+ChatColor.WHITE+" - Get buffs information about a job. Type /jobs to see the jobs.");
|
||||||
} else
|
} else
|
||||||
|
if (cmd.getName().equalsIgnoreCase("jobs") && args.length == 2 && args[0].equalsIgnoreCase("ultimate")) {
|
||||||
|
//Attempt to join the job.
|
||||||
|
this.plugin.setUltimate(p,args[1]);
|
||||||
|
} else
|
||||||
if (cmd.getName().equalsIgnoreCase("jobs") && args.length == 2 && args[0].equalsIgnoreCase("join")) {
|
if (cmd.getName().equalsIgnoreCase("jobs") && args.length == 2 && args[0].equalsIgnoreCase("join")) {
|
||||||
//Attempt to join the job.
|
//Attempt to join the job.
|
||||||
this.plugin.joinJob(p,args[1]);
|
this.plugin.joinJob(p,args[1]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user