Fix Dinnerbone and Grumm being spun the wrong way around

This commit is contained in:
libraryaddict 2020-04-05 02:24:02 +13:00
parent efbd6e29e3
commit 2495ea65c3
No known key found for this signature in database
GPG Key ID: 052E4FBCD257AEA4
2 changed files with 22 additions and 2 deletions

View File

@ -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()) {

View File

@ -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());
}
}