aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0409-Add-Listing-API-for-Player.patch
blob: 47a8946b80badf69929017f4667aa59e8d4a649e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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
index fbaea481feccfc71d744d9f93de3bf637fdcaaad..24dc710f61d08253f66e7ecfd69873e7ebf68d1b 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2038,6 +2038,32 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
      */
     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.
      *