2021-06-15 04:59:31 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Tom <cryptite@gmail.com>
|
|
|
|
Date: Fri, 26 Feb 2021 16:24:25 -0600
|
|
|
|
Subject: [PATCH] Expose Tracked Players
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
2021-06-17 00:57:49 +02:00
|
|
|
index a28625f0b6e98b61f395a1b3ee07c2f7bc195893..e5a2fcd390ab5b41d7e482d486cef42a9eef94f5 100644
|
2021-06-15 04:59:31 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
2021-06-17 00:57:49 +02:00
|
|
|
@@ -2337,6 +2337,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
2021-06-15 04:59:31 +02:00
|
|
|
}
|
|
|
|
// Paper end
|
|
|
|
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
|
|
|
+ public Set<Player> getTrackedPlayers() {
|
|
|
|
+ if (entity.tracker == null) {
|
|
|
|
+ return java.util.Collections.emptySet();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Set<Player> set = new HashSet<>(entity.tracker.seenBy.size());
|
|
|
|
+ for (net.minecraft.server.network.ServerPlayerConnection connection : entity.tracker.seenBy) {
|
|
|
|
+ set.add(connection.getPlayer().getBukkitEntity().getPlayer());
|
|
|
|
+ }
|
|
|
|
+ return set;
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
// Spigot start
|
|
|
|
private final Player.Spigot spigot = new Player.Spigot()
|
|
|
|
{
|