r270. Bugfixes!

anvil_rework
sigonasr2 11 years ago
parent 23ff12f9b7
commit 7e82f339b5
  1. BIN
      BankEconomyMod/bin/me/kaZep/Base/Main$1.class
  2. BIN
      BankEconomyMod/bin/me/kaZep/Base/Main$2.class
  3. BIN
      BankEconomyMod/bin/me/kaZep/Base/Main$3.class
  4. BIN
      BankEconomyMod/bin/me/kaZep/Base/Main$4.class
  5. BIN
      BankEconomyMod/bin/me/kaZep/Base/Main.class
  6. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$1.class
  7. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$2.class
  8. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$3.class
  9. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$4.class
  10. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$5.class
  11. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$6.class
  12. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener.class
  13. BIN
      BankEconomyMod/bin/me/kaZep/Commands/commandBankEconomy.class
  14. 78
      BankEconomyMod/src/me/kaZep/Base/Main.java
  15. 586
      BankEconomyMod/src/me/kaZep/Base/PlayerListener.java
  16. 50
      BankEconomyMod/src/me/kaZep/Commands/commandBankEconomy.java

@ -1440,18 +1440,18 @@ public void runTick() {
l.setCustomName(ChatColor.GOLD+"Venomous Spider II");
l.setCustomNameVisible(false);
//l.setCustomNameVisible(true);
l.setMaxHealth(l.getMaxHealth()*2);
l.setMaxHealth(l.getMaxHealth()*1.5);
} else
if (Math.random()<=0.35) {
l.setCustomName(ChatColor.YELLOW+"Snaring Spider");
l.setCustomNameVisible(false);
//l.setCustomNameVisible(true);
l.setMaxHealth(l.getMaxHealth()*2);
l.setMaxHealth(l.getMaxHealth()*1.5);
} else {
l.setCustomName(ChatColor.GOLD+"Snaring Spider II");
l.setCustomNameVisible(false);
//l.setCustomNameVisible(true);
l.setMaxHealth(l.getMaxHealth()*4);
l.setMaxHealth(l.getMaxHealth()*2);
}
l.setHealth(l.getMaxHealth());
}
@ -1486,14 +1486,14 @@ public void runTick() {
l.setCustomName(ChatColor.YELLOW+"Charge Zombie");
l.setCustomNameVisible(false);
//l.setCustomNameVisible(true);
l.setMaxHealth(l.getMaxHealth()+20);
l.setMaxHealth(l.getMaxHealth()+5);
} else {
l.setCustomName(ChatColor.GOLD+"Charge Zombie II");
l.setCustomNameVisible(false);
//l.setCustomNameVisible(true);
l.setMaxHealth(l.getMaxHealth()+60);
l.setMaxHealth(l.getMaxHealth()+20);
}
l.setHealth(l.getMaxHealth());
l.setHealth(l.getMaxHealth()*0.95d);
} else {
if (Math.random()<=0.10+((heightmodifier-l.getLocation().getY())*0.01d)) {
if (Math.random()<=0.25) {
@ -1509,7 +1509,8 @@ public void runTick() {
l.getEquipment().setHelmet(new ItemStack(Material.AIR));
Zombie g = (Zombie)l;
g.setBaby(true);
l.setMaxHealth(l.getMaxHealth()+20);
//l.setMaxHealth(l.getMaxHealth()+20);
l.setHealth(l.getMaxHealth()*0.65d);
}
}
}
@ -2858,9 +2859,12 @@ public void checkJukeboxes() {
Iterator<PotionEffect> effects = p2.getActivePotionEffects().iterator();
while (effects.hasNext()) {
PotionEffect pot = effects.next();
if (pot.getType()==PotionEffectType.DAMAGE_RESISTANCE) {
if (pot.getType().getName().equalsIgnoreCase(PotionEffectType.DAMAGE_RESISTANCE.getName())) {
get_resistance_level=pot.getAmplifier();
//Bukkit.broadcastMessage("Got REsistance of "+pot.getAmplifier());
break;
} else {
//Bukkit.broadcastMessage("Got buff of "+pot.getType());
}
}
if (get_resistance_level<1) {
@ -2880,9 +2884,12 @@ public void checkJukeboxes() {
Iterator<PotionEffect> effects = p2.getActivePotionEffects().iterator();
while (effects.hasNext()) {
PotionEffect pot = effects.next();
if (pot.getType()==PotionEffectType.DAMAGE_RESISTANCE) {
if (pot.getType().getName().equalsIgnoreCase(PotionEffectType.DAMAGE_RESISTANCE.getName())) {
get_resistance_level=pot.getAmplifier();
//Bukkit.broadcastMessage("Got REsistance of "+pot.getAmplifier());
break;
} else {
//Bukkit.broadcastMessage("Got buff of "+pot.getType());
}
}
if (get_resistance_level<0) {
@ -3238,11 +3245,7 @@ public void updateTime() {
last_world_time+=2;
raisecount++;
}
if (!harrowing_night) {
Bukkit.getWorld("world").setFullTime(Bukkit.getWorld("world").getFullTime()-raisecount);
} else {
Bukkit.getWorld("world").setFullTime(last_world_time);
}
/*
if (Bukkit.getWorld("world").getFullTime()-last_world_time+hold_diff>=2) {
last_world_time = Bukkit.getWorld("world").getFullTime()+((Bukkit.getWorld("world").getFullTime()-last_world_time+(hold_diff/2))/2);
@ -3621,6 +3624,10 @@ public void payDay(int time)
JobsDataInfo info = Jobsinfo[getJobSlot(job)];
economy.depositPlayer(p.getName(), amount*(1d+(info.moneymult*getAccountsConfig().getInt(p.getName()+".jobs.job"+(slot+1)+"lv"))));
getAccountsConfig().set(p.getName()+".jobs.job"+(slot+1)+"exp", Double.valueOf(getAccountsConfig().getDouble(p.getName()+".jobs.job"+(slot+1)+"exp")+exp));
if (getAccountsConfig().getDouble(p.getName()+".jobs.job"+(slot+1)+"exp")<0) {
//It can't be negative.
getAccountsConfig().set(p.getName()+".jobs.job"+(slot+1)+"exp", Double.valueOf(0.0));
}
//Check for lv up.
if (getJobLv(job,p)<40 && getJobExp(job,getAccountsConfig().getInt(p.getName()+".jobs.job"+(slot+1)+"lv"))<=getAccountsConfig().getDouble(p.getName()+".jobs.job"+(slot+1)+"exp")) {
//Level up! Level up! YEAH!
@ -3637,6 +3644,51 @@ public void payDay(int time)
saveAccountsConfig();
}
public void levelUpJob(Player p, String job) {
//If they have a job token, then do this. Otherwise they are not allowed.
boolean has_job_token=false;
ItemStack j = new ItemStack(Material.getMaterial(34));
ItemMeta meta = j.getItemMeta();
meta.setDisplayName(ChatColor.LIGHT_PURPLE+"Job Boost Card");
List<String> lore = new ArrayList<String>();
lore.add("Use /jobs boost <jobname> to instantly level up");
lore.add("that job with this card!");
meta.setLore(lore);
j.setItemMeta(meta);
if (p.getInventory().containsAtLeast(j, 1)) {
String[] jobs = getJobs(p);
int slot=-1;
JobsDataInfo[] Jobsinfo = {Woodcutter_job,Miner_job,Builder_job,Digger_job,Farmer_job,Hunter_job,Fisherman_job,Weaponsmith_job,Blacksmith_job,Cook_job,Brewer_job,Enchanter_job,Breeder_job,Explorer_job,Support_job};
for (int i=0;i<jobs.length;i++) {
if (job.equalsIgnoreCase(jobs[i])) {
slot=i;
break;
}
}
if (slot!=-1) {
JobsDataInfo info = Jobsinfo[getJobSlot(job)];
if (getJobLv(job,p)<40) {
getAccountsConfig().set(p.getName()+".jobs.job"+(slot+1)+"lv", Integer.valueOf(getAccountsConfig().getInt(p.getName()+".jobs.job"+(slot+1)+"lv")+1));
Bukkit.broadcastMessage(p.getName()+" is now a Level "+getAccountsConfig().getInt(p.getName()+".jobs.job"+(slot+1)+"lv")+" "+getJobColor(job)+job+ChatColor.WHITE+".");
if (getJobTotalLvs(p)%5==0) {
Bukkit.broadcastMessage(ChatColor.GREEN+p.getName()+" has reached Level "+getJobTotalLvs(p)+"!");
if ((((getJobTotalLvs(p)/5+1)-getStatPointTotal(p)))>0) {
p.sendMessage(ChatColor.GOLD+"You have earned 1 stat point! You now have "+(((getJobTotalLvs(p)/5+1)-getStatPointTotal(p)))+" stat point"+((((getJobTotalLvs(p)/5+1)-getStatPointTotal(p)))==1?"":"s")+" to spend. "+ChatColor.ITALIC+ChatColor.BLUE+" Type /sp to spend them!");
}
}
saveAccountsConfig();
p.getInventory().removeItem(j);
} else {
p.sendMessage(ChatColor.GOLD+"You can't level this job. It is already at max level.");
}
} else {
p.sendMessage(ChatColor.GOLD+"Sorry, that is not a valid job!");
}
} else {
p.sendMessage(ChatColor.GOLD+"Sorry, you cannot do this!");
}
}
public void gainMoney(Player p,String job,double amount) {
String[] jobs = getJobs(p);
int slot=-1;

File diff suppressed because it is too large Load Diff

@ -30,6 +30,8 @@ import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.MerchantInventory;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import com.sk89q.worldedit.CuboidClipboard;
import com.sk89q.worldedit.EditSession;
@ -491,6 +493,21 @@ public String convertToItemName(String val) {
}
} else
if (cmd.getName().equalsIgnoreCase("event") && args.length==2 && p.hasPermission("maintenance-mode-admin")) {
if (args[0].equalsIgnoreCase("halloween_reward")) {
Bukkit.broadcastMessage(args[1]+" has won the Pumpkin Patch contest due to popular vote! "+ChatColor.BOLD+"Congratulations!");
Player f = Bukkit.getPlayer(args[1]);
f.sendMessage("You have received $800 in holding money, and 5 Job Boost cards!");
this.plugin.economy.depositPlayer(args[1], 800);
ItemStack i = new ItemStack(Material.getMaterial(34),5);
ItemMeta meta = i.getItemMeta();
meta.setDisplayName(ChatColor.LIGHT_PURPLE+"Job Boost Card");
List<String> lore = new ArrayList<String>();
lore.add("Use /jobs boost <jobname> to instantly level up");
lore.add("that job with this card!");
meta.setLore(lore);
i.setItemMeta(meta);
f.getInventory().addItem(i);
}
if (args[0].equalsIgnoreCase("halloween") && args[1].equalsIgnoreCase("end")) {
p.sendMessage(ChatColor.GRAY+"Ending Harrowing night... Did you make sure it was night time? If not, type this command again after /time night instead.");
this.plugin.harrowing_night=true;
@ -844,6 +861,12 @@ public String convertToItemName(String val) {
}
ItemMeta meta1 = item.getItemMeta();
meta1.setLore(ourLore);
if (rarity==1) {
meta.setDisplayName(ChatColor.BLUE+"Rare "+convertToItemName(item.getType().name().replace("_", " ")));
}
if (rarity==2) {
meta.setDisplayName(ChatColor.YELLOW+""+ChatColor.BOLD+"Legendary "+convertToItemName(item.getType().name().replace("_", " ")));
}
item.setItemMeta(meta1);
} else if (type2.equalsIgnoreCase("SPADE") || type2.equalsIgnoreCase("PICKAXE") || type2.equalsIgnoreCase("HOE") || type2.equalsIgnoreCase("AXE")) {
int enchants[] = {32,33,34,35};
@ -896,6 +919,12 @@ public String convertToItemName(String val) {
}
ItemMeta meta1 = item.getItemMeta();
meta1.setLore(ourLore);
if (rarity==1) {
meta.setDisplayName(ChatColor.BLUE+"Rare "+convertToItemName(item.getType().name().replace("_", " ")));
}
if (rarity==2) {
meta.setDisplayName(ChatColor.YELLOW+""+ChatColor.BOLD+"Legendary "+convertToItemName(item.getType().name().replace("_", " ")));
}
item.setItemMeta(meta1);
} else {
int enchants[] = {0,1,2,3,4,5,6,7,34};
@ -977,10 +1006,10 @@ public String convertToItemName(String val) {
ItemMeta meta1 = item.getItemMeta();
meta1.setLore(ourLore);
if (rarity==1) {
meta1.setDisplayName(ChatColor.BLUE+"Rare "+item.getType().name().replace("_", " "));
meta.setDisplayName(ChatColor.BLUE+"Rare "+convertToItemName(item.getType().name().replace("_", " ")));
}
if (rarity==2) {
meta1.setDisplayName(ChatColor.YELLOW+""+ChatColor.BOLD+"Legendary "+item.getType().name().replace("_", " "));
meta.setDisplayName(ChatColor.YELLOW+""+ChatColor.BOLD+"Legendary "+convertToItemName(item.getType().name().replace("_", " ")));
}
item.setItemMeta(meta1);
}
@ -1002,6 +1031,9 @@ public String convertToItemName(String val) {
wand_meta.setLore(newLore);
wand.setItemMeta(wand_meta);
p.getInventory().addItem(wand);
p.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE,1728000,1));
p.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST,1728000,1));
p.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION,1728000,0));
}
}
},400);
@ -1395,7 +1427,7 @@ public String convertToItemName(String val) {
double deathZ = this.plugin.getAccountsConfig().getDouble(p.getName() + ".deathpointZ");
String deathWorld = this.plugin.getAccountsConfig().getString(p.getName() + ".deathworld");
//p.sendMessage("Got 1.");
if (this.plugin.getAccountsConfig().getBoolean(p.getName() + ".revived")==false && p.getPlayerTime()-this.plugin.getAccountsConfig().getDouble(p.getName() + ".revivetime")<12000) {
if (this.plugin.getAccountsConfig().getBoolean(p.getName() + ".revived")==false && p.getPlayerTime()-this.plugin.getAccountsConfig().getLong(p.getName() + ".revivetime")<12000) {
double mincost = this.plugin.getConfig().getDouble("revive-cost-rate");
//p.sendMessage("Got 2.");
if (p.getBedSpawnLocation()!=null) {
@ -1412,7 +1444,7 @@ public String convertToItemName(String val) {
if (mymoney>=finalcost) {
this.plugin.getAccountsConfig().set(p.getName() + ".revived", Boolean.valueOf(true));
this.plugin.getAccountsConfig().set(p.getName() + ".money", mymoney-finalcost);
this.plugin.getAccountsConfig().set(p.getName() + ".revivetime", Double.valueOf(0.0d));
this.plugin.getAccountsConfig().set(p.getName() + ".revivetime", Long.valueOf(0));
this.plugin.saveAccountsConfig();
//p.sendMessage("Got 4.");
p.sendMessage("You spent $"+df.format(finalcost)+" to revive. New Bank Balance: $"+ChatColor.YELLOW+df.format(mymoney-finalcost));
@ -1479,7 +1511,7 @@ public String convertToItemName(String val) {
double mymoney = this.plugin.getAccountsConfig().getDouble(p.getName() + ".money");
double finalcost = Math.abs(p.getLocation().getX()-otherx)+Math.abs(p.getLocation().getY()-othery)+Math.abs(p.getLocation().getZ()-otherz);
finalcost *= this.plugin.getConfig().getDouble("teleport-cost-rate");
finalcost += mymoney*this.plugin.getConfig().getDouble("teleport-cost-tax");
//finalcost += mymoney*this.plugin.getConfig().getDouble("teleport-cost-tax");
if (mymoney>=finalcost) {
//Allow teleport to occur.
this.plugin.getAccountsConfig().set(p.getName() + ".money", mymoney-finalcost);
@ -1504,7 +1536,7 @@ public String convertToItemName(String val) {
double mymoney = this.plugin.getAccountsConfig().getDouble(p.getName() + ".money");
double finalcost = Math.abs(p.getLocation().getX()-otherx)+Math.abs(p.getLocation().getY()-othery)+Math.abs(p.getLocation().getZ()-otherz);
finalcost *= this.plugin.getConfig().getDouble("teleport-cost-rate");
finalcost += mymoney*this.plugin.getConfig().getDouble("teleport-cost-tax");
//finalcost += mymoney*this.plugin.getConfig().getDouble("teleport-cost-tax");
if (mymoney>=finalcost) {
//Allow teleport to occur.
p.sendMessage("Teleporting to "+ChatColor.GREEN+target.getName()+ChatColor.WHITE+" costs $"+ChatColor.YELLOW+df.format(finalcost)+". Type the command again to teleport.");
@ -1533,7 +1565,7 @@ public String convertToItemName(String val) {
double mymoney = this.plugin.getAccountsConfig().getDouble(p.getName() + ".money");
double finalcost = Math.abs(p.getLocation().getX()-otherx)+Math.abs(p.getLocation().getY()-othery)+Math.abs(p.getLocation().getZ()-otherz);
finalcost *= this.plugin.getConfig().getDouble("teleport-cost-rate");
finalcost += mymoney*this.plugin.getConfig().getDouble("teleport-cost-tax");
//finalcost += mymoney*this.plugin.getConfig().getDouble("teleport-cost-tax");
if (mymoney>=finalcost) {
//Allow teleport to occur.
p.sendMessage("Teleporting to "+ChatColor.GREEN+target.getName()+ChatColor.WHITE+" costs $"+ChatColor.YELLOW+df.format(finalcost)+". Type the command again to teleport.");
@ -1565,6 +1597,10 @@ public String convertToItemName(String val) {
//Attempt to join the job.
this.plugin.setUltimate(p,args[1]);
} else
if (cmd.getName().equalsIgnoreCase("jobs") && args.length == 2 && args[0].equalsIgnoreCase("boost")) {
//Attempt to level up the job.
this.plugin.levelUpJob(p,args[1]);
} else
if (cmd.getName().equalsIgnoreCase("jobs") && args.length == 2 && args[0].equalsIgnoreCase("join")) {
//Attempt to join the job.
this.plugin.joinJob(p,args[1]);

Loading…
Cancel
Save