Display boss bar properly while a dragon mount is spawned in arcade

This commit is contained in:
Shaun Bennett 2014-08-11 12:26:56 -05:00
parent e4871c4988
commit 7e93ed657f
2 changed files with 12 additions and 0 deletions

View File

@ -33,6 +33,7 @@ public class DragonMount extends Mount<DragonData>
DragonData dragonData = new DragonData(this, player);
//Set max health to 1 so player doesn't see a bunch of mount hearts flashing when NewsManager changes the health
dragonData.Dragon.setMaxHealth(1.0);
dragonData.Dragon.setHealth(1.0);
_active.put(player, dragonData);
}

View File

@ -10,6 +10,8 @@ import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.mount.Mount;
import mineplex.core.mount.types.Dragon;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.RestartServerEvent;
import mineplex.core.updater.event.UpdateEvent;
@ -78,6 +80,15 @@ public class GameManager implements Listener
for (Player player : UtilServer.getPlayers())
UtilDisplay.displayTextBar(Manager.GetPlugin(), player, health, text);
for (Mount mount : Manager.getCosmeticManager().getMountManager().getMounts())
{
if (mount instanceof Dragon)
{
((Dragon) mount).SetName(text);
((Dragon) mount).setHealthPercent(health);
}
}
}
}