r261. Propogating changes.

anvil_rework
sigonasr2 11 years ago
parent 1a418e7650
commit 903dbfa91a
  1. BIN
      BankEconomyMod/bin/me/kaZep/Base/Main$1.class
  2. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$6.class
  3. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener.class
  4. BIN
      BankEconomyMod/bin/me/kaZep/Commands/commandBankEconomy.class
  5. 2
      BankEconomyMod/src/me/kaZep/Base/Main.java
  6. 158
      BankEconomyMod/src/me/kaZep/Base/PlayerListener.java
  7. 30
      BankEconomyMod/src/me/kaZep/Commands/commandBankEconomy.java

@ -1569,7 +1569,7 @@ public void runTick() {
}
if (doit) {
//Bukkit.getPlayer("sigonasr2").sendMessage("Charge Zombie!");
if (l.getCustomName().compareTo(ChatColor.DARK_PURPLE+"Charge Zombie III")==0) {
if (l.getCustomName().compareTo(ChatColor.DARK_PURPLE+"Charge Zombie III")==0 && !l.isDead()) {
/*//OLD CHARGE ZOMBIE BEHAVIOR. Charge Zombie II now does this weak block destruction.
for (int k=-1;k<2;k++) {
for (int j=-1;j<2;j++) {

@ -6217,6 +6217,7 @@ public ItemStack getGoodie() {
eve.data2=p.getLevel();
eve.expiretime=Bukkit.getWorld("world").getFullTime()+1200;
this.plugin.explorers.add(eve);
if (!survivor) {
Bukkit.getScheduler().scheduleSyncDelayedTask(this.plugin, new Runnable() {
@Override
public void run() {
@ -6227,9 +6228,11 @@ public ItemStack getGoodie() {
},1);
}
}
}
//e.getCause()==DamageCause.
final double player_starthp = p.getHealth();
if (p.getNoDamageTicks()<p.getMaximumNoDamageTicks()/2.0f && this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify5") && e.getCause()!=DamageCause.ENTITY_ATTACK && e.getCause()!=DamageCause.ENTITY_EXPLOSION && e.getDamage()!=0) {
final Main plugin = this.plugin;
Bukkit.getScheduler().scheduleSyncDelayedTask(this.plugin, new Runnable() {
@Override
public void run() {
@ -6238,10 +6241,30 @@ public ItemStack getGoodie() {
if (player_starthp-p.getHealth()>=0.5) {
p.sendMessage(ChatColor.DARK_PURPLE+""+ChatColor.ITALIC+"Took "+df.format(player_starthp-p.getHealth())+" damage from "+ChatColor.WHITE+f.getCause().toString()+ChatColor.DARK_PURPLE+""+ChatColor.ITALIC+" (-"+df2.format(((player_starthp-p.getHealth())/p.getMaxHealth())*100)+"%)");
}
if (plugin.PlayerinJob(p, "Explorer")) {
if (plugin.getJobLv("Explorer", p)>=10) {
//Check to see if our "fatal s urvivor" effect is available.
boolean survivor=false;
for (int i=0;i<plugin.explorers.size();i++) {
if (plugin.explorers.get(i).event==0 && plugin.explorers.get(i).name.compareTo(p.getName())==0) {
survivor=true;
break;
}
}
PersistentExplorerList eve = new PersistentExplorerList(p.getName());
eve.event=1;
eve.data=p.getExp();
eve.data2=p.getLevel();
eve.expiretime=Bukkit.getWorld("world").getFullTime()+1200;
plugin.explorers.add(eve);
if (!survivor) {
if (p.getHealth()<=0) {
FatalSurvivor(p);
}
}
}
}
}
},1);
}
}
@ -6531,10 +6554,30 @@ public ItemStack getGoodie() {
} else {
p.sendMessage(ChatColor.DARK_PURPLE+""+ChatColor.ITALIC+"Took "+df.format(player_starthp-p.getHealth())+" damage from "+ChatColor.WHITE+l.getType()+ChatColor.DARK_PURPLE+""+ChatColor.ITALIC+" (-"+df2.format(((player_starthp-p.getHealth())/p.getMaxHealth())*100)+"%)");
}
if (plugin.PlayerinJob(p, "Explorer")) {
if (plugin.getJobLv("Explorer", p)>=10) {
//Check to see if our "fatal s urvivor" effect is available.
boolean survivor=false;
for (int i=0;i<plugin.explorers.size();i++) {
if (plugin.explorers.get(i).event==0 && plugin.explorers.get(i).name.compareTo(p.getName())==0) {
survivor=true;
break;
}
}
PersistentExplorerList eve = new PersistentExplorerList(p.getName());
eve.event=1;
eve.data=p.getExp();
eve.data2=p.getLevel();
eve.expiretime=Bukkit.getWorld("world").getFullTime()+1200;
plugin.explorers.add(eve);
if (!survivor) {
if (p.getHealth()<=0) {
FatalSurvivor(p);
}
}
}
}
}
},1);
}
@ -7019,7 +7062,30 @@ public ItemStack getGoodie() {
}
} else {
e.setDamage(0);
FatalSurvivor(p); //Player died. Instead run fatal survivor.
final Player p2 = p;
if (plugin.PlayerinJob(p, "Explorer")) {
if (plugin.getJobLv("Explorer", p)>=10) {
//Check to see if our "fatal s urvivor" effect is available.
boolean survivor=false;
for (int i=0;i<plugin.explorers.size();i++) {
if (plugin.explorers.get(i).event==0 && plugin.explorers.get(i).name.compareTo(p.getName())==0) {
survivor=true;
break;
}
}
PersistentExplorerList eve = new PersistentExplorerList(p.getName());
eve.event=1;
eve.data=p.getExp();
eve.data2=p.getLevel();
eve.expiretime=Bukkit.getWorld("world").getFullTime()+1200;
plugin.explorers.add(eve);
if (!survivor) {
if (p2.getHealth()<=0) {
FatalSurvivor(p2);
}
}
}
}
}
} else {
if (p.getHealth()-e.getDamage()/2>0) {
@ -7029,7 +7095,35 @@ public ItemStack getGoodie() {
}
} else {
e.setDamage(0);
FatalSurvivor(p); //Player died. Instead run fatal survivor.
final Player p2 = p;
if (plugin.PlayerinJob(p, "Explorer")) {
if (plugin.getJobLv("Explorer", p)>=10) {
//Check to see if our "fatal s urvivor" effect is available.
boolean survivor=false;
for (int i=0;i<plugin.explorers.size();i++) {
if (plugin.explorers.get(i).event==0 && plugin.explorers.get(i).name.compareTo(p.getName())==0) {
survivor=true;
break;
}
}
PersistentExplorerList eve = new PersistentExplorerList(p.getName());
eve.event=1;
eve.data=p.getExp();
eve.data2=p.getLevel();
eve.expiretime=Bukkit.getWorld("world").getFullTime()+1200;
plugin.explorers.add(eve);
if (!survivor) {
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
@Override
public void run() {
if (p2.getHealth()<=0) {
FatalSurvivor(p2);
}
}
},1);
}
}
}
}
}
e.setDamage(0);
@ -7063,7 +7157,35 @@ public ItemStack getGoodie() {
}
} else {
e.setDamage(0);
FatalSurvivor(p); //Player died. Instead run fatal survivor.
final Player p2 = p;
if (plugin.PlayerinJob(p, "Explorer")) {
if (plugin.getJobLv("Explorer", p)>=10) {
//Check to see if our "fatal s urvivor" effect is available.
boolean survivor=false;
for (int i=0;i<plugin.explorers.size();i++) {
if (plugin.explorers.get(i).event==0 && plugin.explorers.get(i).name.compareTo(p.getName())==0) {
survivor=true;
break;
}
}
PersistentExplorerList eve = new PersistentExplorerList(p.getName());
eve.event=1;
eve.data=p.getExp();
eve.data2=p.getLevel();
eve.expiretime=Bukkit.getWorld("world").getFullTime()+1200;
plugin.explorers.add(eve);
if (!survivor) {
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
@Override
public void run() {
if (p2.getHealth()<=0) {
FatalSurvivor(p2);
}
}
},1);
}
}
}
}
} else {
if (p.getHealth()-e.getDamage()>0) {
@ -7073,7 +7195,35 @@ public ItemStack getGoodie() {
}
} else {
e.setDamage(0);
FatalSurvivor(p); //Player died. Instead run fatal survivor.
final Player p2 = p;
if (plugin.PlayerinJob(p, "Explorer")) {
if (plugin.getJobLv("Explorer", p)>=10) {
//Check to see if our "fatal s urvivor" effect is available.
boolean survivor=false;
for (int i=0;i<plugin.explorers.size();i++) {
if (plugin.explorers.get(i).event==0 && plugin.explorers.get(i).name.compareTo(p.getName())==0) {
survivor=true;
break;
}
}
PersistentExplorerList eve = new PersistentExplorerList(p.getName());
eve.event=1;
eve.data=p.getExp();
eve.data2=p.getLevel();
eve.expiretime=Bukkit.getWorld("world").getFullTime()+1200;
plugin.explorers.add(eve);
if (!survivor) {
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
@Override
public void run() {
if (p2.getHealth()<=0) {
FatalSurvivor(p2);
}
}
},1);
}
}
}
}
}
for (int k=-2;k<3;k++) {

@ -17,7 +17,9 @@ import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.OfflinePlayer;
import org.bukkit.Server;
import org.bukkit.SkullType;
import org.bukkit.World;
import org.bukkit.block.Skull;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
@ -32,6 +34,7 @@ import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.MerchantInventory;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.SkullMeta;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
@ -495,6 +498,14 @@ public String convertToItemName(String val) {
}
} else
if (cmd.getName().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();
skullMeta.setOwner(args[1]);
skullMeta.setDisplayName(ChatColor.RESET + args[1]+"'s Head");
m.setItemMeta(skullMeta);
p.getInventory().addItem(m);
}
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]);
@ -1477,7 +1488,7 @@ public String convertToItemName(String val) {
}
}
//p.sendMessage("Got 7.");
Bukkit.broadcastMessage(ChatColor.GREEN+p.getName()+ChatColor.WHITE+" decided to revive to their death location.");
Bukkit.broadcastMessage(ChatColor.GREEN+p.getName()+ChatColor.WHITE+" decided to revive.");
} else {
p.sendMessage("You cannot revive. You need to have $"+df.format(finalcost)+" to do so.");
}
@ -1761,27 +1772,27 @@ public String convertToItemName(String val) {
} else {
//Look for that player. First just see if they are online.
boolean found=false;
if (p.getServer().getPlayer(args[1])!=null) {
if (Bukkit.getPlayer(args[1])!=null) {
//This is the player. Show job stats.
p.sendMessage("");
p.sendMessage(p.getServer().getPlayer(args[1]).getName()+"'s jobs:");
String[] joblist=this.plugin.getJobs(p.getServer().getPlayer(args[1]));
p.sendMessage(Bukkit.getPlayer(args[1]).getName()+"'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(p.getServer().getPlayer(args[1]).getName()+".jobs.job"+(i+1)+"lv");
int mylv=this.plugin.getAccountsConfig().getInt(Bukkit.getPlayer(args[1]).getName()+".jobs.job"+(i+1)+"lv");
if (mylv==40) {
p.sendMessage("Lv"+mylv+" "+this.plugin.getJobColor(joblist[i])+joblist[i]+ChatColor.WHITE+": "+Math.round(this.plugin.getAccountsConfig().getInt(p.getServer().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()+".jobs.job"+(i+1)+"exp"))+"xp "+ChatColor.BLUE+(mylv>=5?"+Lv5 Buff":"")+ChatColor.GREEN+(mylv>=10?" +Lv10 Buff":"")+ChatColor.GOLD+(mylv>=20?" +Lv20 Buff":""));
} else {
p.sendMessage("Lv"+mylv+" "+this.plugin.getJobColor(joblist[i])+joblist[i]+ChatColor.WHITE+": "+Math.round(this.plugin.getAccountsConfig().getInt(p.getServer().getPlayer(args[1]).getName()+".jobs.job"+(i+1)+"exp"))+"/"+Math.round(this.plugin.getJobExp(joblist[i], this.plugin.getAccountsConfig().getInt(p.getServer().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()+".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":""));
}
if (joblist[i].equalsIgnoreCase("Explorer") && this.plugin.getJobLv(joblist[i], p.getServer().getPlayer(args[1]))>=10) {
if (joblist[i].equalsIgnoreCase("Explorer") && this.plugin.getJobLv(joblist[i], Bukkit.getPlayer(args[1]))>=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(p.getServer().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())==0 && this.plugin.explorers.get(j).event==0) {
discovered=true;
timeleft=this.plugin.explorers.get(j).expiretime-Bukkit.getWorld("world").getFullTime();
}
@ -1796,7 +1807,6 @@ 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())) {
//This player seems to exist. Check out their stats.

Loading…
Cancel
Save