Handle UUIDs for teams as well as names #418

This commit is contained in:
libraryaddict 2020-01-06 07:30:22 +13:00
parent f8fe3116df
commit 54bd979506
No known key found for this signature in database
GPG Key ID: 052E4FBCD257AEA4

View File

@ -188,9 +188,13 @@ public abstract class DisguiseBaseCommand implements CommandExecutor {
protected String getDisplayName(CommandSender player) {
Team team = ((Player) player).getScoreboard().getEntryTeam(player.getName());
if (team == null) {
team = ((Player) player).getScoreboard().getEntryTeam(((Player) player).getUniqueId().toString());
if (team == null) {
return player.getName();
}
}
return team.getPrefix() + team.getColor() + player.getName() + team.getSuffix();
}