Added method NPCManager#getShownToPlayer
This commit is contained in:
parent
03af1d08aa
commit
d126b79742
|
@ -4,6 +4,9 @@
|
||||||
|
|
||||||
package net.jitse.npclib.internal;
|
package net.jitse.npclib.internal;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
@ -18,6 +21,16 @@ public final class NPCManager {
|
||||||
return npcs;
|
return npcs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Set<NPCBase> getShownToPlayer(Player player) {
|
||||||
|
Set<NPCBase> set = Collections.emptySet();
|
||||||
|
for (NPCBase npc : getAllNPCs()) {
|
||||||
|
if (npc.getShown().contains(player.getUniqueId())) {
|
||||||
|
set.add(npc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return set;
|
||||||
|
}
|
||||||
|
|
||||||
public static void add(NPCBase npc) {
|
public static void add(NPCBase npc) {
|
||||||
npcs.add(npc);
|
npcs.add(npc);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue