aboutsummaryrefslogtreecommitdiffhomepage
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
parent32ba0881e82a778bdf47da44ee40cc197288ad2d (diff)
downloadPaper-87121cef2912bfbaf514fdbfea75509af531de8a.tar.gz
Paper-87121cef2912bfbaf514fdbfea75509af531de8a.zip
Move `getTrackedPlayers` up from Player to Entity (#6569)
-rw-r--r--patches/api/0275-Expose-Tracked-Players.patch40
-rw-r--r--patches/api/0313-Add-PlayerKickEvent-causes.patch4
-rw-r--r--patches/server/0624-Expose-Tracked-Players.patch31
3 files changed, 31 insertions, 44 deletions
diff --git a/patches/api/0275-Expose-Tracked-Players.patch b/patches/api/0275-Expose-Tracked-Players.patch
index 36dcf13b07..a1fbc0833a 100644
--- a/patches/api/0275-Expose-Tracked-Players.patch
+++ b/patches/api/0275-Expose-Tracked-Players.patch
@@ -4,30 +4,20 @@ Date: Fri, 26 Feb 2021 16:24:25 -0600
Subject: [PATCH] Expose Tracked Players
-diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
-index c79183e6499808af04962df48b05846f9c764682..38c4fbe41d964b9404e79ebd7cb3ea8c2f514935 100644
---- a/src/main/java/org/bukkit/entity/Player.java
-+++ b/src/main/java/org/bukkit/entity/Player.java
-@@ -1,6 +1,7 @@
- package org.bukkit.entity;
-
- import java.net.InetSocketAddress;
-+import java.util.Set; // Paper
- import java.util.UUID;
- import com.destroystokyo.paper.ClientOption; // Paper
- import com.destroystokyo.paper.Title; // Paper
-@@ -2143,6 +2144,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
- void sendOpLevel(byte level);
- // Paper end
-
-+ // Paper start
+diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
+index b02704b0535522c5535b560105eec2885fdd3e77..d515de1c316f14165ee327bc81f0be98b60db3bf 100644
+--- a/src/main/java/org/bukkit/entity/Entity.java
++++ b/src/main/java/org/bukkit/entity/Entity.java
+@@ -760,5 +760,12 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
+ * Check if entity is inside a ticking chunk
+ */
+ public boolean isTicking();
++
+ /**
-+ * @return Returns a set of Players within this player's tracking range (that the player's client can "see")
++ * Returns a set of {@link Player Players} within this entity's tracking range (players that can "see" this entity).
++ *
++ * @return players in tracking range
+ */
-+ @NotNull
-+ Set<Player> getTrackedPlayers();
-+ // Paper end
-+
- // Spigot start
- public class Spigot extends Entity.Spigot {
-
++ @NotNull Set<Player> getTrackedPlayers();
+ // Paper end
+ }
diff --git a/patches/api/0313-Add-PlayerKickEvent-causes.patch b/patches/api/0313-Add-PlayerKickEvent-causes.patch
index bb773588d7..0f4098a680 100644
--- a/patches/api/0313-Add-PlayerKickEvent-causes.patch
+++ b/patches/api/0313-Add-PlayerKickEvent-causes.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerKickEvent causes
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
-index 6503bb08731fb2dcfc4f771e802c41be7f3fd4cb..3e8cd3971ac8256a40d9b85cd7514998c965512c 100644
+index c79183e6499808af04962df48b05846f9c764682..9a6e410206852029f1fea0c4409352d5743dcf64 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
-@@ -240,6 +240,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
+@@ -239,6 +239,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param message kick message
*/
void kick(final @Nullable net.kyori.adventure.text.Component message);
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
+ }