Mineplex in scoreboard is fancier.
This commit is contained in:
parent
b21ae8ef72
commit
b6ba142c5a
@ -2,6 +2,6 @@
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
|
||||
<classpathentry kind="var" path="REPO_DIR/Plugins/bin/craftbukkit.jar"/>
|
||||
<classpathentry kind="lib" path="Z:/Mineplex/master/Plugins/Libraries/craftbukkit.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
@ -7,12 +7,10 @@ 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.PacketPlayInClientCommand;
|
||||
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.craftbukkit.v1_7_R4.entity.CraftPlayer;
|
||||
import org.bukkit.entity.EntityType;
|
||||
@ -29,7 +27,7 @@ public class UtilDisplay
|
||||
public static void sendPacket(Player player, Packet packet){
|
||||
EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
|
||||
|
||||
entityPlayer.playerConnection.sendPacket(packet);
|
||||
entityPlayer.playerConnection.sendPacket(packet);
|
||||
}
|
||||
|
||||
//Accessing packets
|
||||
|
@ -3,6 +3,6 @@
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/jline-2.6.jar"/>
|
||||
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/craftbukkit_official.jar"/>
|
||||
<classpathentry kind="lib" path="Z:/Mineplex/master/Plugins/Libraries/craftbukkit_official.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
@ -285,6 +285,18 @@ public class GameManager implements Listener
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void ScoreboardTitle(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.FASTEST)
|
||||
return;
|
||||
|
||||
Game game = Manager.GetGame();
|
||||
if (game == null) return;
|
||||
|
||||
game.GetScoreboard().UpdateTitle();
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST) //BEFORE PARSE DATA
|
||||
public void TeamGeneration(GameStateChangeEvent event)
|
||||
|
@ -30,9 +30,11 @@ public class GameScoreboard
|
||||
private String[] _current = new String[15];
|
||||
|
||||
private String _title;
|
||||
private int _shineIndex;
|
||||
private boolean _shineDirection = true;
|
||||
|
||||
private boolean _debug = false;
|
||||
|
||||
|
||||
public GameScoreboard(Game game)
|
||||
{
|
||||
Game = game;
|
||||
@ -59,7 +61,51 @@ public class GameScoreboard
|
||||
|
||||
public void UpdateTitle()
|
||||
{
|
||||
|
||||
String out;
|
||||
|
||||
if (_shineDirection)
|
||||
{
|
||||
out = C.cGold + C.Bold;
|
||||
}
|
||||
else
|
||||
{
|
||||
out = C.cWhite + C.Bold;
|
||||
}
|
||||
|
||||
for (int i=0 ; i < _title.length() ; i++)
|
||||
{
|
||||
char c = _title.charAt(i);
|
||||
|
||||
if (_shineDirection)
|
||||
{
|
||||
if (i == _shineIndex)
|
||||
out += C.cYellow + C.Bold;
|
||||
|
||||
if (i == _shineIndex + 1)
|
||||
out += C.cWhite + C.Bold;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (i == _shineIndex)
|
||||
out += C.cYellow + C.Bold;
|
||||
|
||||
if (i == _shineIndex + 1)
|
||||
out += C.cGold + C.Bold;
|
||||
}
|
||||
|
||||
|
||||
out += c;
|
||||
}
|
||||
|
||||
_sideObjective.setDisplayName(out);
|
||||
|
||||
_shineIndex++;
|
||||
|
||||
if (_shineIndex == _title.length()*2)
|
||||
{
|
||||
_shineIndex = 0;
|
||||
_shineDirection = !_shineDirection;
|
||||
}
|
||||
}
|
||||
|
||||
public String ParseTeamName(String name)
|
||||
|
Loading…
Reference in New Issue
Block a user