Class BedrockPlayer

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

public class BedrockPlayer extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static long
    getPing(UUID uuid)
    Retrieves the ping of a player identified by their UUID.
    static @NonNull String
    Gets the platform of the player associated with the given UUID.
    static @Nullable String
    getXUID(UUID uuid)
    Retrieves the XUID (Xbox Unique Identifier) of a player identified by their UUID.
    boolean
    Checks if the player has Floodgate integration enabled.
    boolean
    Determines if the player has access to the Geyser platform compatibility integration.
    static boolean
    Determines whether the player associated with the given UUID is a Bedrock player.
    static boolean
    sendForm(UUID uuid, org.geysermc.cumulus.form.Form form)
    Sends a form to a player identified by their UUID.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BedrockPlayer

      public BedrockPlayer()
  • Method Details

    • isBedrockPlayer

      public static boolean isBedrockPlayer(UUID uuid)
      Determines whether the player associated with the given UUID is a Bedrock player.

      This method checks if the UUID belongs to a Bedrock player, utilizing either the Floodgate or Geyser API based on the availability of these integrations.

      Parameters:
      uuid - The UUID of the player to check.
      Returns:
      true if the player is a Bedrock player; false otherwise.
    • getPlatform

      public static @NonNull String getPlatform(UUID uuid)
      Gets the platform of the player associated with the given UUID.

      This method determines the player's platform using either the Floodgate or Geyser API, based on their availability. If neither API recognizes the UUID, it returns "Java Edition".

      Parameters:
      uuid - the UUID of the player whose platform is being determined
      Returns:
      the platform of the player as a string, or "Java Edition" if the platform cannot be determined
    • getXUID

      public static @Nullable String getXUID(UUID uuid)
      Retrieves the XUID (Xbox Unique Identifier) of a player identified by their UUID.

      This method checks for the availability of the Floodgate or Geyser API and uses the corresponding integration to obtain the player's XUID.

      Parameters:
      uuid - the unique identifier (UUID) of the player whose XUID is to be retrieved
      Returns:
      the XUID of the player if available; otherwise, null
    • sendForm

      public static boolean sendForm(UUID uuid, org.geysermc.cumulus.form.Form form)
      Sends a form to a player identified by their UUID.

      This method leverages either the Floodgate or Geyser API, depending on their availability, to deliver the form.

      If neither API is available, the method will return false.

      Parameters:
      uuid - the unique identifier of the player to whom the form should be sent
      form - the form object to be sent to the player
      Returns:
      true if the form was successfully sent using Floodgate or Geyser; false otherwise
    • getPing

      public static long getPing(UUID uuid)
      Retrieves the ping of a player identified by their UUID.

      This method uses the Geyser API to determine the ping of a Bedrock player if available. If the player is not a Bedrock player or the Geyser API is not available, it returns -1.

      Parameters:
      uuid - the unique identifier of the player whose ping is to be retrieved
      Returns:
      the ping of the player, or -1 if unable to determine
    • hasGeyser

      public boolean hasGeyser()
      Determines if the player has access to the Geyser platform compatibility integration.
      Returns:
      true if the player has access to Geyser; false otherwise.
    • hasFloodgate

      public boolean hasFloodgate()
      Checks if the player has Floodgate integration enabled.
      Returns:
      true if the player has Floodgate integration; false otherwise.