Updated GUI text.

- recharges/etc now use bottom text
- uses appropriate bottom/top for 1.7 or 1.8
- fixed 1.7 dragon bar so it works as it did pre-1.8
- dragon bar in 1.8 will now send dragon+wither, for more reliability
- renamed utils to be more clear
This commit is contained in:
Chiss 2014-10-25 13:40:34 +11:00
parent 7dbba0a1f9
commit 4002528c51
26 changed files with 342 additions and 281 deletions

View File

@ -10,7 +10,7 @@ import org.bukkit.World;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
public class UtilText public class UtilBlockText
{ {
public enum TextAlign public enum TextAlign
{ {

View File

@ -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<String, Boolean> hasHealthBar = new HashMap<String, Boolean>();
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);
}
}

View File

@ -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<bars ; i++)
{
if (!colorChange && (float)i/(float)bars >= 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);
}
}
}
}

View File

@ -11,7 +11,7 @@ import org.spigotmc.ProtocolInjector.PacketTitle.Action;
/** /**
* Created by Shaun on 9/5/2014. * Created by Shaun on 9/5/2014.
*/ */
public class UtilTitle public class UtilTextMiddle
{ {
public static void display(String text, String subtitle, Player... players) public static void display(String text, String subtitle, Player... players)
{ {

View File

@ -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;
}
}

View File

@ -1,9 +1,11 @@
package mineplex.core.recharge; package mineplex.core.recharge;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilDisplay;
import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTextBottom;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -63,12 +65,11 @@ public class RechargeData
{ {
if (!UtilTime.elapsed(Time, Recharge)) if (!UtilTime.elapsed(Time, Recharge))
{ {
UtilDisplay.displayTextBar(Host.GetPlugin(), Player, percent, C.cRed + C.Bold + Name + ChatColor.RESET + " - " + UtilTextBottom.displayProgress(C.Bold + Name, percent, UtilTime.MakeStr(Recharge - (System.currentTimeMillis() - Time)), Player);
C.cYellow + C.Bold + UtilTime.MakeStr(Recharge - (System.currentTimeMillis() - Time)));
} }
else else
{ {
UtilDisplay.displayTextBar(Host.GetPlugin(), Player, 1, C.cGreen + C.Bold + Name); UtilTextBottom.display(C.cGreen + C.Bold + Name + " Recharged", Player);
//PLING! //PLING!
if (Recharge > 4000) if (Recharge > 4000)

View File

@ -14,11 +14,12 @@ import mineplex.core.common.Rank;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.Callback; import mineplex.core.common.util.Callback;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilDisplay;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTextTop;
import mineplex.core.common.util.UtilTime; 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.Mount;
import mineplex.core.mount.types.MountDragon; import mineplex.core.mount.types.MountDragon;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
@ -239,9 +240,6 @@ public class NewsManager extends MiniPlugin
{ {
_newsIndex = (_newsIndex + 1)%_news.length; _newsIndex = (_newsIndex + 1)%_news.length;
_newsTime = System.currentTimeMillis(); _newsTime = System.currentTimeMillis();
// JsonMessage jsonMessage = new JsonMessage(_news[_newsIndex]);
// jsonMessage.send(JsonMessage.MessageType.ABOVE_HOTBAR, UtilServer.getPlayers());
} }
if (_newsIndex >= _news.length) if (_newsIndex >= _news.length)
{ {
@ -255,8 +253,8 @@ public class NewsManager extends MiniPlugin
text = text.substring(0, 64); text = text.substring(0, 64);
double healthPercent = (double)_newsIndex/(double)(_news.length-1); 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()) for (Mount mount : Manager.GetMount().getMounts())
{ {
@ -280,7 +278,7 @@ public class NewsManager extends MiniPlugin
@Override @Override
public void run() 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)); }, 60 * i + (i != 0 ? 20 : 0));
} }

View File

@ -1,8 +1,8 @@
package mineplex.hub.modules; package mineplex.hub.modules;
import mineplex.core.MiniPlugin; import mineplex.core.MiniPlugin;
import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilBlockText;
import mineplex.core.common.util.UtilText.TextAlign; import mineplex.core.common.util.UtilBlockText.TextAlign;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.hub.HubManager; import mineplex.hub.HubManager;
@ -55,56 +55,56 @@ public class TextManager extends MiniPlugin
public void CreateText() public void CreateText()
{ {
//Comp //Comp
UtilText.MakeText("CHAMPIONS", locComp, faceComp, 159, (byte)5, TextAlign.CENTER); UtilBlockText.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.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); UtilBlockText.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(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); UtilBlockText.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(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(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); //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 //Arcade
UtilText.MakeText("ARCADE", locArcade, faceArcade, 159, (byte)5, TextAlign.CENTER); UtilBlockText.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.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); UtilBlockText.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, 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); UtilBlockText.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, 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); UtilBlockText.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, 16), faceArcade, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
//Survival //Survival
UtilText.MakeText("SURVIVAL", locSurvival, faceSurvival, 159, (byte)5, TextAlign.CENTER); UtilBlockText.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.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); UtilBlockText.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(-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); UtilBlockText.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(-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); UtilBlockText.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(-16, 28, 0), faceSurvival, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
//Other //Other
UtilText.MakeText("CLASSICS", locClassics, faceOther, 159, (byte)5, TextAlign.CENTER); UtilBlockText.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.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); UtilBlockText.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, -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); UtilBlockText.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, -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); UtilBlockText.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, -16), faceOther, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
} }
/* /*

View File

@ -9,7 +9,7 @@ import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime; 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.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.hub.HubManager; import mineplex.hub.HubManager;
@ -63,7 +63,7 @@ public class UHCManager extends MiniPlugin
_canAnnounce3 = false; _canAnnounce3 = false;
announce("Opening in 3 minutes..."); 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) else if (_canAnnounce2 && time % _delay > _delay - 120000)
@ -71,7 +71,7 @@ public class UHCManager extends MiniPlugin
_canAnnounce2 = false; _canAnnounce2 = false;
announce("Opening in 2 minutes..."); 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) else if (_canAnnounce1 && time % _delay > _delay - 60000)
@ -79,7 +79,7 @@ public class UHCManager extends MiniPlugin
_canAnnounce1 = false; _canAnnounce1 = false;
announce("Opening in 1 minute..."); 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) else if (_canAnnounce0 && time % _delay < 30000)
@ -87,7 +87,7 @@ public class UHCManager extends MiniPlugin
_canAnnounce0 = false; _canAnnounce0 = false;
announce("UHC Open! Join at the Ultra Hardcore NPC!"); 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);
} }
} }
} }

View File

@ -6,8 +6,9 @@ import java.util.Set;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.NautHashMap; import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilDisplay;
import mineplex.core.common.util.UtilGear; 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.Class.IPvpClass.ClassType;
import mineplex.minecraft.game.classcombat.Skill.repository.token.SkillToken; 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) public void DisplayProgress(Player player, String ability, float amount)
{ {
//player.setExp(amount); UtilTextBottom.displayProgress(C.Bold + ability, amount, player);
UtilDisplay.displayTextBar(Factory.GetPlugin(), player, amount, C.cYellow + C.Bold + ability + ChatColor.RESET + " - " + C.cGreen + C.Bold + (int)(amount*100) + "%");
if (amount < 1) if (amount < 1)
player.playSound(player.getLocation(), Sound.NOTE_PIANO, 0.5f, 0.5f + (amount * 1.5f)); 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) public void ResetProgress(Player player)
{ {
//player.setExp(0f);
} }
} }

View File

@ -35,7 +35,7 @@ import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTabTitle; import mineplex.core.common.util.UtilTabTitle;
import mineplex.core.common.util.UtilTime; 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.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.combat.DeathMessageType; import mineplex.minecraft.game.core.combat.DeathMessageType;
@ -975,7 +975,7 @@ public abstract class Game implements Listener
UtilPlayer.message(player, ArcadeFormat.Line); 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) if (AnnounceSilence)
Manager.GetChat().Silence(5000, false); Manager.GetChat().Silence(5000, false);
@ -1033,7 +1033,7 @@ public abstract class Game implements Listener
UtilPlayer.message(player, ArcadeFormat.Line); 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) if (AnnounceSilence)
Manager.GetChat().Silence(5000, false); Manager.GetChat().Silence(5000, false);

View File

@ -6,9 +6,9 @@ import java.util.Iterator;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilDisplay;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTextTop;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.game.games.christmas.Christmas; import nautilus.game.arcade.game.games.christmas.Christmas;
@ -190,8 +190,7 @@ public abstract class Part implements Listener
if (event.getType() != UpdateType.TICK) if (event.getType() != UpdateType.TICK)
return; return;
for (Player player : UtilServer.getPlayers()) UtilTextTop.displayProgress(C.cYellow + C.Bold + _objective, _objectiveHealth, UtilServer.getPlayers());
UtilDisplay.displayTextBar(Host.Manager.GetPlugin(), player, _objectiveHealth, C.cYellow + C.Bold + _objective);
} }
public void AddCreature(Creature ent) public void AddCreature(Creature ent)

View File

@ -8,7 +8,7 @@ import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilTime; 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.GameTeam;
import nautilus.game.arcade.game.games.common.Domination; import nautilus.game.arcade.game.games.common.Domination;

View File

@ -24,15 +24,16 @@ import mineplex.core.common.util.C;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilDisplay;
import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer; 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.UtilTime;
import mineplex.core.common.util.UtilText.TextAlign; import mineplex.core.common.util.UtilBlockText.TextAlign;
import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.recharge.Recharge; import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
@ -198,7 +199,7 @@ public class Draw extends SoloGame
Bukkit.getPluginManager().callEvent(new DrawRoundEndEvent(_round)); Bukkit.getPluginManager().callEvent(new DrawRoundEndEvent(_round));
Announce(C.cGold + C.Bold + "Round " + (_roundCount + 1) + " Ended: " + C.cYellow + C.Bold + "The word was " + _round.Word + "!"); 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(); _roundTime = System.currentTimeMillis();
_round = null; _round = null;
@ -321,11 +322,11 @@ public class Draw extends SoloGame
{ {
if (_drawers.HasPlayer(player)) 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 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);
} }
} }
} }

View File

@ -11,12 +11,13 @@ import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilDisplay;
import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTextTop;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
@ -351,10 +352,7 @@ public class PumpkinKing extends CreatureBase<Skeleton>
} }
} }
for (Player player : UtilServer.getPlayers()) UtilTextTop.displayProgress(text, percent, UtilServer.getPlayers());
{
UtilDisplay.displayTextBar(Host.Manager.GetPlugin(), player, percent, text);
}
} }
private void KingDestroyBlocks() private void KingDestroyBlocks()

View File

@ -15,9 +15,9 @@ import nautilus.game.arcade.game.games.halloween.HalloweenAudio;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilServer; 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.UtilTime;
import mineplex.core.common.util.UtilTitle; import mineplex.core.common.util.UtilTextMiddle;
public abstract class WaveBase public abstract class WaveBase
{ {
@ -70,7 +70,7 @@ public abstract class WaveBase
System.out.println("Wave " + wave + " has started."); System.out.println("Wave " + wave + " has started.");
Host.Announce(C.cRed + C.Bold + "Wave " + wave + ": " + C.cYellow + _name); 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) if (_audio != null)
{ {

View File

@ -71,7 +71,7 @@ import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer; 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.UtilWorld;
import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ParticleType;
@ -489,7 +489,7 @@ public class MineStrike extends TeamGame
for (Player other : team.GetPlayers(false)) for (Player other : team.GetPlayers(false))
if (!other.equals(player)) 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!"); 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!"); UtilPlayer.message(player, C.cGold + C.Bold + "Hold Right-Click to place at a Bomb Site!");
//Title //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 else
{ {
@ -508,7 +508,7 @@ public class MineStrike extends TeamGame
UtilPlayer.message(other, C.cGold + C.Bold + player.getName() + " picked up the Bomb!"); UtilPlayer.message(other, C.cGold + C.Bold + player.getName() + " picked up the Bomb!");
//Title //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!"); UtilPlayer.message(player, C.cGold + C.Bold + "You picked up the Bomb!");
//Title //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()) if (!_bombPlanter.isBlocking() || !_bombPlanter.isOnline())
{ {
_bombPlanter.setExp(0f); _bombPlanter.setExp(0f);
UtilTitle.clear(_bombPlanter); UtilTextMiddle.clear(_bombPlanter);
_bombPlanter = null; _bombPlanter = null;
return; return;
} }
@ -1572,7 +1572,7 @@ public class MineStrike extends TeamGame
if (Math.random() > 0.90) if (Math.random() > 0.90)
_bombPlanter.getWorld().playSound(_bombPlanter.getLocation(), Sound.NOTE_PLING, 1f, 3f); _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) if (_bombPlanter.getExp() >= 0.98f)
{ {
@ -1593,7 +1593,7 @@ public class MineStrike extends TeamGame
playSound(Radio.BOMB_PLANT, null, null); playSound(Radio.BOMB_PLANT, null, null);
//Title //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)); _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) if (_bombDefuser.getExp() >= 0.98f)
{ {
@ -1920,7 +1920,7 @@ public class MineStrike extends TeamGame
for (Player player : UtilServer.getPlayers()) for (Player player : UtilServer.getPlayers())
player.playSound(player.getLocation(), Sound.LEVEL_UP, 1f, 1f); 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 //Check for total game win
EndCheck(); EndCheck();
@ -1984,7 +1984,7 @@ public class MineStrike extends TeamGame
Manager.GetCondition().Factory().Blind("Respawn", player, null, 2, 0, false, false, false); 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.")); 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 //Update Scoreboard Teams
@ -2728,7 +2728,7 @@ public class MineStrike extends TeamGame
returnToHub(event.getPlayer()); returnToHub(event.getPlayer());
else 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 @EventHandler

View File

@ -3,12 +3,13 @@ package nautilus.game.arcade.game.games.minestrike.items.guns;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilDisplay;
import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilTextBottom;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
@ -318,7 +319,8 @@ public class Gun extends StrikeItem
_reloading = false; _reloading = false;
Recharge.Instance.recharge(player, getName() + " Reload"); 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; return;
} }
} }

View File

@ -18,11 +18,12 @@ import mineplex.core.common.util.C;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilDisplay;
import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilTextTop;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import nautilus.game.arcade.game.GameTeam; import nautilus.game.arcade.game.GameTeam;
@ -110,7 +111,8 @@ public class SheepData
Host.AddGems(Holder, 3, "Sheep Captured", true); Host.AddGems(Holder, 3, "Sheep Captured", true);
UtilPlayer.message(Holder, F.main("Game", "You captured a Sheep!")); 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; Holder = null;

View File

@ -31,12 +31,13 @@ import org.bukkit.event.player.PlayerInteractEntityEvent;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilDisplay;
import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilTextTop;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import mineplex.minecraft.game.core.condition.Condition.ConditionType; import mineplex.minecraft.game.core.condition.Condition.ConditionType;
import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.itemstack.ItemStackFactory;
@ -377,7 +378,7 @@ public class SheepGame extends TeamGame
} }
if (hadSheep) 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); 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); 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);
} }
} }

View File

@ -47,8 +47,8 @@ import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilBlockText;
import mineplex.core.common.util.UtilText.TextAlign; import mineplex.core.common.util.UtilBlockText.TextAlign;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilWorld; import mineplex.core.common.util.UtilWorld;
import mineplex.core.cosmetic.event.ActivateGemBoosterEvent; import mineplex.core.cosmetic.event.ActivateGemBoosterEvent;
@ -218,7 +218,7 @@ public class GameLobbyManager implements Listener, IPacketHandler
if (line > 0) if (line > 0)
loc.add(0, line*-6, 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)); player.sendMessage("Writing: " + text + " @ " + UtilWorld.locToStrClean(loc));
} }
@ -232,7 +232,7 @@ public class GameLobbyManager implements Listener, IPacketHandler
BlockFace face = BlockFace.WEST; 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) 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; 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) 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; 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) 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; 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() public Location GetSpawn()

View File

@ -23,7 +23,7 @@ import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer; 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.pet.PetManager;
import mineplex.core.reward.Reward; import mineplex.core.reward.Reward;
import mineplex.core.reward.RewardData; import mineplex.core.reward.RewardData;
@ -167,7 +167,7 @@ public class GameLootManager implements Listener
System.out.println(F.name(player.getName()) + " found" + rarityName + " " + outputName); System.out.println(F.name(player.getName()) + " found" + rarityName + " " + outputName);
//Self Display //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) //if (reward.getRarity() == RewardRarity.COMMON)
// UtilPlayer.message(player, F.main("Loot", "You found " + rarityName + outputName)); // UtilPlayer.message(player, F.main("Loot", "You found " + rarityName + outputName));

View File

@ -6,11 +6,11 @@ import java.util.Iterator;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilDisplay;
import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTextTop;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import mineplex.minecraft.game.core.condition.Condition.ConditionType; import mineplex.minecraft.game.core.condition.Condition.ConditionType;
import mineplex.core.mount.Mount; import mineplex.core.mount.Mount;
@ -83,8 +83,8 @@ public class GameManager implements Listener
health = Manager.GetGame().GetCountdown() / 60d; health = Manager.GetGame().GetCountdown() / 60d;
} }
for (Player player : UtilServer.getPlayers()) //Display IP
UtilDisplay.displayTextBar(Manager.GetPlugin(), player, health, text); UtilTextTop.display(text, UtilServer.getPlayers());
for (Mount mount : Manager.getCosmeticManager().getMountManager().getMounts()) for (Mount mount : Manager.getCosmeticManager().getMountManager().getMounts())
{ {