mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-10 21:02:36 +01:00
Move scoreboard tags outside of team code
This commit is contained in:
parent
3cd096f84d
commit
3c036f371f
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user