aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0624-Expose-Tracked-Players.patch
diff options
context:
space:
mode:
authorOwen1212055 <[email protected]>2021-11-08 16:39:42 -0500
committerGitHub <[email protected]>2021-11-08 13:39:42 -0800
commit87121cef2912bfbaf514fdbfea75509af531de8a (patch)
treed77333a7131161ed87b30039680d1be1fab77a3a /patches/server/0624-Expose-Tracked-Players.patch
parent32ba0881e82a778bdf47da44ee40cc197288ad2d (diff)
downloadPaper-87121cef2912bfbaf514fdbfea75509af531de8a.tar.gz
Paper-87121cef2912bfbaf514fdbfea75509af531de8a.zip
Move `getTrackedPlayers` up from Player to Entity (#6569)
Diffstat (limited to 'patches/server/0624-Expose-Tracked-Players.patch')
-rw-r--r--patches/server/0624-Expose-Tracked-Players.patch31
1 files changed, 14 insertions, 17 deletions
diff --git a/patches/server/0624-Expose-Tracked-Players.patch b/patches/server/0624-Expose-Tracked-Players.patch
index 864d065cca..a7b6532874 100644
--- a/patches/server/0624-Expose-Tracked-Players.patch
+++ b/patches/server/0624-Expose-Tracked-Players.patch
@@ -4,29 +4,26 @@ 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 ff9ef9741ccd561f8bf1c517f5c9671874e0a083..660fea802abee79414815f73e079a05b5be1b72a 100644
---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -2403,6 +2403,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+index 986f045a2e6a040c6e2aab7420c8cb2d4ac3a726..ee50ea695585639d0ff184b675f3fb3b205b9f86 100644
+--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+@@ -1263,5 +1263,18 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
+ public boolean isTicking() {
+ return getHandle().isTicking();
}
- // Paper end
-
-+ // Paper start
++
+ @Override
-+ public Set<Player> getTrackedPlayers() {
-+ if (entity.tracker == null) {
++ public Set<org.bukkit.entity.Player> getTrackedPlayers() {
++ if (this.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<org.bukkit.entity.Player> set = new java.util.HashSet<>(this.entity.tracker.seenBy.size());
++ for (net.minecraft.server.network.ServerPlayerConnection connection : this.entity.tracker.seenBy) {
+ set.add(connection.getPlayer().getBukkitEntity().getPlayer());
+ }
+ return set;
+ }
-+ // Paper end
-+
- // Spigot start
- private final Player.Spigot spigot = new Player.Spigot()
- {
+ // Paper end
+ }