diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilText.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilBlockText.java similarity index 99% rename from Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilText.java rename to Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilBlockText.java index 0b8c1ef9b..ef8d0e534 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilText.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilBlockText.java @@ -10,7 +10,7 @@ import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; -public class UtilText +public class UtilBlockText { public enum TextAlign { diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilDisplay.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilDisplay.java deleted file mode 100644 index c7054f6be..000000000 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilDisplay.java +++ /dev/null @@ -1,169 +0,0 @@ -package mineplex.core.common.util; - -import java.lang.reflect.Field; -import java.util.HashMap; - -import mineplex.core.common.DummyEntity; -import net.minecraft.server.v1_7_R4.DataWatcher; -import net.minecraft.server.v1_7_R4.EntityPlayer; -import net.minecraft.server.v1_7_R4.MathHelper; -import net.minecraft.server.v1_7_R4.Packet; -import net.minecraft.server.v1_7_R4.PacketPlayOutEntityDestroy; -import net.minecraft.server.v1_7_R4.PacketPlayOutEntityMetadata; -import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntityLiving; - -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.World; -import org.bukkit.craftbukkit.v1_7_R4.CraftWorld; -import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.Player; -import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.scheduler.BukkitRunnable; -import org.bukkit.util.Vector; - -public class UtilDisplay -{ - public static final int ENTITY_ID = 777777; - public static final EntityType ENTITY_TYPE = EntityType.WITHER; - public static final boolean HALF_HEALTH = true; - - private static HashMap hasHealthBar = new HashMap(); - - public static void sendPacket(Player player, Packet packet){ - EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle(); - - entityPlayer.playerConnection.sendPacket(packet); - } - - //Accessing packets - public static PacketPlayOutSpawnEntityLiving getMobPacket(String text, double healthPercent, Location loc) - { - PacketPlayOutSpawnEntityLiving mobPacket = new PacketPlayOutSpawnEntityLiving(); - - mobPacket.a = (int) ENTITY_ID; //Entity ID - mobPacket.b = (byte) ENTITY_TYPE.getTypeId(); //Mob type (ID: 64) - mobPacket.c = (int) Math.floor(loc.getBlockX() * 32.0D); //X position - mobPacket.d = (int) MathHelper.floor(loc.getBlockY() * 32.0D); //Y position - mobPacket.e = (int) Math.floor(loc.getBlockZ() * 32.0D); //Z position - mobPacket.f = (byte) 0; //Pitch - mobPacket.g = (byte) 0; //Head Pitch - mobPacket.h = (byte) 0; //Yaw - mobPacket.i = (short) 0; //X velocity - mobPacket.j = (short) 0; //Y velocity - mobPacket.k = (short) 0; //Z velocity - - //Dragon or Wither - double health; - if (ENTITY_TYPE == EntityType.WITHER) - { - if (HALF_HEALTH) - health = healthPercent * 149 + 151; - else - health = healthPercent * 299.9 + 0.1; - } - else - { - if (HALF_HEALTH) - health = healthPercent * 99 + 101; - else - health = healthPercent * 199.9 + 0.1; - } - - DataWatcher watcher = getWatcher(text, health, loc.getWorld()); - - mobPacket.l = watcher; - - return mobPacket; - } - - public static PacketPlayOutEntityDestroy getDestroyEntityPacket() - { - PacketPlayOutEntityDestroy packet = new PacketPlayOutEntityDestroy(ENTITY_ID); - - return packet; - } - - public static PacketPlayOutEntityMetadata getMetadataPacket(DataWatcher watcher) - { - PacketPlayOutEntityMetadata metaPacket = new PacketPlayOutEntityMetadata(); - - metaPacket.a = (int) ENTITY_ID; - - try - { - Field b = PacketPlayOutEntityMetadata.class.getDeclaredField("b"); - - b.setAccessible(true); - b.set(metaPacket, watcher.c()); - } - catch(Exception e) - { - e.printStackTrace(); - } - - return metaPacket; - } - - public static DataWatcher getWatcher(String text, double health, World world) - { - DataWatcher watcher = new DataWatcher(new DummyEntity(((CraftWorld)world).getHandle())); - - watcher.a(0, (Byte) (byte) 0); //Flags, 0x20 = invisible - watcher.a(6, (Float) (float) health); - watcher.a(2, (String) text); //Entity name - watcher.a(10, (String) text); //Entity name - watcher.a(3, (Byte) (byte) 0); //Show name, 1 = show, 0 = don't show - watcher.a(11, (Byte) (byte) 0); //Show name, 1 = show, 0 = don't show - watcher.a(16, (Integer) (int) health); //Wither health, 300 = full health - watcher.a(20, (Integer) (int) 0); //Wither invuln, - - int i1 = watcher.getInt(0); - watcher.watch(0, Byte.valueOf((byte)(i1 | 1 << 5))); - watcher.watch(20, 0); - - return watcher; - } - - //Display - public static void displayTextBar(JavaPlugin plugin, final Player player, double healthPercent, String text) - { - PacketPlayOutEntityDestroy destroyEntityPacket = getDestroyEntityPacket(); - - sendPacket(player, destroyEntityPacket); - - Location loc = player.getEyeLocation().add(player.getLocation().getDirection().multiply(24)); - - /* - //Downward - if (player.getLocation().getPitch() > 0) - { - loc = player.getLocation().subtract(0, 10, 0); - } - //Upward - else - { - loc.add(player.getLocation().getDirection().multiply(12)); - loc.add(UtilAlg.getDown(player.getLocation().getDirection()).multiply(12)); - } - */ - - - PacketPlayOutSpawnEntityLiving mobPacket = getMobPacket(text, healthPercent, loc); - - sendPacket(player, mobPacket); - hasHealthBar.put(player.getName(), true); - - Bukkit.getServer().getScheduler().runTaskLater(plugin, new Runnable() - { - public void run() - { - PacketPlayOutEntityDestroy destroyEntityPacket = getDestroyEntityPacket(); - - sendPacket(player, destroyEntityPacket); - hasHealthBar.put(player.getName(), false); - } - }, 20); - } -} \ No newline at end of file diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilTextBottom.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilTextBottom.java new file mode 100644 index 000000000..485eee9d0 --- /dev/null +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilTextBottom.java @@ -0,0 +1,71 @@ +package mineplex.core.common.util; + +import mineplex.core.common.jsonchat.JsonMessage; +import mineplex.core.common.jsonchat.JsonMessage.MessageType; + +import org.bukkit.ChatColor; +import org.bukkit.entity.Player; + +public class UtilTextBottom +{ + public static void display(String text, Player... players) + { + JsonMessage msg = new JsonMessage(text); + + //1.8 + msg.send(MessageType.ABOVE_HOTBAR, players); + + //1.7 Players + for (Player player : players) + { + if (!UtilPlayer.is1_8(player)) + { + UtilTextTop.display(text, player); + } + } + } + + public static void displayProgress(double amount, Player... players) + { + displayProgress(null, amount, null, players); + } + + public static void displayProgress(String prefix, double amount, Player... players) + { + displayProgress(prefix, amount, null, players); + } + + public static void displayProgress(String prefix, double amount, String suffix, Player... players) + { + //Generate Bar + int bars = 12; + String progressBar = C.cGreen + ""; + boolean colorChange = false; + for (int i=0 ; i= amount) + { + progressBar += C.cRed; + colorChange = true; + } + + progressBar += "█"; + } + + //Send to Player + for (Player player : players) + { + //1.7 + if (!UtilPlayer.is1_8(player)) + { + UtilTextTop.displayProgress((prefix == null ? "" : prefix) + (suffix == null ? "" : ChatColor.RESET + C.Bold + " - " + ChatColor.RESET + suffix), + amount, player); + } + //1.8 + else + { + display((prefix == null ? "" : prefix + ChatColor.RESET + " ") + progressBar + (suffix == null ? "" : ChatColor.RESET + " " + suffix), players); + } + } + } +} diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilTitle.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilTextMiddle.java similarity index 99% rename from Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilTitle.java rename to Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilTextMiddle.java index 120de2e4a..6962a970b 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilTitle.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilTextMiddle.java @@ -11,7 +11,7 @@ import org.spigotmc.ProtocolInjector.PacketTitle.Action; /** * Created by Shaun on 9/5/2014. */ -public class UtilTitle +public class UtilTextMiddle { public static void display(String text, String subtitle, Player... players) { diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilTextTop.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilTextTop.java new file mode 100644 index 000000000..ae3ef09ba --- /dev/null +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilTextTop.java @@ -0,0 +1,157 @@ +package mineplex.core.common.util; + +import mineplex.core.common.DummyEntity; +import net.minecraft.server.v1_7_R4.DataWatcher; +import net.minecraft.server.v1_7_R4.MathHelper; +import net.minecraft.server.v1_7_R4.PacketPlayOutEntityDestroy; +import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntityLiving; + +import org.bukkit.Bukkit; +import org.bukkit.Location; +import org.bukkit.World; +import org.bukkit.craftbukkit.v1_7_R4.CraftWorld; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; + +public class UtilTextTop +{ + //Base Commands + public static void display(String text, Player... players) + { + displayProgress(text, 1, players); + } + + public static void displayProgress(String text, double progress, Player... players) + { + for (Player player : players) + displayTextBar(player, progress, text); + } + + //Logic + public static final int EntityDragonId = 777777; + public static final int EntityWitherId = 777778; + + //Display + public static void displayTextBar(final Player player, double healthPercent, String text) + { + deleteOld(player); + + boolean halfHealth = UtilPlayer.is1_8(player); + + //Display Dragon + { + Location loc = player.getLocation().subtract(0, 200, 0); + + ((CraftPlayer)player).getHandle().playerConnection.sendPacket(getDragonPacket(text, healthPercent, halfHealth, loc)); + } + + + //Display Wither (as well as Dragon) + if (UtilPlayer.is1_8(player)) + { + Location loc = player.getEyeLocation().add(player.getLocation().getDirection().multiply(24)); + + ((CraftPlayer)player).getHandle().playerConnection.sendPacket(getWitherPacket(text, healthPercent, halfHealth, loc)); + } + + //Remove + Bukkit.getServer().getScheduler().runTaskLater(Bukkit.getPluginManager().getPlugins()[0], new Runnable() + { + public void run() + { + deleteOld(player); + } + }, 20); + } + + private static void deleteOld(Player player) + { + //Delete Dragon (All Clients) + PacketPlayOutEntityDestroy destroyDragonPacket = new PacketPlayOutEntityDestroy(EntityDragonId); + ((CraftPlayer)player).getHandle().playerConnection.sendPacket(destroyDragonPacket); + + //Delete Wither (1.8+ Only) + if (UtilPlayer.is1_8(player)) + { + PacketPlayOutEntityDestroy destroyWitherPacket = new PacketPlayOutEntityDestroy(EntityWitherId); + ((CraftPlayer)player).getHandle().playerConnection.sendPacket(destroyWitherPacket); + } + } + + public static PacketPlayOutSpawnEntityLiving getDragonPacket(String text, double healthPercent, boolean halfHealth, Location loc) + { + PacketPlayOutSpawnEntityLiving mobPacket = new PacketPlayOutSpawnEntityLiving(); + + mobPacket.a = (int) EntityDragonId; //Entity ID + mobPacket.b = (byte) EntityType.ENDER_DRAGON.getTypeId(); //Mob type + mobPacket.c = (int) Math.floor(loc.getBlockX() * 32.0D); //X position + mobPacket.d = (int) MathHelper.floor(loc.getBlockY() * 32.0D); //Y position + mobPacket.e = (int) Math.floor(loc.getBlockZ() * 32.0D); //Z position + mobPacket.f = (byte) 0; //Pitch + mobPacket.g = (byte) 0; //Head Pitch + mobPacket.h = (byte) 0; //Yaw + mobPacket.i = (short) 0; //X velocity + mobPacket.j = (short) 0; //Y velocity + mobPacket.k = (short) 0; //Z velocity + + //Health + double health = healthPercent * 199.9 + 0.1; + if (halfHealth) + health = healthPercent * 99 + 101; + + //Watcher + DataWatcher watcher = getWatcher(text, health, loc.getWorld()); + mobPacket.l = watcher; + + return mobPacket; + } + + public static PacketPlayOutSpawnEntityLiving getWitherPacket(String text, double healthPercent, boolean halfHealth, Location loc) + { + PacketPlayOutSpawnEntityLiving mobPacket = new PacketPlayOutSpawnEntityLiving(); + + mobPacket.a = (int) EntityWitherId; //Entity ID + mobPacket.b = (byte) EntityType.WITHER.getTypeId(); //Mob type + mobPacket.c = (int) Math.floor(loc.getBlockX() * 32.0D); //X position + mobPacket.d = (int) MathHelper.floor(loc.getBlockY() * 32.0D); //Y position + mobPacket.e = (int) Math.floor(loc.getBlockZ() * 32.0D); //Z position + mobPacket.f = (byte) 0; //Pitch + mobPacket.g = (byte) 0; //Head Pitch + mobPacket.h = (byte) 0; //Yaw + mobPacket.i = (short) 0; //X velocity + mobPacket.j = (short) 0; //Y velocity + mobPacket.k = (short) 0; //Z velocity + + //Health + double health = healthPercent * 299.9 + 0.1; + if (halfHealth) + health = healthPercent * 149 + 151; + + //Watcher + DataWatcher watcher = getWatcher(text, health, loc.getWorld()); + mobPacket.l = watcher; + + return mobPacket; + } + + public static DataWatcher getWatcher(String text, double health, World world) + { + DataWatcher watcher = new DataWatcher(new DummyEntity(((CraftWorld)world).getHandle())); + + watcher.a(0, (Byte) (byte) 0); //Flags, 0x20 = invisible + watcher.a(6, (Float) (float) health); + watcher.a(2, (String) text); //Entity name + watcher.a(10, (String) text); //Entity name + watcher.a(3, (Byte) (byte) 0); //Show name, 1 = show, 0 = don't show + watcher.a(11, (Byte) (byte) 0); //Show name, 1 = show, 0 = don't show + watcher.a(16, (Integer) (int) health); //Health + watcher.a(20, (Integer) (int) 0); //Inv + + int i1 = watcher.getInt(0); + watcher.watch(0, Byte.valueOf((byte)(i1 | 1 << 5))); + watcher.watch(20, 0); + + return watcher; + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/recharge/RechargeData.java b/Plugins/Mineplex.Core/src/mineplex/core/recharge/RechargeData.java index 24004a447..8e6846dea 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/recharge/RechargeData.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/recharge/RechargeData.java @@ -1,9 +1,11 @@ package mineplex.core.recharge; import mineplex.core.common.util.C; -import mineplex.core.common.util.UtilDisplay; + import mineplex.core.common.util.UtilInv; +import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilTextBottom; import mineplex.core.common.util.UtilTime; import org.bukkit.ChatColor; @@ -63,13 +65,12 @@ public class RechargeData { if (!UtilTime.elapsed(Time, Recharge)) { - UtilDisplay.displayTextBar(Host.GetPlugin(), Player, percent, C.cRed + C.Bold + Name + ChatColor.RESET + " - " + - C.cYellow + C.Bold + UtilTime.MakeStr(Recharge - (System.currentTimeMillis() - Time))); + UtilTextBottom.displayProgress(C.Bold + Name, percent, UtilTime.MakeStr(Recharge - (System.currentTimeMillis() - Time)), Player); } else { - UtilDisplay.displayTextBar(Host.GetPlugin(), Player, 1, C.cGreen + C.Bold + Name); - + UtilTextBottom.display(C.cGreen + C.Bold + Name + " Recharged", Player); + //PLING! if (Recharge > 4000) Player.playSound(Player.getLocation(), Sound.NOTE_PLING, 0.4f, 3f); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/NewsManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/NewsManager.java index fa1789a09..7ab131db7 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/NewsManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/NewsManager.java @@ -14,11 +14,12 @@ import mineplex.core.common.Rank; import mineplex.core.common.util.C; import mineplex.core.common.util.Callback; import mineplex.core.common.util.F; -import mineplex.core.common.util.UtilDisplay; + import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilTextTop; import mineplex.core.common.util.UtilTime; -import mineplex.core.common.util.UtilTitle; +import mineplex.core.common.util.UtilTextMiddle; import mineplex.core.mount.Mount; import mineplex.core.mount.types.MountDragon; import mineplex.core.updater.UpdateType; @@ -239,9 +240,6 @@ public class NewsManager extends MiniPlugin { _newsIndex = (_newsIndex + 1)%_news.length; _newsTime = System.currentTimeMillis(); - -// JsonMessage jsonMessage = new JsonMessage(_news[_newsIndex]); -// jsonMessage.send(JsonMessage.MessageType.ABOVE_HOTBAR, UtilServer.getPlayers()); } if (_newsIndex >= _news.length) { @@ -255,8 +253,8 @@ public class NewsManager extends MiniPlugin text = text.substring(0, 64); double healthPercent = (double)_newsIndex/(double)(_news.length-1); - for (Player player : UtilServer.getPlayers()) - UtilDisplay.displayTextBar(Manager.GetPlugin(), player, healthPercent, text); + + UtilTextTop.display(text, UtilServer.getPlayers()); for (Mount mount : Manager.GetMount().getMounts()) { @@ -280,7 +278,7 @@ public class NewsManager extends MiniPlugin @Override public void run() { - UtilTitle.display(C.cGold + C.Bold + "MINEPLEX" + ChatColor.RESET, _news[_news.length - 1 - count] + ChatColor.RESET, (count == 0) ? 20 : 0, 60, 20, event.getPlayer()); + UtilTextMiddle.display(C.cGold + C.Bold + "MINEPLEX" + ChatColor.RESET, _news[_news.length - 1 - count] + ChatColor.RESET, (count == 0) ? 20 : 0, 60, 20, event.getPlayer()); } }, 60 * i + (i != 0 ? 20 : 0)); } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/TextManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/TextManager.java index 3368d5ca6..fa83b254f 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/TextManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/TextManager.java @@ -1,8 +1,8 @@ package mineplex.hub.modules; import mineplex.core.MiniPlugin; -import mineplex.core.common.util.UtilText; -import mineplex.core.common.util.UtilText.TextAlign; +import mineplex.core.common.util.UtilBlockText; +import mineplex.core.common.util.UtilBlockText.TextAlign; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.hub.HubManager; @@ -55,56 +55,56 @@ public class TextManager extends MiniPlugin public void CreateText() { //Comp - UtilText.MakeText("CHAMPIONS", locComp, faceComp, 159, (byte)5, TextAlign.CENTER); - UtilText.MakeText("CHAMPIONS", locComp.clone().add(1, 0, 0), faceComp, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); + UtilBlockText.MakeText("CHAMPIONS", locComp, faceComp, 159, (byte)5, TextAlign.CENTER); + UtilBlockText.MakeText("CHAMPIONS", locComp.clone().add(1, 0, 0), faceComp, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); - UtilText.MakeText("DOMINATE", locComp.clone().add(15, 14, 0), faceComp, 159, (byte)4, TextAlign.CENTER); - UtilText.MakeText("DOMINATE", locComp.clone().add(16, 14, 0), faceComp, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); + UtilBlockText.MakeText("DOMINATE", locComp.clone().add(15, 14, 0), faceComp, 159, (byte)4, TextAlign.CENTER); + UtilBlockText.MakeText("DOMINATE", locComp.clone().add(16, 14, 0), faceComp, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); - UtilText.MakeText("TEAM DEATHMATCH", locComp.clone().add(15, 21, 0), faceComp, 159, (byte)1, TextAlign.CENTER); - UtilText.MakeText("TEAM DEATHMATCH", locComp.clone().add(16, 21, 0), faceComp, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); + UtilBlockText.MakeText("TEAM DEATHMATCH", locComp.clone().add(15, 21, 0), faceComp, 159, (byte)1, TextAlign.CENTER); + UtilBlockText.MakeText("TEAM DEATHMATCH", locComp.clone().add(16, 21, 0), faceComp, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); //UtilText.MakeText("CAPTURE THE PIG", locComp.clone().add(15, 28, 0), faceComp, 159, (byte)14, TextAlign.CENTER); //UtilText.MakeText("CAPTURE THE PIG", locComp.clone().add(16, 28, 0), faceComp, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); //Arcade - UtilText.MakeText("ARCADE", locArcade, faceArcade, 159, (byte)5, TextAlign.CENTER); - UtilText.MakeText("ARCADE", locArcade.clone().add(0, 0, 1), faceArcade, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); + UtilBlockText.MakeText("ARCADE", locArcade, faceArcade, 159, (byte)5, TextAlign.CENTER); + UtilBlockText.MakeText("ARCADE", locArcade.clone().add(0, 0, 1), faceArcade, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); - UtilText.MakeText(GetArcadeText(0), locArcade.clone().add(0, 14, 15), faceArcade, 159, (byte)4, TextAlign.CENTER); - UtilText.MakeText(GetArcadeText(0), locArcade.clone().add(0, 14, 16), faceArcade, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); + UtilBlockText.MakeText(GetArcadeText(0), locArcade.clone().add(0, 14, 15), faceArcade, 159, (byte)4, TextAlign.CENTER); + UtilBlockText.MakeText(GetArcadeText(0), locArcade.clone().add(0, 14, 16), faceArcade, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); - UtilText.MakeText(GetArcadeText(1), locArcade.clone().add(0, 21, 15), faceArcade, 159, (byte)1, TextAlign.CENTER); - UtilText.MakeText(GetArcadeText(1), locArcade.clone().add(0, 21, 16), faceArcade, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); + UtilBlockText.MakeText(GetArcadeText(1), locArcade.clone().add(0, 21, 15), faceArcade, 159, (byte)1, TextAlign.CENTER); + UtilBlockText.MakeText(GetArcadeText(1), locArcade.clone().add(0, 21, 16), faceArcade, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); - UtilText.MakeText(GetArcadeText(2), locArcade.clone().add(0, 28, 15), faceArcade, 159, (byte)14, TextAlign.CENTER); - UtilText.MakeText(GetArcadeText(2), locArcade.clone().add(0, 28, 16), faceArcade, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); + UtilBlockText.MakeText(GetArcadeText(2), locArcade.clone().add(0, 28, 15), faceArcade, 159, (byte)14, TextAlign.CENTER); + UtilBlockText.MakeText(GetArcadeText(2), locArcade.clone().add(0, 28, 16), faceArcade, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); //Survival - UtilText.MakeText("SURVIVAL", locSurvival, faceSurvival, 159, (byte)5, TextAlign.CENTER); - UtilText.MakeText("SURVIVAL", locSurvival.clone().add(-1, 0, 0), faceSurvival, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); + UtilBlockText.MakeText("SURVIVAL", locSurvival, faceSurvival, 159, (byte)5, TextAlign.CENTER); + UtilBlockText.MakeText("SURVIVAL", locSurvival.clone().add(-1, 0, 0), faceSurvival, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); - UtilText.MakeText("THE BRIDGES", locSurvival.clone().add(-15, 14, 0), faceSurvival, 159, (byte)4, TextAlign.CENTER); - UtilText.MakeText("THE BRIDGES", locSurvival.clone().add(-16, 14, 0), faceSurvival, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); + UtilBlockText.MakeText("THE BRIDGES", locSurvival.clone().add(-15, 14, 0), faceSurvival, 159, (byte)4, TextAlign.CENTER); + UtilBlockText.MakeText("THE BRIDGES", locSurvival.clone().add(-16, 14, 0), faceSurvival, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); - UtilText.MakeText("SURVIVAL GAMES", locSurvival.clone().add(-15, 21, 0), faceSurvival, 159, (byte)1, TextAlign.CENTER); - UtilText.MakeText("SURVIVAL GAMES", locSurvival.clone().add(-16, 21, 0), faceSurvival, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); + UtilBlockText.MakeText("SURVIVAL GAMES", locSurvival.clone().add(-15, 21, 0), faceSurvival, 159, (byte)1, TextAlign.CENTER); + UtilBlockText.MakeText("SURVIVAL GAMES", locSurvival.clone().add(-16, 21, 0), faceSurvival, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); - UtilText.MakeText("ULTRA HARDCORE", locSurvival.clone().add(-15, 28, 0), faceSurvival, 159, (byte)14, TextAlign.CENTER); - UtilText.MakeText("ULTRA HARDCORE", locSurvival.clone().add(-16, 28, 0), faceSurvival, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); + UtilBlockText.MakeText("ULTRA HARDCORE", locSurvival.clone().add(-15, 28, 0), faceSurvival, 159, (byte)14, TextAlign.CENTER); + UtilBlockText.MakeText("ULTRA HARDCORE", locSurvival.clone().add(-16, 28, 0), faceSurvival, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); //Other - UtilText.MakeText("CLASSICS", locClassics, faceOther, 159, (byte)5, TextAlign.CENTER); - UtilText.MakeText("CLASSICS", locClassics.add(0, 0, -1), faceOther, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); + UtilBlockText.MakeText("CLASSICS", locClassics, faceOther, 159, (byte)5, TextAlign.CENTER); + UtilBlockText.MakeText("CLASSICS", locClassics.add(0, 0, -1), faceOther, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); - UtilText.MakeText("SUPER SMASH MOBS", locClassics.clone().add(0, 14, -15), faceOther, 159, (byte)4, TextAlign.CENTER); - UtilText.MakeText("SUPER SMASH MOBS", locClassics.clone().add(0, 14, -16), faceOther, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); + UtilBlockText.MakeText("SUPER SMASH MOBS", locClassics.clone().add(0, 14, -15), faceOther, 159, (byte)4, TextAlign.CENTER); + UtilBlockText.MakeText("SUPER SMASH MOBS", locClassics.clone().add(0, 14, -16), faceOther, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); - UtilText.MakeText("MINE STRIKE", locClassics.clone().add(0, 21, -15), faceOther, 159, (byte)1, TextAlign.CENTER); - UtilText.MakeText("MINE STRIKE", locClassics.clone().add(0, 21, -16), faceOther, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); + UtilBlockText.MakeText("MINE STRIKE", locClassics.clone().add(0, 21, -15), faceOther, 159, (byte)1, TextAlign.CENTER); + UtilBlockText.MakeText("MINE STRIKE", locClassics.clone().add(0, 21, -16), faceOther, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); - UtilText.MakeText("BLOCK HUNT", locClassics.clone().add(0, 28, -15), faceOther, 159, (byte)14, TextAlign.CENTER); - UtilText.MakeText("BLOCK HUNT", locClassics.clone().add(0, 28, -16), faceOther, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); + UtilBlockText.MakeText("BLOCK HUNT", locClassics.clone().add(0, 28, -15), faceOther, 159, (byte)14, TextAlign.CENTER); + UtilBlockText.MakeText("BLOCK HUNT", locClassics.clone().add(0, 28, -16), faceOther, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); } /* diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/UHCManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/UHCManager.java index 0106ff99c..b4ae6106c 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/UHCManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/UHCManager.java @@ -9,7 +9,7 @@ import mineplex.core.common.util.C; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTime; -import mineplex.core.common.util.UtilTitle; +import mineplex.core.common.util.UtilTextMiddle; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.hub.HubManager; @@ -63,7 +63,7 @@ public class UHCManager extends MiniPlugin _canAnnounce3 = false; announce("Opening in 3 minutes..."); - UtilTitle.display(C.cRed + "Ultra Hardcore", "Open in 3 minutes...", 10, 100, 20); + UtilTextMiddle.display(C.cRed + "Ultra Hardcore", "Open in 3 minutes...", 10, 100, 20); } else if (_canAnnounce2 && time % _delay > _delay - 120000) @@ -71,7 +71,7 @@ public class UHCManager extends MiniPlugin _canAnnounce2 = false; announce("Opening in 2 minutes..."); - UtilTitle.display(C.cRed + "Ultra Hardcore", "Open in 2 minutes...", 10, 100, 20); + UtilTextMiddle.display(C.cRed + "Ultra Hardcore", "Open in 2 minutes...", 10, 100, 20); } else if (_canAnnounce1 && time % _delay > _delay - 60000) @@ -79,7 +79,7 @@ public class UHCManager extends MiniPlugin _canAnnounce1 = false; announce("Opening in 1 minute..."); - UtilTitle.display(C.cRed + "Ultra Hardcore", "Open in 1 minute...", 10, 100, 20); + UtilTextMiddle.display(C.cRed + "Ultra Hardcore", "Open in 1 minute...", 10, 100, 20); } else if (_canAnnounce0 && time % _delay < 30000) @@ -87,7 +87,7 @@ public class UHCManager extends MiniPlugin _canAnnounce0 = false; announce("UHC Open! Join at the Ultra Hardcore NPC!"); - UtilTitle.display(C.cRed + "Ultra Hardcore", "Join at the NPC to play", 10, 100, 20); + UtilTextMiddle.display(C.cRed + "Ultra Hardcore", "Join at the NPC to play", 10, 100, 20); } } } diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Skill.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Skill.java index ce6a346b4..cd71c98bf 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Skill.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Skill.java @@ -6,8 +6,9 @@ import java.util.Set; import mineplex.core.common.util.C; import mineplex.core.common.util.NautHashMap; -import mineplex.core.common.util.UtilDisplay; + import mineplex.core.common.util.UtilGear; +import mineplex.core.common.util.UtilTextBottom; import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType; import mineplex.minecraft.game.classcombat.Skill.repository.token.SkillToken; @@ -316,8 +317,7 @@ public abstract class Skill implements ISkill, Listener public void DisplayProgress(Player player, String ability, float amount) { - //player.setExp(amount); - UtilDisplay.displayTextBar(Factory.GetPlugin(), player, amount, C.cYellow + C.Bold + ability + ChatColor.RESET + " - " + C.cGreen + C.Bold + (int)(amount*100) + "%"); + UtilTextBottom.displayProgress(C.Bold + ability, amount, player); if (amount < 1) player.playSound(player.getLocation(), Sound.NOTE_PIANO, 0.5f, 0.5f + (amount * 1.5f)); @@ -325,6 +325,6 @@ public abstract class Skill implements ISkill, Listener public void ResetProgress(Player player) { - //player.setExp(0f); + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java index bfff331c3..627744d05 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java @@ -129,7 +129,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation private Portal _portal; private ArcadeShop _arcadeShop; - + // Managers private GameFactory _gameFactory; private GameCreationManager _gameCreationManager; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java index 8f37dac53..7cfa4621a 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java @@ -35,7 +35,7 @@ import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTabTitle; import mineplex.core.common.util.UtilTime; -import mineplex.core.common.util.UtilTitle; +import mineplex.core.common.util.UtilTextMiddle; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.combat.DeathMessageType; @@ -975,7 +975,7 @@ public abstract class Game implements Listener UtilPlayer.message(player, ArcadeFormat.Line); } - UtilTitle.display(winnerText, subColor + "won the game", 20, 120, 20); + UtilTextMiddle.display(winnerText, subColor + "won the game", 20, 120, 20); if (AnnounceSilence) Manager.GetChat().Silence(5000, false); @@ -1033,7 +1033,7 @@ public abstract class Game implements Listener UtilPlayer.message(player, ArcadeFormat.Line); } - UtilTitle.display(winnerText, subColor + "won the game", 20, 120, 20); + UtilTextMiddle.display(winnerText, subColor + "won the game", 20, 120, 20); if (AnnounceSilence) Manager.GetChat().Silence(5000, false); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part.java index d97f9864b..29a19459b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part.java @@ -6,9 +6,9 @@ import java.util.Iterator; import mineplex.core.common.util.C; import mineplex.core.common.util.UtilAlg; -import mineplex.core.common.util.UtilDisplay; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilTextTop; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import nautilus.game.arcade.game.games.christmas.Christmas; @@ -190,8 +190,7 @@ public abstract class Part implements Listener if (event.getType() != UpdateType.TICK) return; - for (Player player : UtilServer.getPlayers()) - UtilDisplay.displayTextBar(Host.Manager.GetPlugin(), player, _objectiveHealth, C.cYellow + C.Bold + _objective); + UtilTextTop.displayProgress(C.cYellow + C.Bold + _objective, _objectiveHealth, UtilServer.getPlayers()); } public void AddCreature(Creature ent) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/dominate_data/CapturePoint.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/dominate_data/CapturePoint.java index 776da4d4d..81fd78b0f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/dominate_data/CapturePoint.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/dominate_data/CapturePoint.java @@ -8,7 +8,7 @@ import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilTime; -import mineplex.core.common.util.UtilTitle; +import mineplex.core.common.util.UtilTextMiddle; import nautilus.game.arcade.game.GameTeam; import nautilus.game.arcade.game.games.common.Domination; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscape.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscape.java index a4381b7e1..d6a7c4dc0 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscape.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscape.java @@ -54,7 +54,7 @@ public class DragonEscape extends SoloGame { return HANDLER_LIST; } - + public PlayerFinishEvent(Player who) { super(who); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java index f0107937e..b96abfe88 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java @@ -24,15 +24,16 @@ import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilBlock; -import mineplex.core.common.util.UtilDisplay; + import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; -import mineplex.core.common.util.UtilText; +import mineplex.core.common.util.UtilBlockText; +import mineplex.core.common.util.UtilTextBottom; import mineplex.core.common.util.UtilTime; -import mineplex.core.common.util.UtilText.TextAlign; +import mineplex.core.common.util.UtilBlockText.TextAlign; import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.recharge.Recharge; import mineplex.core.updater.UpdateType; @@ -198,7 +199,7 @@ public class Draw extends SoloGame Bukkit.getPluginManager().callEvent(new DrawRoundEndEvent(_round)); Announce(C.cGold + C.Bold + "Round " + (_roundCount + 1) + " Ended: " + C.cYellow + C.Bold + "The word was " + _round.Word + "!"); - _textBlocks = UtilText.MakeText(_round.Word, _textLocation, BlockFace.WEST, 159, (byte)15, TextAlign.CENTER); + _textBlocks = UtilBlockText.MakeText(_round.Word, _textLocation, BlockFace.WEST, 159, (byte)15, TextAlign.CENTER); _roundTime = System.currentTimeMillis(); _round = null; @@ -321,11 +322,11 @@ public class Draw extends SoloGame { if (_drawers.HasPlayer(player)) { - UtilDisplay.displayTextBar(Manager.GetPlugin(), player, _round.GetTimePercent(), C.cYellow + C.Bold + "Draw " + ChatColor.RESET + C.Bold + _round.Word); + UtilTextBottom.displayProgress(C.Bold + "Draw " + _round.Word, _round.GetTimePercent(), player); } else { - UtilDisplay.displayTextBar(Manager.GetPlugin(), player, _round.GetTimePercent(), C.cYellow + C.Bold + "Guess " + ChatColor.RESET + C.Bold + _round.GetRevealedWord()); + UtilTextBottom.displayProgress(C.cYellow + C.Bold + "Clue " + ChatColor.RESET + C.Bold + _round.GetRevealedWord(), _round.GetTimePercent(), player); } } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/PumpkinKing.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/PumpkinKing.java index 4b0e37cf2..a6a824fc1 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/PumpkinKing.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/PumpkinKing.java @@ -11,12 +11,13 @@ import mineplex.core.common.util.F; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilBlock; -import mineplex.core.common.util.UtilDisplay; + import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilTextTop; import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.updater.UpdateType; @@ -351,10 +352,7 @@ public class PumpkinKing extends CreatureBase } } - for (Player player : UtilServer.getPlayers()) - { - UtilDisplay.displayTextBar(Host.Manager.GetPlugin(), player, percent, text); - } + UtilTextTop.displayProgress(text, percent, UtilServer.getPlayers()); } private void KingDestroyBlocks() diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/waves/WaveBase.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/waves/WaveBase.java index c20a9f27f..13d88b358 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/waves/WaveBase.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/waves/WaveBase.java @@ -15,9 +15,9 @@ import nautilus.game.arcade.game.games.halloween.HalloweenAudio; import mineplex.core.common.util.C; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilServer; -import mineplex.core.common.util.UtilText; +import mineplex.core.common.util.UtilBlockText; import mineplex.core.common.util.UtilTime; -import mineplex.core.common.util.UtilTitle; +import mineplex.core.common.util.UtilTextMiddle; public abstract class WaveBase { @@ -70,7 +70,7 @@ public abstract class WaveBase System.out.println("Wave " + wave + " has started."); Host.Announce(C.cRed + C.Bold + "Wave " + wave + ": " + C.cYellow + _name); - UtilTitle.display(C.cYellow + "Wave " + wave, _name, 10, 100, 20); + UtilTextMiddle.display(C.cYellow + "Wave " + wave, _name, 10, 100, 20); if (_audio != null) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/MineStrike.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/MineStrike.java index ac123a39b..1066109db 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/MineStrike.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/MineStrike.java @@ -71,7 +71,7 @@ import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; -import mineplex.core.common.util.UtilTitle; +import mineplex.core.common.util.UtilTextMiddle; import mineplex.core.common.util.UtilWorld; import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.common.util.UtilParticle.ParticleType; @@ -489,7 +489,7 @@ public class MineStrike extends TeamGame for (Player other : team.GetPlayers(false)) if (!other.equals(player)) { - UtilTitle.display(null, player.getName() + " has the Bomb", 10, 80, 10, other); + UtilTextMiddle.display(null, player.getName() + " has the Bomb", 10, 80, 10, other); UtilPlayer.message(other, C.cGold + C.Bold + player.getName() + " has the Bomb!"); } @@ -498,7 +498,7 @@ public class MineStrike extends TeamGame UtilPlayer.message(player, C.cGold + C.Bold + "Hold Right-Click to place at a Bomb Site!"); //Title - UtilTitle.display(C.cRed + "You have the Bomb", "Hold Right-Click to place at a Bomb Site!", 10, 80, 10, player); + UtilTextMiddle.display(C.cRed + "You have the Bomb", "Hold Right-Click to place at a Bomb Site!", 10, 80, 10, player); } else { @@ -508,7 +508,7 @@ public class MineStrike extends TeamGame UtilPlayer.message(other, C.cGold + C.Bold + player.getName() + " picked up the Bomb!"); //Title - UtilTitle.display(null, player.getName() + " picked up the Bomb", 10, 50, 10, other); + UtilTextMiddle.display(null, player.getName() + " picked up the Bomb", 10, 50, 10, other); } @@ -516,7 +516,7 @@ public class MineStrike extends TeamGame UtilPlayer.message(player, C.cGold + C.Bold + "You picked up the Bomb!"); //Title - UtilTitle.display(null, "You picked up the Bomb", 10, 50, 10, player); + UtilTextMiddle.display(null, "You picked up the Bomb", 10, 50, 10, player); } @@ -1432,7 +1432,7 @@ public class MineStrike extends TeamGame } } - UtilTitle.display("DEAD", reason, 0, 100, 20, killed); + UtilTextMiddle.display("DEAD", reason, 0, 100, 20, killed); } } @@ -1562,7 +1562,7 @@ public class MineStrike extends TeamGame if (!_bombPlanter.isBlocking() || !_bombPlanter.isOnline()) { _bombPlanter.setExp(0f); - UtilTitle.clear(_bombPlanter); + UtilTextMiddle.clear(_bombPlanter); _bombPlanter = null; return; } @@ -1572,7 +1572,7 @@ public class MineStrike extends TeamGame if (Math.random() > 0.90) _bombPlanter.getWorld().playSound(_bombPlanter.getLocation(), Sound.NOTE_PLING, 1f, 3f); - UtilTitle.display(C.cRed + C.Bold + "Planting Bomb", UtilTitle.progress(_bombPlanter.getExp()), 0, 10, 0, _bombPlanter); + UtilTextMiddle.display(C.cRed + C.Bold + "Planting Bomb", UtilTextMiddle.progress(_bombPlanter.getExp()), 0, 10, 0, _bombPlanter); if (_bombPlanter.getExp() >= 0.98f) { @@ -1593,7 +1593,7 @@ public class MineStrike extends TeamGame playSound(Radio.BOMB_PLANT, null, null); //Title - UtilTitle.display(null, C.cRed + C.Bold + "Bomb has been planted!", 10, 50, 10); + UtilTextMiddle.display(null, C.cRed + C.Bold + "Bomb has been planted!", 10, 50, 10); } } @@ -1685,7 +1685,7 @@ public class MineStrike extends TeamGame _bombDefuser.setExp(Math.min(_bombDefuser.getExp() + defuseRate, 0.99999f)); - UtilTitle.display(C.cAqua + C.Bold + "Defusing Bomb", UtilTitle.progress(_bombDefuser.getExp()), 0, 10, 0, _bombDefuser); + UtilTextMiddle.display(C.cAqua + C.Bold + "Defusing Bomb", UtilTextMiddle.progress(_bombDefuser.getExp()), 0, 10, 0, _bombDefuser); if (_bombDefuser.getExp() >= 0.98f) { @@ -1920,7 +1920,7 @@ public class MineStrike extends TeamGame for (Player player : UtilServer.getPlayers()) player.playSound(player.getLocation(), Sound.LEVEL_UP, 1f, 1f); - UtilTitle.display(null, winnerLine, 20, 120, 20); + UtilTextMiddle.display(null, winnerLine, 20, 120, 20); //Check for total game win EndCheck(); @@ -1984,7 +1984,7 @@ public class MineStrike extends TeamGame Manager.GetCondition().Factory().Blind("Respawn", player, null, 2, 0, false, false, false); UtilPlayer.message(player, F.main("Game", "You have " + F.elem(C.cGreen + "$" + _shopManager.getMoney(player)) + ". Open your Inventory to spend it.")); - UtilTitle.display(C.cGreen + "$" + _shopManager.getMoney(player), "Open your Inventory to buy new equipment", 10, 120, 10, player); + UtilTextMiddle.display(C.cGreen + "$" + _shopManager.getMoney(player), "Open your Inventory to buy new equipment", 10, 120, 10, player); } //Update Scoreboard Teams @@ -2728,7 +2728,7 @@ public class MineStrike extends TeamGame returnToHub(event.getPlayer()); else - UtilTitle.display(C.cGold + C.Bold + "MineStrike", "Make sure you accept the Resource Pack", 20, 120, 20, event.getPlayer()); + UtilTextMiddle.display(C.cGold + C.Bold + "MineStrike", "Make sure you accept the Resource Pack", 20, 120, 20, event.getPlayer()); } @EventHandler diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/items/guns/Gun.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/items/guns/Gun.java index 9a32d3a80..1d23e8c2f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/items/guns/Gun.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/items/guns/Gun.java @@ -3,12 +3,13 @@ package nautilus.game.arcade.game.games.minestrike.items.guns; import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilAlg; -import mineplex.core.common.util.UtilDisplay; + import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilTextBottom; import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilServer; @@ -318,7 +319,8 @@ public class Gun extends StrikeItem _reloading = false; Recharge.Instance.recharge(player, getName() + " Reload"); - UtilDisplay.displayTextBar(game.Manager.GetPlugin(), player, 1, C.cRed + C.Bold + getName() + " Reload"); + + UtilTextBottom.display(C.cRed + C.Bold + getName() + " Reload Cancelled", player); return; } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepData.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepData.java index 37eb94130..a7f6daccf 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepData.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepData.java @@ -18,11 +18,12 @@ import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; -import mineplex.core.common.util.UtilDisplay; + import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilTextTop; import mineplex.core.common.util.UtilTime; import nautilus.game.arcade.game.GameTeam; @@ -110,7 +111,8 @@ public class SheepData Host.AddGems(Holder, 3, "Sheep Captured", true); UtilPlayer.message(Holder, F.main("Game", "You captured a Sheep!")); - UtilDisplay.displayTextBar(Host.Manager.GetPlugin(), Holder, 0f, C.cGreen + C.Bold + "You captured a Sheep!"); + + UtilTextTop.display(C.cGreen + C.Bold + "You captured a Sheep!", Holder); } Holder = null; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java index 6bb919f66..cbbe64e84 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java @@ -31,12 +31,13 @@ import org.bukkit.event.player.PlayerInteractEntityEvent; import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilAlg; -import mineplex.core.common.util.UtilDisplay; + import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilTextTop; import mineplex.core.common.util.UtilTime; import mineplex.minecraft.game.core.condition.Condition.ConditionType; import mineplex.core.itemstack.ItemStackFactory; @@ -377,7 +378,7 @@ public class SheepGame extends TeamGame } if (hadSheep) - UtilDisplay.displayTextBar(Manager.GetPlugin(), player, 0f, C.cRed + C.Bold + "You dropped your Sheep!"); + UtilTextTop.display(C.cRed + C.Bold + "You dropped your Sheep!", player); player.setExp(0f); @@ -448,7 +449,7 @@ public class SheepGame extends TeamGame Manager.GetCondition().Factory().Slow("Sheep Slow", player, player, 3, count-1, false, false, false, true); - UtilDisplay.displayTextBar(Manager.GetPlugin(), player, (float)count/3f, C.Bold + "Return the Sheep to your Team Pen!"); + UtilTextTop.displayProgress(C.Bold + "Return the Sheep to your Team Pen!", (float)count/3f, player); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkLazer.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkLazer.java index 56c3009a8..582a7a105 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkLazer.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkLazer.java @@ -182,7 +182,7 @@ public class PerkLazer extends Perk UtilParticle.PlayParticle(ParticleType.EXPLODE, target, 0, 0, 0, 0, 1); - //Firework + //Firework UtilFirework.playFirework(player.getLocation().add(player.getLocation().getDirection().multiply(Math.max(0, curRange - 0.6))), Type.BURST, Color.YELLOW, false, false); for (LivingEntity other : UtilEnt.getInRadius(target, 5).keySet()) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java index 4b50ddca0..323c27242 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java @@ -47,8 +47,8 @@ import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilServer; -import mineplex.core.common.util.UtilText; -import mineplex.core.common.util.UtilText.TextAlign; +import mineplex.core.common.util.UtilBlockText; +import mineplex.core.common.util.UtilBlockText.TextAlign; import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilWorld; import mineplex.core.cosmetic.event.ActivateGemBoosterEvent; @@ -218,7 +218,7 @@ public class GameLobbyManager implements Listener, IPacketHandler if (line > 0) loc.add(0, line*-6, 0); - UtilText.MakeText(text, loc, face, id, data, TextAlign.CENTER); + UtilBlockText.MakeText(text, loc, face, id, data, TextAlign.CENTER); player.sendMessage("Writing: " + text + " @ " + UtilWorld.locToStrClean(loc)); } @@ -232,7 +232,7 @@ public class GameLobbyManager implements Listener, IPacketHandler BlockFace face = BlockFace.WEST; - UtilText.MakeText(text, loc, face, id, data, TextAlign.CENTER); + UtilBlockText.MakeText(text, loc, face, id, data, TextAlign.CENTER); } public void WriteAdvertiseLine(String text, int line, int id, byte data) @@ -244,7 +244,7 @@ public class GameLobbyManager implements Listener, IPacketHandler BlockFace face = BlockFace.EAST; - UtilText.MakeText(text, loc, face, id, data, TextAlign.CENTER); + UtilBlockText.MakeText(text, loc, face, id, data, TextAlign.CENTER); } public void WriteKitLine(String text, int line, int id, byte data) @@ -256,7 +256,7 @@ public class GameLobbyManager implements Listener, IPacketHandler BlockFace face = BlockFace.NORTH; - UtilText.MakeText(text, loc, face, id, data, TextAlign.CENTER); + UtilBlockText.MakeText(text, loc, face, id, data, TextAlign.CENTER); } public void WriteTeamLine(String text, int line, int id, byte data) @@ -268,7 +268,7 @@ public class GameLobbyManager implements Listener, IPacketHandler BlockFace face = BlockFace.SOUTH; - UtilText.MakeText(text, loc, face, id, data, TextAlign.CENTER); + UtilBlockText.MakeText(text, loc, face, id, data, TextAlign.CENTER); } public Location GetSpawn() diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLootManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLootManager.java index 4cec74ec2..3dc93b055 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLootManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLootManager.java @@ -23,7 +23,7 @@ import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; -import mineplex.core.common.util.UtilTitle; +import mineplex.core.common.util.UtilTextMiddle; import mineplex.core.pet.PetManager; import mineplex.core.reward.Reward; import mineplex.core.reward.RewardData; @@ -167,7 +167,7 @@ public class GameLootManager implements Listener System.out.println(F.name(player.getName()) + " found" + rarityName + " " + outputName); //Self Display - UtilTitle.display(C.cGreen + "Game Loot", "You found " + outputName, 20, 120, 20, player); + UtilTextMiddle.display(C.cGreen + "Game Loot", "You found " + outputName, 20, 120, 20, player); //if (reward.getRarity() == RewardRarity.COMMON) // UtilPlayer.message(player, F.main("Loot", "You found " + rarityName + outputName)); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java index 3428c19d0..1039e039b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java @@ -6,11 +6,11 @@ import java.util.Iterator; import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilAlg; -import mineplex.core.common.util.UtilDisplay; import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilTextTop; import mineplex.core.common.util.UtilTime; import mineplex.minecraft.game.core.condition.Condition.ConditionType; import mineplex.core.mount.Mount; @@ -83,8 +83,8 @@ public class GameManager implements Listener health = Manager.GetGame().GetCountdown() / 60d; } - for (Player player : UtilServer.getPlayers()) - UtilDisplay.displayTextBar(Manager.GetPlugin(), player, health, text); + //Display IP + UtilTextTop.display(text, UtilServer.getPlayers()); for (Mount mount : Manager.getCosmeticManager().getMountManager().getMounts()) {