Merge branch 'master' of ssh://184.154.0.242:7999/min/Mineplex

This commit is contained in:
Jonathan Williams 2015-01-12 09:55:44 -08:00
commit 9839edeeee

View File

@ -1,6 +1,8 @@
package nautilus.game.arcade.scoreboard;
import java.util.ArrayList;
import java.util.Objects;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilMath;
import nautilus.game.arcade.game.Game;
@ -259,13 +261,15 @@ public class GameScoreboard
}
}
int i = 0;
while (true)
for (int i = 0; i < 15; i++)
{
if (i >= _chars.length)
if (i >= 15 || i >= _chars.length)
break;
String str = ChatColor.COLOR_CHAR + "" + _chars[i] + ChatColor.RESET;
Score score = GetObjectiveSide().getScore(str);
if (newLines.size() <= i)
{
if (score.isScoreSet())
@ -280,24 +284,36 @@ public class GameScoreboard
else
{
Team team = GetScoreboard().getTeam(str);
if (team == null)
{
team = GetScoreboard().registerNewTeam(str);
team.addEntry(str);
}
String line = newLines.get(i);
team.setPrefix(line.substring(0, Math.min(line.length(), 16)));
team.setSuffix(ChatColor.getLastColors(line) + line.substring(team.getPrefix().length()));
String prefix = line.substring(0, Math.min(line.length(), 16));
String suffix = ChatColor.getLastColors(line) + line.substring(team.getPrefix().length());
if (!(team.getPrefix() == null ? "" : team.getPrefix()).equals(prefix))
team.setPrefix(prefix);
if (!(team.getSuffix() == null ? "" : team.getSuffix()).equals(suffix))
team.setSuffix(suffix);
if (!score.isScoreSet())
{
if (i == 15)
{
score.setScore(1);
}
score.setScore(15 - i);
}
}
i++;
}
}