From 3c036f371f2b5703a654a3e3041bf5021c4cf9d5 Mon Sep 17 00:00:00 2001 From: fullwall Date: Sun, 25 Aug 2024 03:11:32 +0800 Subject: [PATCH] Move scoreboard tags outside of team code --- .../citizensnpcs/trait/ScoreboardTrait.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/main/src/main/java/net/citizensnpcs/trait/ScoreboardTrait.java b/main/src/main/java/net/citizensnpcs/trait/ScoreboardTrait.java index f330e712f..d0863a0ef 100644 --- a/main/src/main/java/net/citizensnpcs/trait/ScoreboardTrait.java +++ b/main/src/main/java/net/citizensnpcs/trait/ScoreboardTrait.java @@ -148,6 +148,15 @@ public class ScoreboardTrait extends Trait { } public void update() { + if (SUPPORT_TAGS) { + try { + if (!npc.getEntity().getScoreboardTags().equals(tags)) { + tags = Sets.newHashSet(npc.getEntity().getScoreboardTags()); + } + } catch (NoSuchMethodError e) { + SUPPORT_TAGS = false; + } + } String forceVisible = npc.data(). get(NPC.Metadata.NAMEPLATE_VISIBLE, true).toString(); boolean nameVisibility = !npc.requiresNameHologram() && (forceVisible.equals("true") || forceVisible.equals("hover")); @@ -169,15 +178,6 @@ public class ScoreboardTrait extends Trait { ? npc.getEntity().getName() : npc.getUniqueId().toString(); } - if (SUPPORT_TAGS) { - try { - if (!npc.getEntity().getScoreboardTags().equals(tags)) { - tags = Sets.newHashSet(npc.getEntity().getScoreboardTags()); - } - } catch (NoSuchMethodError e) { - SUPPORT_TAGS = false; - } - } if (SUPPORT_TEAM_SETOPTION) { try { OptionStatus visibility = nameVisibility ? OptionStatus.ALWAYS : OptionStatus.NEVER;