From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Tom 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 index 8d48f45d695b15eb136bc7609315f5dc88104e7c..5e12cfce9d61221651c88a8323a4f099adcf3fa2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -2309,6 +2309,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper end + // Paper start + @Override + public Set getTrackedPlayers() { + if (entity.tracker == null) { + return java.util.Collections.emptySet(); + } + + Set 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() {