i think i fixed the issue when u haven't joined the server yet

This commit is contained in:
night0721 2022-07-13 14:55:49 +01:00
parent fc1d9d7639
commit ce2c7df7dc
3 changed files with 5 additions and 9 deletions

View file

@ -38,7 +38,6 @@ public class NameTagManager {
} }
} }
public void removeTag(Player player) { public void removeTag(Player player) {
Rank rank = main.getRankManager().getRank(player.getUniqueId());
for(Player target : Bukkit.getOnlinePlayers()) { for(Player target : Bukkit.getOnlinePlayers()) {
target.getScoreboard().getEntryTeam(player.getName()).removeEntry(player.getName()); target.getScoreboard().getEntryTeam(player.getName()).removeEntry(player.getName());
} }

View file

@ -38,10 +38,11 @@ public class RankManager {
e.printStackTrace(); e.printStackTrace();
} }
for(Player player : Bukkit.getOnlinePlayers()) { for(Player player : Bukkit.getOnlinePlayers()) {
main.getNameTagManager().removeTag(player); if(player.getUniqueId() != uuid) {
main.getNameTagManager().newTag(player); main.getNameTagManager().removeTag(player);
main.getNameTagManager().newTag(player);
}
} }
} }
public Rank getRank(UUID uuid) { public Rank getRank(UUID uuid) {
return Rank.valueOf(config.getString(uuid.toString())); return Rank.valueOf(config.getString(uuid.toString()));

View file

@ -11,11 +11,7 @@ import java.util.HashMap;
import java.util.UUID; import java.util.UUID;
public class SideBarManager { public class SideBarManager {
private Main main; private final HashMap<UUID, Integer> deaths = new HashMap<>();
public SideBarManager(Main main) {
this.main = main;
}
private HashMap<UUID, Integer> deaths = new HashMap<>();
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public void setSideBar(Player player) { public void setSideBar(Player player) {
Scoreboard board = player.getScoreboard(); Scoreboard board = player.getScoreboard();