Wither fix for Nether / other worlds.

master_event
sigonasr2 11 years ago
parent 8da2eb1f43
commit 287328e29a
  1. 26
      BankEconomyMod/src/me/kaZep/Base/Main.java

@ -1133,6 +1133,32 @@ public void runTick() {
}
}
}
world_entities = Bukkit.getWorld("world_nether").getEntities();
for (int i=0;i<world_entities.size();i++) {
if (world_entities.get(i).getType()==EntityType.WITHER) {
Wither l = (Wither)world_entities.get(i);
if (l.getCustomName()!=null && l.getCustomName().equalsIgnoreCase(ChatColor.LIGHT_PURPLE+"Mythical Wither")) {
if (l.getMaxHealth()>l.getHealth()+5+(0.2*(l.getMaxHealth()/l.getHealth()))) {
DecimalFormat df = new DecimalFormat("#0.0");
//Bukkit.broadcastMessage("Healing for "+(+5+(0.2*(l.getMaxHealth()/l.getHealth())))+" health. "+df.format(l.getHealth())+"/"+l.getMaxHealth()+" HP");
l.setHealth(l.getHealth()+5+(0.2*(l.getMaxHealth()/l.getHealth())));
}
}
}
}
world_entities = Bukkit.getWorld("world_the_end").getEntities();
for (int i=0;i<world_entities.size();i++) {
if (world_entities.get(i).getType()==EntityType.WITHER) {
Wither l = (Wither)world_entities.get(i);
if (l.getCustomName()!=null && l.getCustomName().equalsIgnoreCase(ChatColor.LIGHT_PURPLE+"Mythical Wither")) {
if (l.getMaxHealth()>l.getHealth()+5+(0.2*(l.getMaxHealth()/l.getHealth()))) {
DecimalFormat df = new DecimalFormat("#0.0");
//Bukkit.broadcastMessage("Healing for "+(+5+(0.2*(l.getMaxHealth()/l.getHealth())))+" health. "+df.format(l.getHealth())+"/"+l.getMaxHealth()+" HP");
l.setHealth(l.getHealth()+5+(0.2*(l.getMaxHealth()/l.getHealth())));
}
}
}
}
}
for (int zx=0;zx<Bukkit.getOnlinePlayers().length;zx++) {
Player p = Bukkit.getOnlinePlayers()[zx];

Loading…
Cancel
Save