Paper/patches/unapplied/api/0429-Add-Listing-API-for-Player.patch

44 lines
1.6 KiB
Diff
Raw Normal View History

2023-08-21 10:51:31 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Corey Shupe <coreyshupe101@gmail.com>
Date: Wed, 11 Jan 2023 16:40:31 -0500
Subject: [PATCH] Add Listing API for Player
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
2023-12-05 18:20:55 +01:00
index 2fddfb32927023c64718664ecca7989c15f15a67..7b74fe780a8f99068c542f2deb261503ffc3b9e5 100644
2023-08-21 10:51:31 +02:00
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1901,6 +1901,32 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
2023-08-21 10:51:31 +02:00
@ApiStatus.Experimental
public boolean canSee(@NotNull Entity entity);
+ // Paper start
+ /**
+ * Returns whether the {@code other} player is listed for {@code this}.
+ *
+ * @param other The other {@link Player} to check for listing.
+ * @return True if the {@code other} player is listed for {@code this}.
+ */
+ boolean isListed(@NotNull Player other);
+
+ /**
+ * Unlists the {@code other} player from the tablist.
+ *
+ * @param other The other {@link Player} to de-list.
+ * @return True if the {@code other} player was listed.
+ */
+ boolean unlistPlayer(@NotNull Player other);
+
+ /**
+ * Lists the {@code other} player.
+ *
+ * @param other The other {@link Player} to list.
+ * @return True if the {@code other} player was not listed.
+ */
+ boolean listPlayer(@NotNull Player other);
+ // Paper end
+
/**
* Checks to see if this player is currently flying or not.
*