diff --git a/BankEconomyMod/bin/me/kaZep/Base/Main$1.class b/BankEconomyMod/bin/me/kaZep/Base/Main$1.class index 8f8da14..d04fc51 100644 Binary files a/BankEconomyMod/bin/me/kaZep/Base/Main$1.class and b/BankEconomyMod/bin/me/kaZep/Base/Main$1.class differ diff --git a/BankEconomyMod/bin/me/kaZep/Base/Main$2.class b/BankEconomyMod/bin/me/kaZep/Base/Main$2.class index 1031676..9c6a37e 100644 Binary files a/BankEconomyMod/bin/me/kaZep/Base/Main$2.class and b/BankEconomyMod/bin/me/kaZep/Base/Main$2.class differ diff --git a/BankEconomyMod/bin/me/kaZep/Base/Main$3.class b/BankEconomyMod/bin/me/kaZep/Base/Main$3.class index 7d4027a..9da27d4 100644 Binary files a/BankEconomyMod/bin/me/kaZep/Base/Main$3.class and b/BankEconomyMod/bin/me/kaZep/Base/Main$3.class differ diff --git a/BankEconomyMod/bin/me/kaZep/Base/Main$4.class b/BankEconomyMod/bin/me/kaZep/Base/Main$4.class index ae80a5b..ac3cf31 100644 Binary files a/BankEconomyMod/bin/me/kaZep/Base/Main$4.class and b/BankEconomyMod/bin/me/kaZep/Base/Main$4.class differ diff --git a/BankEconomyMod/bin/me/kaZep/Base/Main.class b/BankEconomyMod/bin/me/kaZep/Base/Main.class index 1393003..a304598 100644 Binary files a/BankEconomyMod/bin/me/kaZep/Base/Main.class and b/BankEconomyMod/bin/me/kaZep/Base/Main.class differ diff --git a/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$1.class b/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$1.class index 54799a2..24f1d79 100644 Binary files a/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$1.class and b/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$1.class differ diff --git a/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$2.class b/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$2.class index f20e96f..ec00abe 100644 Binary files a/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$2.class and b/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$2.class differ diff --git a/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$3.class b/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$3.class index e894107..0213967 100644 Binary files a/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$3.class and b/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$3.class differ diff --git a/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$4.class b/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$4.class index f6d2cb5..b0a54d2 100644 Binary files a/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$4.class and b/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$4.class differ diff --git a/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$5.class b/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$5.class index d701232..4e40636 100644 Binary files a/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$5.class and b/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$5.class differ diff --git a/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$6.class b/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$6.class index 787fa9a..48588e9 100644 Binary files a/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$6.class and b/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$6.class differ diff --git a/BankEconomyMod/bin/me/kaZep/Base/PlayerListener.class b/BankEconomyMod/bin/me/kaZep/Base/PlayerListener.class index 22e8ce6..3fcdfaa 100644 Binary files a/BankEconomyMod/bin/me/kaZep/Base/PlayerListener.class and b/BankEconomyMod/bin/me/kaZep/Base/PlayerListener.class differ diff --git a/BankEconomyMod/src/me/kaZep/Base/Main.java b/BankEconomyMod/src/me/kaZep/Base/Main.java index 3a50f16..384370d 100644 --- a/BankEconomyMod/src/me/kaZep/Base/Main.java +++ b/BankEconomyMod/src/me/kaZep/Base/Main.java @@ -179,6 +179,13 @@ public class Main extends JavaPlugin String pluginPrefix = "ยง2[BankEconomy]"; + public double Warning(double hp,int id) { + if (hp>65) { + Bukkit.broadcastMessage("Main: HP too high for ID "+id+". HP was "+hp); + } + return hp; + } + public void onEnable() { getServer().getPluginManager().registerEvents(this.pl, this); @@ -1415,26 +1422,26 @@ public void runTick() { l.setCustomName(ChatColor.YELLOW+"Explosive Creeper"); l.setCustomNameVisible(false); //l.setCustomNameVisible(true); - l.setMaxHealth(l.getMaxHealth()*1.25d); + l.setMaxHealth(Warning(l.getMaxHealth()*1.25d,1)); } else if (Math.random()<=0.15) { l.setCustomName(ChatColor.GOLD+"Explosive Creeper II"); l.setCustomNameVisible(false); //l.setCustomNameVisible(true); - l.setMaxHealth(l.getMaxHealth()*1.75d); + l.setMaxHealth(Warning(l.getMaxHealth()*1.75d,2)); } else if (Math.random()<=0.35) { l.setCustomName(ChatColor.YELLOW+"Destructive Creeper"); l.setCustomNameVisible(false); //l.setCustomNameVisible(true); - l.setMaxHealth(l.getMaxHealth()*1.25d); + l.setMaxHealth(Warning(l.getMaxHealth()*1.25d,3)); } else { l.setCustomName(ChatColor.GOLD+"Destructive Creeper II"); l.setCustomNameVisible(false); //l.setCustomNameVisible(true); - l.setMaxHealth(l.getMaxHealth()*1.75d); + l.setMaxHealth(Warning(l.getMaxHealth()*1.75d,4)); } - l.setHealth(l.getMaxHealth()); + l.setHealth(Warning(l.getMaxHealth(),20)); } l.setTicksLived(6400); } @@ -1447,26 +1454,26 @@ public void runTick() { l.setCustomName(ChatColor.YELLOW+"Venomous Spider"); l.setCustomNameVisible(false); //l.setCustomNameVisible(true); - l.setMaxHealth(l.getMaxHealth()); + l.setMaxHealth(Warning(l.getMaxHealth(),5)); } else if (Math.random()<=0.15) { l.setCustomName(ChatColor.GOLD+"Venomous Spider II"); l.setCustomNameVisible(false); //l.setCustomNameVisible(true); - l.setMaxHealth(l.getMaxHealth()*1.5); + l.setMaxHealth(Warning(l.getMaxHealth()*1.5,6)); } else if (Math.random()<=0.35) { l.setCustomName(ChatColor.YELLOW+"Snaring Spider"); l.setCustomNameVisible(false); //l.setCustomNameVisible(true); - l.setMaxHealth(l.getMaxHealth()*1.5); + l.setMaxHealth(Warning(l.getMaxHealth()*1.5,7)); } else { l.setCustomName(ChatColor.GOLD+"Snaring Spider II"); l.setCustomNameVisible(false); //l.setCustomNameVisible(true); - l.setMaxHealth(l.getMaxHealth()*2); + l.setMaxHealth(Warning(l.getMaxHealth()*2,8)); } - l.setHealth(l.getMaxHealth()); + l.setHealth(Warning(l.getMaxHealth(),21)); } l.setTicksLived(6400); } @@ -1479,14 +1486,14 @@ public void runTick() { l.setCustomName(ChatColor.YELLOW+"Sniper"); l.setCustomNameVisible(false); //l.setCustomNameVisible(true); - l.setMaxHealth(l.getMaxHealth()/2); + l.setMaxHealth(Warning(l.getMaxHealth()/2,9)); } else { l.setCustomName(ChatColor.GOLD+"Sniper II"); l.setCustomNameVisible(false); //l.setCustomNameVisible(true); - l.setMaxHealth(l.getMaxHealth()/4); + l.setMaxHealth(Warning(l.getMaxHealth()/4,10)); } - l.setHealth(l.getMaxHealth()); + l.setHealth(Warning(l.getMaxHealth(),11)); } l.setTicksLived(6400); } @@ -1499,14 +1506,14 @@ public void runTick() { l.setCustomName(ChatColor.YELLOW+"Charge Zombie"); l.setCustomNameVisible(false); //l.setCustomNameVisible(true); - l.setMaxHealth(l.getMaxHealth()+5); + l.setMaxHealth(Warning(l.getMaxHealth()+5,12)); } else { l.setCustomName(ChatColor.GOLD+"Charge Zombie II"); l.setCustomNameVisible(false); //l.setCustomNameVisible(true); - l.setMaxHealth(l.getMaxHealth()+20); + l.setMaxHealth(Warning(l.getMaxHealth()+20,13)); } - l.setHealth(l.getMaxHealth()); + l.setHealth(Warning(l.getMaxHealth(),23)); } else { if (Math.random()<=0.10+((heightmodifier-l.getLocation().getY())*0.01d)) { if (Math.random()<=0.25) { @@ -1522,8 +1529,8 @@ public void runTick() { l.getEquipment().setHelmet(new ItemStack(Material.AIR)); Zombie g = (Zombie)l; g.setBaby(true); - l.setMaxHealth(l.getMaxHealth()*0.65d); - l.setHealth(l.getMaxHealth()); + l.setMaxHealth(Warning(l.getMaxHealth()*0.65d,14)); + l.setHealth(Warning(l.getMaxHealth(),15)); } } } diff --git a/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java b/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java index 5ecc3a6..6befc08 100644 --- a/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java +++ b/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java @@ -1859,7 +1859,7 @@ public class PlayerListener Entity newAnimal = world.spawnEntity(wolfloc, EntityType.WOLF); Wolf newdog = (Wolf)newAnimal; newdog.setOwner(p); - newdog.setHealth(oldhealth); + newdog.setHealth(Warning(oldhealth,21)); newdog.setSitting(true); newdog.setCollarColor(dogcolor); p.sendMessage(ChatColor.GREEN + "This dog is now happy!"); @@ -1867,6 +1867,13 @@ public class PlayerListener } } + public double Warning(double hp,int id) { + if (hp>65) { + Bukkit.broadcastMessage("HP too high for ID "+id+". HP was "+hp); + } + return hp; + } + @EventHandler public void onBlockGrow(BlockGrowEvent e) { int x1,y1,z1,x2=0,y2=0,z2=0; @@ -1913,7 +1920,7 @@ public class PlayerListener if (entity instanceof Monster) { LivingEntity test = (LivingEntity)entity; test.setMaxHealth(10); - test.setHealth(test.getMaxHealth()); + test.setHealth(Warning(test.getMaxHealth(),1)); boolean block=false; if (test.getCustomName()!=null && (test.getCustomName().contains(ChatColor.DARK_PURPLE+"") || test.getCustomName().contains(ChatColor.DARK_AQUA+"Polymorphed Creature"))) { for (int i=-2;i<3;i++) { @@ -1932,7 +1939,7 @@ public class PlayerListener if (test.getMaxHealth()>50) { Bukkit.getPlayer("sigonasr2").sendMessage("Mob had "+test.getMaxHealth()+" health. Lowering to max cap of 50."); test.setMaxHealth(50); - test.setHealth(test.getMaxHealth()); + test.setHealth(Warning(test.getMaxHealth(),2)); } } List entities = Bukkit.getWorld("world").getEntities(); @@ -1962,8 +1969,8 @@ public class PlayerListener boolean contains=entity instanceof Monster; if (contains) { Monster m = (Monster)entity; - m.setMaxHealth(m.getMaxHealth()*1.15d); //Increase all mobs' HP by 15%. - m.setHealth(m.getMaxHealth()); + m.setMaxHealth(Warning(m.getMaxHealth()*1.15d,3)); //Increase all mobs' HP by 15%. + m.setHealth(Warning(m.getMaxHealth(),4)); } //Mobs have more health when they are farther away, to make the mobs harder in general. float groupmult=0.25f; //Change this to modify the global grouping multiplier. @@ -3053,8 +3060,8 @@ public class PlayerListener if (entity.getWorld().getName().compareTo("world_the_end")==0) { if (entity.getType()==EntityType.ENDER_DRAGON) { LivingEntity l = (LivingEntity)entity; - l.setMaxHealth(l.getMaxHealth()*4); - l.setHealth(l.getMaxHealth()); + l.setMaxHealth(Warning(l.getMaxHealth()*4,5)); + l.setHealth(Warning(l.getMaxHealth(),6)); } } if (entity.getType()==EntityType.EXPERIENCE_ORB) { @@ -6411,7 +6418,7 @@ public ItemStack getGoodie() { enderdragon.setCustomName(ChatColor.DARK_PURPLE+"Charge Zombie III"); enderdragon.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE,127,999999)); enderdragon.setMaxHealth(200); - enderdragon.setHealth(l.getHealth()/l.getMaxHealth()*200); + enderdragon.setHealth(Warning(l.getHealth()/l.getMaxHealth()*200,7)); enderdragon.setNoDamageTicks(999999); enderdragon.setRemoveWhenFarAway(false); } @@ -6448,8 +6455,8 @@ public ItemStack getGoodie() { //This is a player. Player g = (Player)nearbylist.get(k); extramobs+=this.plugin.getJobTotalLvs(g)/20; - l.setMaxHealth(l.getMaxHealth()+this.plugin.getJobTotalLvs(g)+50); - l.setHealth(l.getMaxHealth()); + l.setMaxHealth(Warning(l.getMaxHealth()+this.plugin.getJobTotalLvs(g)+50,8)); + l.setHealth(Warning(l.getMaxHealth(),9)); ////Bukkit.getLogger().info("Mob maxgroup increased to "+maxgroup+" down here."); } } @@ -7258,7 +7265,7 @@ public ItemStack getGoodie() { //This means some piercing can be done. //e.setDamage(normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4)); if (f.getHealth()-(normaldmg+armor_pen)>0) { - f.setHealth(f.getHealth()-(normaldmg+armor_pen)); + f.setHealth(Warning(f.getHealth()-(normaldmg+armor_pen),13)); if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")) { if (f.getCustomName()!=null) { //p.sendMessage(ChatColor.RED+""+ChatColor.ITALIC+" Dealt "+(Math.round(normaldmg+armor_pen)*10)/10+" damage to "+convertToItemName(f.getCustomName())+"."); @@ -7272,7 +7279,7 @@ public ItemStack getGoodie() { } else { //This means piercing would do extra damage. Just subtract throughdmg. if (f.getHealth()-throughdmg>0) { - f.setHealth(f.getHealth()-throughdmg); + f.setHealth(Warning(f.getHealth()-throughdmg,14)); if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")) { if (f.getCustomName()!=null) { //p.sendMessage(ChatColor.RED+""+ChatColor.ITALIC+" Dealt "+(Math.round(throughdmg)*10)/10+" damage to "+convertToItemName(f.getCustomName())+"."); @@ -7295,7 +7302,7 @@ public ItemStack getGoodie() { //This means some piercing can be done. //e.setDamage(normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4)); if (f.getHealth()-(normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4))>0) { - f.setHealth(f.getHealth()-(normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4))); + f.setHealth(Warning(f.getHealth()-(normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4)),15)); if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")) { if (f.getCustomName()!=null) { //p.sendMessage(ChatColor.RED+""+ChatColor.ITALIC+" Dealt "+(normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4))+" damage to "+convertToItemName(f.getCustomName())+"."); @@ -7309,7 +7316,7 @@ public ItemStack getGoodie() { } else { //This means piercing would do extra damage. Just subtract throughdmg. if (f.getHealth()-throughdmg>0) { - f.setHealth(f.getHealth()-throughdmg); + f.setHealth(Warning(f.getHealth()-throughdmg,16)); if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")) { if (f.getCustomName()!=null) { //p.sendMessage(ChatColor.RED+""+ChatColor.ITALIC+" Dealt "+(Math.round(throughdmg)*10)/10+" damage to "+convertToItemName(f.getCustomName())+"."); @@ -7456,7 +7463,7 @@ public ItemStack getGoodie() { //This means some piercing can be done. //e.setDamage(normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4)); if (f.getHealth()-(normaldmg+armor_pen)>0) { - f.setHealth(f.getHealth()-(normaldmg+armor_pen)); + f.setHealth(Warning(f.getHealth()-(normaldmg+armor_pen),17)); if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")) { if (f.getCustomName()!=null) { //p.sendMessage(ChatColor.RED+""+ChatColor.ITALIC+" Dealt "+(Math.round(normaldmg+armor_pen)*10)/10+" damage to "+convertToItemName(f.getCustomName())+"."); @@ -7470,7 +7477,7 @@ public ItemStack getGoodie() { } else { //This means piercing would do extra damage. Just subtract throughdmg. if (f.getHealth()-throughdmg>0) { - f.setHealth(f.getHealth()-throughdmg); + f.setHealth(Warning(f.getHealth()-throughdmg,18)); if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")) { if (f.getCustomName()!=null) { //p.sendMessage(ChatColor.RED+""+ChatColor.ITALIC+" Dealt "+(Math.round(throughdmg)*10)/10+" damage to "+convertToItemName(f.getCustomName())+"."); @@ -7492,7 +7499,7 @@ public ItemStack getGoodie() { //This means some piercing can be done. //e.setDamage(normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4)); if (f.getHealth()-(normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4))>0) { - f.setHealth(f.getHealth()-(normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4))); + f.setHealth(Warning(f.getHealth()-(normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4)),19)); if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")) { if (f.getCustomName()!=null) { //p.sendMessage(ChatColor.RED+""+ChatColor.ITALIC+" Dealt "+(normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4))+" damage to "+convertToItemName(f.getCustomName())+"."); @@ -7506,7 +7513,7 @@ public ItemStack getGoodie() { } else { //This means piercing would do extra damage. Just subtract throughdmg. if (f.getHealth()-throughdmg>0) { - f.setHealth(f.getHealth()-throughdmg); + f.setHealth(Warning(f.getHealth()-throughdmg,20)); if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")) { if (f.getCustomName()!=null) { //p.sendMessage(ChatColor.RED+""+ChatColor.ITALIC+" Dealt "+(Math.round(throughdmg)*10)/10+" damage to "+convertToItemName(f.getCustomName())+".");