Move scoreboard tags outside of team code

This commit is contained in:
fullwall 2024-08-25 03:11:32 +08:00
parent 3cd096f84d
commit 3c036f371f

View File

@ -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().<Object> 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;