Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-16 04:50:05 +01:00
4dd33cb8b6
This is no longer needed as Entity#passengers is an ImmutableList as of 1.17
33 Zeilen
1.2 KiB
Diff
33 Zeilen
1.2 KiB
Diff
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
|
|
index e010e67c58b531d00aee7dde6a1bfa05d67aa942..f79b62c413789353af70b691792fe3abc24746dd 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
@@ -2360,6 +2360,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|
}
|
|
// 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()
|
|
{
|