We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 03af1d0 commit d126b79Copy full SHA for d126b79
api/src/main/java/net/jitse/npclib/internal/NPCManager.java
@@ -4,6 +4,9 @@
4
5
package net.jitse.npclib.internal;
6
7
+import org.bukkit.entity.Player;
8
+
9
+import java.util.Collections;
10
import java.util.HashSet;
11
import java.util.Set;
12
@@ -18,6 +21,16 @@ public static Set<NPCBase> getAllNPCs() {
18
21
return npcs;
19
22
}
20
23
24
+ public static Set<NPCBase> getShownToPlayer(Player player) {
25
+ Set<NPCBase> set = Collections.emptySet();
26
+ for (NPCBase npc : getAllNPCs()) {
27
+ if (npc.getShown().contains(player.getUniqueId())) {
28
+ set.add(npc);
29
+ }
30
31
+ return set;
32
33
34
public static void add(NPCBase npc) {
35
npcs.add(npc);
36
0 commit comments