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) {
Rank rank = main.getRankManager().getRank(player.getUniqueId());
for(Player target : Bukkit.getOnlinePlayers()) {
target.getScoreboard().getEntryTeam(player.getName()).removeEntry(player.getName());
}

View file

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

View file

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