Skip to content

Commit

Permalink
Set NPC custom name to null when display name is empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
OliverSchlueter committed Nov 14, 2024
1 parent 0e8a2cb commit cdc11ca
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ public void update(Player player) {

if (data.getDisplayName().equalsIgnoreCase("<empty>")) {
team.setNameTagVisibility(Team.Visibility.NEVER);
npc.setCustomName(null);
npc.setCustomNameVisible(false);
} else {
team.setNameTagVisibility(Team.Visibility.ALWAYS);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ public void update(Player player) {

if (data.getDisplayName().equalsIgnoreCase("<empty>")) {
team.setNameTagVisibility(Team.Visibility.NEVER);
npc.setCustomName(null);
npc.setCustomNameVisible(false);
} else {
team.setNameTagVisibility(Team.Visibility.ALWAYS);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ public void update(Player player) {

if (data.getDisplayName().equalsIgnoreCase("<empty>")) {
team.setNameTagVisibility(Team.Visibility.NEVER);
npc.setCustomName(null);
npc.setCustomNameVisible(false);
} else {
team.setNameTagVisibility(Team.Visibility.ALWAYS);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ public void update(Player player) {

if (data.getDisplayName().equalsIgnoreCase("<empty>")) {
team.setNameTagVisibility(Team.Visibility.NEVER);
npc.setCustomName(null);
npc.setCustomNameVisible(false);
} else {
team.setNameTagVisibility(Team.Visibility.ALWAYS);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ public void update(Player player) {

if (data.getDisplayName().equalsIgnoreCase("<empty>")) {
team.setNameTagVisibility(Team.Visibility.NEVER);
npc.setCustomName(null);
npc.setCustomNameVisible(false);
} else {
team.setNameTagVisibility(Team.Visibility.ALWAYS);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ public void update(Player player) {

if (data.getDisplayName().equalsIgnoreCase("<empty>")) {
team.setNameTagVisibility(Team.Visibility.NEVER);
npc.setCustomName(null);
npc.setCustomNameVisible(false);
} else {
team.setNameTagVisibility(Team.Visibility.ALWAYS);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ public void update(Player player) {

if (data.getDisplayName().equalsIgnoreCase("<empty>")) {
team.setNameTagVisibility(Team.Visibility.NEVER);
npc.setCustomName(null);
npc.setCustomNameVisible(false);
} else {
team.setNameTagVisibility(Team.Visibility.ALWAYS);
}
Expand Down

0 comments on commit cdc11ca

Please sign in to comment.