diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/PlayerDisguise.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/PlayerDisguise.java index dbc72b21..7e37549e 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/PlayerDisguise.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/PlayerDisguise.java @@ -98,7 +98,15 @@ public class PlayerDisguise extends TargetedDisguise { return scoreboardName; } + private boolean isStaticName(String name) { + return name != null && (name.equalsIgnoreCase("Dinnerbone") || name.equalsIgnoreCase("Grumm")); + } + public boolean hasScoreboardName() { + if (isStaticName(getName())) { + return false; + } + return scoreboardName != null || DisguiseConfig.isScoreboardDisguiseNames() || getName().length() > 16; } @@ -214,9 +222,9 @@ public class PlayerDisguise extends TargetedDisguise { } if (isDisguiseInUse()) { - boolean resendDisguise = !DisguiseConfig.isScoreboardDisguiseNames(); + boolean resendDisguise = false; - if (hasScoreboardName()) { + if (DisguiseConfig.isScoreboardDisguiseNames() && !isStaticName(name)) { DisguiseUtilities.DScoreTeam team = getScoreboardName(); String[] split = DisguiseUtilities.getExtendedNameSplit(team.getPlayer(), name); @@ -224,6 +232,10 @@ public class PlayerDisguise extends TargetedDisguise { team.setSplit(split); } + resendDisguise = + !DisguiseConfig.isScoreboardDisguiseNames() || isStaticName(name) || isStaticName(getName()) || + resendDisguise; + if (resendDisguise) { if (stopDisguise()) { if (getName().isEmpty() && !name.isEmpty()) { diff --git a/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java b/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java index 4c332b5e..fa5368cd 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java @@ -1300,6 +1300,10 @@ public class DisguiseUtilities { public static void updateExtendedName(PlayerDisguise disguise) { DScoreTeam exName = disguise.getScoreboardName(); + if (exName.getTeamName() == null) { + exName.setTeamName(getUniqueTeam()); + } + for (Scoreboard board : getAllScoreboards()) { exName.handleTeam(board, disguise.isNameVisible()); } @@ -1326,6 +1330,10 @@ public class DisguiseUtilities { DScoreTeam name = ((PlayerDisguise) disguise).getScoreboardName(); + if (name.getTeamName() == null) { + continue; + } + name.handleTeam(scoreboard, ((PlayerDisguise) disguise).isNameVisible()); } }