aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0914-Add-Listing-API-for-Player.patch
diff options
context:
space:
mode:
authorShane Freeder <[email protected]>2024-04-07 01:45:43 +0100
committerGitHub <[email protected]>2024-04-06 20:45:43 -0400
commit12071620558a64575ac641d9b93c120a66e5e3a7 (patch)
tree3f0b9cddbf3f16f213e0f6c533686111a1f2f201 /patches/server/0914-Add-Listing-API-for-Player.patch
parent241d8e26fbaf89aae7aa377273b62172c0402b1c (diff)
downloadPaper-12071620558a64575ac641d9b93c120a66e5e3a7.tar.gz
Paper-12071620558a64575ac641d9b93c120a66e5e3a7.zip
Allow player-list API to self un/list (#10358)
Diffstat (limited to 'patches/server/0914-Add-Listing-API-for-Player.patch')
-rw-r--r--patches/server/0914-Add-Listing-API-for-Player.patch6
1 files changed, 2 insertions, 4 deletions
diff --git a/patches/server/0914-Add-Listing-API-for-Player.patch b/patches/server/0914-Add-Listing-API-for-Player.patch
index fa29159689..05e8427ee0 100644
--- a/patches/server/0914-Add-Listing-API-for-Player.patch
+++ b/patches/server/0914-Add-Listing-API-for-Player.patch
@@ -111,7 +111,7 @@ index bc0e9fb41fe22e0a603837fcbdd82134f51d21d9..d38fe02af4cc35ed5b22acec41bedb76
// Paper end - Use single player info update packet on join
player.sentListPacket = true;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 15817a84ad5db54ec299f933387f4ad1e0e74b33..458c7039bddf63a0affbf14c24ba73d66cc13fac 100644
+index 15817a84ad5db54ec299f933387f4ad1e0e74b33..15c7724e406655cffddad1a14081d737dab7ef44 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -188,6 +188,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -131,7 +131,7 @@ index 15817a84ad5db54ec299f933387f4ad1e0e74b33..458c7039bddf63a0affbf14c24ba73d6
if (original != null) otherPlayer.setUUID(original); // Paper - uuid override
}
-@@ -2102,6 +2103,43 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -2102,6 +2103,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return (entity != null) ? this.canSee(entity) : false; // If we can't find it, we can't see it
}
@@ -145,7 +145,6 @@ index 15817a84ad5db54ec299f933387f4ad1e0e74b33..458c7039bddf63a0affbf14c24ba73d6
+ public boolean unlistPlayer(@NotNull Player other) {
+ Preconditions.checkNotNull(other, "hidden entity cannot be null");
+ if (this.getHandle().connection == null) return false;
-+ if (this.equals(other)) return false;
+ if (!this.canSee(other)) return false;
+
+ if (unlistedEntities.add(other.getUniqueId())) {
@@ -160,7 +159,6 @@ index 15817a84ad5db54ec299f933387f4ad1e0e74b33..458c7039bddf63a0affbf14c24ba73d6
+ public boolean listPlayer(@NotNull Player other) {
+ Preconditions.checkNotNull(other, "hidden entity cannot be null");
+ if (this.getHandle().connection == null) return false;
-+ if (this.equals(other)) return false;
+ if (!this.canSee(other)) throw new IllegalStateException("Player cannot see other player");
+
+ if (this.unlistedEntities.remove(other.getUniqueId())) {