Revert "" to "LD_NoName"

This commit is contained in:
libraryaddict 2021-02-09 16:15:33 +13:00
parent 38117d9f59
commit 25f6ac8b1e
3 changed files with 8 additions and 18 deletions

View File

@ -113,7 +113,7 @@ public class PlayerDisguise extends TargetedDisguise {
}
if (scoreboardName == null) {
if (isUpsideDown() || isDeadmau5Ears() || !isNameVisible()) {
if (isUpsideDown() || isDeadmau5Ears()) {
scoreboardName = new DisguiseUtilities.DScoreTeam(this, new String[]{"", getProfileName(), ""});
} else {
scoreboardName = DisguiseUtilities.createExtendedName(this);
@ -147,8 +147,7 @@ public class PlayerDisguise extends TargetedDisguise {
* The actual name that'll be sent in the game profile, not the name that they're known as
*/
public String getProfileName() {
return isUpsideDown() ? "Dinnerbone" : isDeadmau5Ears() ? "deadmau5" :
!isNameVisible() || getName().isEmpty() ? "LD_NoName" : hasScoreboardName() ? getScoreboardName().getPlayer() : getName();
return isUpsideDown() ? "Dinnerbone" : isDeadmau5Ears() ? "deadmau5" : hasScoreboardName() ? getScoreboardName().getPlayer() : getName();
}
public UUID getUUID() {
@ -214,10 +213,6 @@ public class PlayerDisguise extends TargetedDisguise {
getWatcher().setInternalUpsideDown(upsideDown);
if (gameProfile != null) {
gameProfile = ReflectionManager.getGameProfileWithThisSkin(uuid, getProfileName(), getGameProfile());
}
if (isDisguiseInUse()) {
resendDisguise(DisguiseConfig.isArmorstandsName() ? getName() : "Dinnerbone", true);
} else {
@ -234,10 +229,6 @@ public class PlayerDisguise extends TargetedDisguise {
this.deadmau5Ears = deadmau5Ears;
if (gameProfile != null) {
gameProfile = ReflectionManager.getGameProfileWithThisSkin(uuid, getProfileName(), getGameProfile());
}
if (isDisguiseInUse()) {
resendDisguise(DisguiseConfig.isArmorstandsName() ? getName() : "deadmau5", true);
} else {

View File

@ -105,7 +105,7 @@ public class DisguiseUtilities {
}
public void handleTeam(Scoreboard board, boolean nameVisible) {
nameVisible = !getPlayer().equals("LD_NoName") && !DisguiseConfig.isArmorstandsName() && nameVisible;
nameVisible = !DisguiseConfig.isArmorstandsName() && nameVisible;
Team team = board.getTeam(getTeamName());
if (team == null) {
@ -1775,9 +1775,9 @@ public class DisguiseUtilities {
if (mainTeam == null) {
mainTeam = scoreboard.registerNewTeam("LD_NoName");
mainTeam.setOption(Option.NAME_TAG_VISIBILITY, OptionStatus.NEVER);
mainTeam.addEntry("LD_NoName");
} else if (!mainTeam.hasEntry("LD_NoName")) {
mainTeam.addEntry("LD_NoName");
mainTeam.addEntry("");
} else if (!mainTeam.hasEntry("")) {
mainTeam.addEntry("");
}
}

View File

@ -163,11 +163,10 @@ public class PacketHandlerSpawn implements IPacketHandler {
mods.write(5, pitch);
} else if (disguise.getType().isPlayer()) {
PlayerDisguise playerDisguise = (PlayerDisguise) disguise;
boolean visibleOrNewCompat = playerDisguise.isNameVisible() && DisguiseConfig.isScoreboardNames();
boolean visibleOrNewCompat = playerDisguise.isNameVisible() || DisguiseConfig.isScoreboardNames();
WrappedGameProfile spawnProfile = visibleOrNewCompat ? playerDisguise.getGameProfile() : ReflectionManager
.getGameProfileWithThisSkin(UUID.randomUUID(), playerDisguise.isNameVisible() ? playerDisguise.getProfileName() : "LD_NoName",
playerDisguise.getGameProfile());
.getGameProfileWithThisSkin(UUID.randomUUID(), playerDisguise.isNameVisible() ? playerDisguise.getName() : "", playerDisguise.getGameProfile());
int entityId = disguisedEntity.getEntityId();
PlayerSkinHandler.PlayerSkin skin;