mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-03 15:08:23 +01:00
Make scoreboard trait iterate over NPCs from all registries
This commit is contained in:
parent
155d9c9730
commit
219e016ee7
@ -12,6 +12,7 @@ import org.bukkit.scoreboard.Team;
|
|||||||
import org.bukkit.scoreboard.Team.Option;
|
import org.bukkit.scoreboard.Team.Option;
|
||||||
import org.bukkit.scoreboard.Team.OptionStatus;
|
import org.bukkit.scoreboard.Team.OptionStatus;
|
||||||
|
|
||||||
|
import com.google.common.collect.Iterables;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
import net.citizensnpcs.Settings.Setting;
|
import net.citizensnpcs.Settings.Setting;
|
||||||
@ -40,7 +41,7 @@ public class ScoreboardTrait extends Trait {
|
|||||||
public ScoreboardTrait() {
|
public ScoreboardTrait() {
|
||||||
super("scoreboardtrait");
|
super("scoreboardtrait");
|
||||||
metadata = CitizensAPI.getLocationLookup().<Boolean> registerMetadata("scoreboard", (meta, event) -> {
|
metadata = CitizensAPI.getLocationLookup().<Boolean> registerMetadata("scoreboard", (meta, event) -> {
|
||||||
for (NPC npc : CitizensAPI.getNPCRegistry()) {
|
for (NPC npc : Iterables.concat(CitizensAPI.getNPCRegistries())) {
|
||||||
ScoreboardTrait trait = npc.getTraitNullable(ScoreboardTrait.class);
|
ScoreboardTrait trait = npc.getTraitNullable(ScoreboardTrait.class);
|
||||||
if (trait == null)
|
if (trait == null)
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user