Package one.tranic.t.base.player
Class Players
java.lang.Object
one.tranic.t.base.player.Players
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAltPlayers(@NotNull Player<?> player) Retrieves a list of alternative players who are connected to the same host as the specified player, excluding the player itself.Retrieves a list of all online players currently connected to the server.Retrieves a list of the names of all online players currently connected to the server.static @NotNull List<?>Retrieves a list of all online players currently connected to the platform.static @Nullable Player<?>Retrieves a player instance based on their player name.static @Nullable Player<?>Retrieves a player using their unique identifier (UUID).
-
Constructor Details
-
Players
public Players()
-
-
Method Details
-
getPlayer
Retrieves a player instance based on their player name.- Parameters:
name- the name of the player to search for; must not be null- Returns:
- the
Playerinstance corresponding to the given name, ornullif no player is found
-
getPlayer
Retrieves a player using their unique identifier (UUID).- Parameters:
uuid- the UUID of the player to be retrieved; must not be null- Returns:
- a
Player<?>instance if a player with the given UUID exists; otherwise,null
-
getOnlinePlayers
Retrieves a list of all online players currently connected to the server.- Returns:
- a
ListofPlayer<?>representing each online player; the list is guaranteed to be non-null.
-
getAltPlayers
Retrieves a list of alternative players who are connected to the same host as the specified player, excluding the player itself.This method identifies other players currently online that share the same connected host with the given player.
Players with a matching connected host are returned in the resulting list, ensuring that the specified player is excluded from this list.
- Parameters:
player- thePlayer<?>whose connected host is used for comparison; must not be null- Returns:
- a
List<Player<?>>containing all players who are connected to the same host as the specified player, excluding the player itself; the list is guaranteed to be non-null but may be empty if no other players share the same connected host
-
getPlatformOnlinePlayers
Retrieves a list of all online players currently connected to the platform.The specific type of player instances within this list may vary based on the platform implementation.
- Returns:
- a
List<?>representing the platform-specific online players; the list is guaranteed to be non-null.
-
getOnlinePlayersName
Retrieves a list of the names of all online players currently connected to the server.- Returns:
- a
ListofStringcontaining the names of online players; the list is guaranteed to be non-null.
-