From 3edd1248ef0d4f5aef3f5f024607c92b9e97c354 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Tue, 29 Jan 2019 23:19:13 +1300 Subject: [PATCH] Cleaned up scoreboard team color/prefix/suffix code and correctly ordered the layout --- .../disguise/commands/DisguiseBaseCommand.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/commands/DisguiseBaseCommand.java b/src/main/java/me/libraryaddict/disguise/commands/DisguiseBaseCommand.java index 0e7c7b5c..029d6291 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/DisguiseBaseCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/DisguiseBaseCommand.java @@ -53,8 +53,11 @@ public abstract class DisguiseBaseCommand implements CommandExecutor { protected String getDisplayName(CommandSender player) { Team team = ((Player) player).getScoreboard().getEntryTeam(player.getName()); - return (team == null ? "" : team.getColor() + team.getPrefix()) + player.getName() + - (team == null ? "" : team.getSuffix()); + if (team == null) { + return player.getName(); + } + + return team.getPrefix() + team.getColor() + player.getName() + team.getSuffix(); } protected ArrayList getAllowedDisguises(DisguisePermissions permissions) {