aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorShane Freeder <[email protected]>2024-03-26 14:12:21 +0000
committerShane Freeder <[email protected]>2024-03-26 14:12:21 +0000
commit4957fc1a587179d0e060ed5a1576abdaf3bf71c8 (patch)
treeba08847fb31287534671ff4f3a0180565ad52cb7
parent00fd87a10fcdfa86db341c051b006303fe068b55 (diff)
downloadPaper-api/allow-self-unlist.tar.gz
Paper-api/allow-self-unlist.zip
Allow player-list API to self un/listapi/allow-self-unlist
This is supported behavior by the client, there is no real reason, to my understanding, to prevent this
-rw-r--r--patches/server/0915-Add-Listing-API-for-Player.patch6
-rw-r--r--patches/server/0948-Add-player-idle-duration-API.patch4
-rw-r--r--patches/server/0982-Rewrite-chunk-system.patch4
3 files changed, 6 insertions, 8 deletions
diff --git a/patches/server/0915-Add-Listing-API-for-Player.patch b/patches/server/0915-Add-Listing-API-for-Player.patch
index fa29159689..05e8427ee0 100644
--- a/patches/server/0915-Add-Listing-API-for-Player.patch
+++ b/patches/server/0915-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())) {
diff --git a/patches/server/0948-Add-player-idle-duration-API.patch b/patches/server/0948-Add-player-idle-duration-API.patch
index 717b1d7291..350f2962a2 100644
--- a/patches/server/0948-Add-player-idle-duration-API.patch
+++ b/patches/server/0948-Add-player-idle-duration-API.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Add player idle duration API
Implements API for getting and resetting a player's idle duration.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 5b5167947c82ca66a89aab456a2eb5b523887d33..ff3db4efd2c10b3351453656937e88064267fb22 100644
+index a0bca5349074afd8012df429bb548c0f2640b432..eee2ed951ebcf0ad58aa7dc95ed9adc927322748 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -3337,6 +3337,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -3335,6 +3335,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
// Paper end
diff --git a/patches/server/0982-Rewrite-chunk-system.patch b/patches/server/0982-Rewrite-chunk-system.patch
index 12bc4a8ec8..1b611c3408 100644
--- a/patches/server/0982-Rewrite-chunk-system.patch
+++ b/patches/server/0982-Rewrite-chunk-system.patch
@@ -21522,10 +21522,10 @@ index 6379f26776e2e267b84fe8f8392b53d7d89eb5ad..726aa0461bbf380989a5b51dbfdfdda2
// Paper start - implement pointers
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index e874d76437fc4c86fd4ed2d03e416dd1ff528b76..616d2e479d91673695ade0db151a0099b568904f 100644
+index 77b459274e578779f5c79a7940bf47c782b9db06..e77bf7f432387bdfa7f69d31b014e8cd254fd4ca 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -3400,31 +3400,31 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -3398,31 +3398,31 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public int getViewDistance() {