Class Players

java.lang.Object
one.tranic.t.base.player.Players

public class Players extends Object
  • Constructor Details

    • Players

      public Players()
  • Method Details

    • getPlayer

      @Nullable public static @Nullable Player<?> getPlayer(@NotNull @NotNull String name)
      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 Player instance corresponding to the given name, or null if no player is found
    • getPlayer

      @Nullable public static @Nullable Player<?> getPlayer(@NotNull @NotNull UUID uuid)
      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

      @NotNull public static @NotNull List<Player<?>> getOnlinePlayers()
      Retrieves a list of all online players currently connected to the server.
      Returns:
      a List of Player<?> representing each online player; the list is guaranteed to be non-null.
    • getAltPlayers

      @NotNull public static @NotNull List<Player<?>> getAltPlayers(@NotNull @NotNull Player<?> player)
      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 - the Player<?> 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

      @NotNull public static @NotNull List<?> 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

      @NotNull public static @NotNull List<String> getOnlinePlayersName()
      Retrieves a list of the names of all online players currently connected to the server.
      Returns:
      a List of String containing the names of online players; the list is guaranteed to be non-null.