diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/NewsManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/NewsManager.java index 6d67b4986..459ef68ed 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/NewsManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/NewsManager.java @@ -246,15 +246,17 @@ public class NewsManager extends MiniPlugin String text = col + C.Bold + "MINEPLEX" + ChatColor.RESET + " - " + _news[_newsIndex]; if (text.length() > 64) text = text.substring(0, 64); - + + double healthPercent = (double)_newsIndex/(double)(_news.length-1); for (Player player : UtilServer.getPlayers()) - UtilDisplay.displayTextBar(Manager.GetPlugin(), player, (double)_newsIndex/(double)(_news.length-1), text); + UtilDisplay.displayTextBar(Manager.GetPlugin(), player, healthPercent, text); for (Mount mount : Manager.GetMount().getMounts()) { if (mount instanceof Dragon) { ((Dragon)mount).SetName(text); + ((Dragon)mount).setHealthPercent(healthPercent); } } } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/mount/DragonMount.java b/Plugins/Mineplex.Hub/src/mineplex/hub/mount/DragonMount.java index 957c987f7..479a68662 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/mount/DragonMount.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/mount/DragonMount.java @@ -30,7 +30,10 @@ public class DragonMount extends Mount UtilPlayer.message(player, F.main("Mount", "You spawned " + F.elem(GetName()) + ".")); //Store - _active.put(player, new DragonData(this, player)); + 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); + _active.put(player, dragonData); } @Override diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/mount/types/Dragon.java b/Plugins/Mineplex.Hub/src/mineplex/hub/mount/types/Dragon.java index 160e55cb9..cb4ebb61a 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/mount/types/Dragon.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/mount/types/Dragon.java @@ -103,7 +103,18 @@ public class Dragon extends DragonMount for (DragonData dragon : GetActive().values()) dragon.Dragon.setCustomName(news); } - + + public void setHealthPercent(double healthPercent) + { + for (DragonData dragon : GetActive().values()) + { + double health = healthPercent * dragon.Dragon.getMaxHealth(); + if (health <= 0.0) + health = 0.001; + dragon.Dragon.setHealth(health); + } + } + @EventHandler public void HeroOwner(PlayerJoinEvent event) { diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java index d9a67bdbe..451a4d43a 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java @@ -187,9 +187,10 @@ public class ServerNpcPage extends ShopPageBase im private void buildAvailableServerPage(List serverList, int slotsNeeded) { + int serversToShow = 5; int greenCount = 0; int yellowCount = 0; - int greenStartSlot = 19; + int greenStartSlot = 18 + ((9 - serversToShow) / 2); boolean showGreen = true; long portalTime = Plugin.getMillisecondsUntilPortal(Player); @@ -203,7 +204,7 @@ public class ServerNpcPage extends ShopPageBase im { int slot = greenCount + greenStartSlot; - if (isStarting(serverInfo) && hasEnoughSlots(serverInfo, slotsNeeded) && greenCount < 7) + if (isStarting(serverInfo) && hasEnoughSlots(serverInfo, slotsNeeded) && greenCount < serversToShow) { if (showGreen) { @@ -232,7 +233,7 @@ public class ServerNpcPage extends ShopPageBase im // Clear empty slots if (showGreen) { - for (int i = greenCount + greenStartSlot; i < greenStartSlot + 7; i++) + for (int i = greenCount + greenStartSlot; i < greenStartSlot + serversToShow; i++) { setItem(i, null); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/SneakyAssassins.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/SneakyAssassins.java index 689d6f36c..e5b95272d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/SneakyAssassins.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/SneakyAssassins.java @@ -294,6 +294,13 @@ public class SneakyAssassins extends SoloGame event.setCancelled(true); } + @EventHandler(ignoreCancelled = true) + public void onDamageHanging(EntityDamageEvent event) + { + if (event.getEntity() instanceof Hanging) + event.setCancelled(true); + } + @EventHandler(ignoreCancelled = true) public void onWitherEffectDamager(CustomDamageEvent event) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/powerups/PowerUpManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/powerups/PowerUpManager.java index 02921f8b3..af4fd9b45 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/powerups/PowerUpManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/powerups/PowerUpManager.java @@ -161,34 +161,37 @@ public class PowerUpManager implements Listener event.setCancelled(true); - powerUp.remove(); + int count = getPowerUpCount(event.getPlayer()); - int count = incrementPowerUpCount(event.getPlayer()); - - PowerUpType.SMOKE_BOMB.powerUpPlayer(event.getPlayer(), getRandom()); - - if (count == 5) + if (count <= 4) { - PowerUpType.COMPASS.powerUpPlayer(event.getPlayer(), getRandom()); + powerUp.remove(); - UtilPlayer.message(event.getPlayer(), F.main("Game", "You now have a " + F.item("Compass") + " for tracking players")); + if (PowerUpType.SMOKE_BOMB.powerUpPlayer(event.getPlayer(), getRandom())) + UtilPlayer.message(event.getPlayer(), F.main("Power-Up", "+1 " + F.item("Smoke Bomb"))); - getGame().Announce(F.main("Game", F.name(C.Bold + event.getPlayer().getName()) + " has become a " + F.skill(C.Bold + "Master Assassin"))); - - for (Player player : UtilServer.getPlayers()) - player.playSound(player.getLocation(), Sound.ENDERDRAGON_GROWL, 1f, 1f); - } - else - { - if (count < 5) + if (count == 4) + { + PowerUpType.COMPASS.powerUpPlayer(event.getPlayer(), getRandom()); + + UtilPlayer.message(event.getPlayer(), F.main("Game", "You now have a " + F.item("Compass") + " for tracking players")); + + getGame().Announce(F.main("Game", F.name(C.Bold + event.getPlayer().getName()) + " has become a " + F.skill(C.Bold + "Master Assassin"))); + + for (Player player : UtilServer.getPlayers()) + player.playSound(player.getLocation(), Sound.ENDERDRAGON_GROWL, 1f, 1f); + } + else { PowerUpType.WEAPON.powerUpPlayer(event.getPlayer(), getRandom()); PowerUpType.ARMOR.powerUpPlayer(event.getPlayer(), getRandom()); UtilPlayer.message(event.getPlayer(), F.main("Game", "Your " + F.item("Sword") + " and " + F.item("Armor") + " have been upgraded!")); + + getGame().Announce(F.main("Game", F.name(event.getPlayer().getName()) + " collected a " + F.skill("Powerup") + ".")); } - getGame().Announce(F.main("Game", F.name(event.getPlayer().getName()) + " collected a " + F.skill("Powerup") + ".")); + incrementPowerUpCount(event.getPlayer()); } schedulePowerUpSpawn(10);