Wither fix for Nether / other worlds.
This commit is contained in:
parent
8da2eb1f43
commit
287328e29a
@ -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…
x
Reference in New Issue
Block a user