Interface Player<C>


public interface Player<C>
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable String
    Retrieves the client brand name associated with the player.
    Retrieves the host address to which the player is connected.
    Retrieves the locale associated with the player.
    @Nullable Location
    Retrieves the location associated with the player.
    long
    Retrieves the latency or ping value for the player in milliseconds.
    Retrieves the underlying source object associated with this player.
    Retrieves the unique identifier (UUID) of the player.
    Retrieves the username of the player.
    default @Nullable String
    Retrieves the Xbox Unique Identifier (XUID) for the player if the player is a Bedrock player.
    default boolean
    Determines whether the player associated with this instance is a Bedrock player.
    boolean
    Checks whether the player is currently online.
    boolean
    Removes the player from the server or disconnects the player for an unspecified reason.
    boolean
    kick(@NotNull net.kyori.adventure.text.Component reason)
    Disconnects the player from the server with the specified reason.
    boolean
    kick(String reason)
    Kicks the player from the game or server with a specified reason.
    default boolean
    sendForm(org.geysermc.cumulus.form.Form form)
    Sends a form to the player associated with the current instance.
    sendFormAsync(org.geysermc.cumulus.form.Form form)
     
    void
    sendMessage(@NotNull net.kyori.adventure.text.Component message)
    Sends a message to the player represented by this instance.
    void
    Sends a text message to the player.
  • Method Details

    • getUsername

      String getUsername()
      Retrieves the username of the player.
      Returns:
      the username of the player as a string
    • getUniqueId

      UUID getUniqueId()
      Retrieves the unique identifier (UUID) of the player.
      Returns:
      the universally unique identifier (UUID) of the player
    • getXUID

      @Nullable default @Nullable String getXUID()
      Retrieves the Xbox Unique Identifier (XUID) for the player if the player is a Bedrock player. This method determines whether the player is a Bedrock player and, if so, utilizes the BedrockPlayer.getXUID(UUID) implementation to fetch the XUID.
      Returns:
      the XUID as a string if the player is identified as a Bedrock player; otherwise, null.
    • getConnectHost

      String getConnectHost()
      Retrieves the host address to which the player is connected.
      Returns:
      the connect host as a string.
    • sendForm

      default boolean sendForm(org.geysermc.cumulus.form.Form form)
      Sends a form to the player associated with the current instance. This method utilizes the BedrockPlayer to deliver the form, associating it with the unique identifier (UUID) of the player.
      Parameters:
      form - the form to be sent to the player; must not be null
      Returns:
      true if the form was successfully sent, false otherwise
    • sendFormAsync

      default CompletableFuture<Boolean> sendFormAsync(org.geysermc.cumulus.form.Form form)
    • isBedrockPlayer

      default boolean isBedrockPlayer()
      Determines whether the player associated with this instance is a Bedrock player. This method utilizes the BedrockPlayer.isBedrockPlayer(UUID) implementation.
      Returns:
      true if the player is a Bedrock player; false otherwise.
    • getLocale

      Locale getLocale()
      Retrieves the locale associated with the player.
      Returns:
      the locale representing the player's language and regional preferences.
    • getLocation

      @Nullable @Nullable Location getLocation()
      Retrieves the location associated with the player.
      Returns:
      the Location of the player if available, or null if the location is not set.
    • getPing

      long getPing()
      Retrieves the latency or ping value for the player in milliseconds.

      The ping represents the time taken for data packets to travel from the player to the server and back. It serves as a measure of network latency between the player and the server.

      Returns:
      the ping value in milliseconds
    • isOnline

      boolean isOnline()
      Checks whether the player is currently online.
      Returns:
      true if the player is online, otherwise false
    • getClientBrand

      @Nullable @Nullable String getClientBrand()
      Retrieves the client brand name associated with the player.

      The client brand name typically refers to the branding or specific modification of the client being used by the player (e.g., "vanilla" or a modified client). This method may return null if the client brand is not available or not applicable for the player.

      Returns:
      the client brand name as a string, or null if not available.
    • getSourcePlayer

      C getSourcePlayer()
      Retrieves the underlying source object associated with this player.
      Returns:
      the source player object of type C
    • kick

      boolean kick()
      Removes the player from the server or disconnects the player for an unspecified reason.
      Returns:
      true if the player was successfully kicked, false otherwise
    • kick

      boolean kick(String reason)
      Kicks the player from the game or server with a specified reason.
      Parameters:
      reason - the message or reason for the kick
      Returns:
      true if the player was successfully kicked, false otherwise
    • kick

      boolean kick(@NotNull @NotNull net.kyori.adventure.text.Component reason)
      Disconnects the player from the server with the specified reason.
      Parameters:
      reason - the reason for disconnecting the player; must not be null
      Returns:
      true if the player was successfully disconnected, false otherwise
    • sendMessage

      void sendMessage(String message)
      Sends a text message to the player.
      Parameters:
      message - the message to be sent, must not be null
    • sendMessage

      void sendMessage(@NotNull @NotNull net.kyori.adventure.text.Component message)
      Sends a message to the player represented by this instance.
      Parameters:
      message - the message to be sent; must not be null