From ce2c7df7dcfbab441b6d5e69b035bb9408d41476 Mon Sep 17 00:00:00 2001 From: night0721 Date: Wed, 13 Jul 2022 14:55:49 +0100 Subject: [PATCH] i think i fixed the issue when u haven't joined the server yet --- .../java/com/night/nullvalkyrie/Rank/NameTagManager.java | 1 - src/main/java/com/night/nullvalkyrie/Rank/RankManager.java | 7 ++++--- .../java/com/night/nullvalkyrie/Rank/SideBarManager.java | 6 +----- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/night/nullvalkyrie/Rank/NameTagManager.java b/src/main/java/com/night/nullvalkyrie/Rank/NameTagManager.java index 5a1d220..8d93d2d 100644 --- a/src/main/java/com/night/nullvalkyrie/Rank/NameTagManager.java +++ b/src/main/java/com/night/nullvalkyrie/Rank/NameTagManager.java @@ -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()); } diff --git a/src/main/java/com/night/nullvalkyrie/Rank/RankManager.java b/src/main/java/com/night/nullvalkyrie/Rank/RankManager.java index 909ca77..9e9b00b 100644 --- a/src/main/java/com/night/nullvalkyrie/Rank/RankManager.java +++ b/src/main/java/com/night/nullvalkyrie/Rank/RankManager.java @@ -38,10 +38,11 @@ public class RankManager { e.printStackTrace(); } for(Player player : Bukkit.getOnlinePlayers()) { - main.getNameTagManager().removeTag(player); - main.getNameTagManager().newTag(player); + if(player.getUniqueId() != uuid) { + main.getNameTagManager().removeTag(player); + main.getNameTagManager().newTag(player); + } } - } public Rank getRank(UUID uuid) { return Rank.valueOf(config.getString(uuid.toString())); diff --git a/src/main/java/com/night/nullvalkyrie/Rank/SideBarManager.java b/src/main/java/com/night/nullvalkyrie/Rank/SideBarManager.java index 25c070f..54f45eb 100644 --- a/src/main/java/com/night/nullvalkyrie/Rank/SideBarManager.java +++ b/src/main/java/com/night/nullvalkyrie/Rank/SideBarManager.java @@ -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 deaths = new HashMap<>(); + private final HashMap deaths = new HashMap<>(); @SuppressWarnings("deprecation") public void setSideBar(Player player) { Scoreboard board = player.getScoreboard();