Interface GeyserApiBase


  • public interface GeyserApiBase
    The base API class.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods 
      Modifier and Type Method Description
      default ApiVersion baseApiVersion()
      Returns the Base API version.
      @Nullable Connection connectionByUuid​(@NonNull java.util.UUID uuid)
      Gets the connection from the given UUID, if applicable.
      @Nullable Connection connectionByXuid​(@NonNull java.lang.String xuid)
      Gets the connection from the given XUID, if applicable.
      boolean isBedrockPlayer​(@NonNull java.util.UUID uuid)
      Method to determine if the given online player is a Bedrock player.
      default int majorApiVersion()
      Deprecated.
      in favor of baseApiVersion().
      default int minorApiVersion()
      Deprecated.
      in favor of baseApiVersion().
      @NonNull java.util.List<? extends Connection> onlineConnections()
      Returns all the online connections.
      int onlineConnectionsCount()
      Returns the amount of online connections.
      boolean sendForm​(@NonNull java.util.UUID uuid, @NonNull org.geysermc.cumulus.form.Form form)
      Sends a form to the given connection and opens it.
      boolean sendForm​(@NonNull java.util.UUID uuid, @NonNull org.geysermc.cumulus.form.util.FormBuilder<?,​?,​?> formBuilder)
      Sends a form to the given connection and opens it.
      boolean transfer​(@NonNull java.util.UUID uuid, @NonNull java.lang.String address, @org.checkerframework.common.value.qual.IntRange(from=0L, to=65535L) int port)
      Transfer the given connection to a server.
      @MonotonicNonNull java.lang.String usernamePrefix()
      Returns the prefix used by Floodgate.
    • Method Detail

      • connectionByUuid

        @Nullable Connection connectionByUuid​(@NonNull java.util.UUID uuid)
        Gets the connection from the given UUID, if applicable. The player must be logged in to the Java server for this to return a non-null value.
        Parameters:
        uuid - the UUID of the connection
        Returns:
        the connection from the given UUID, if applicable
      • connectionByXuid

        @Nullable Connection connectionByXuid​(@NonNull java.lang.String xuid)
        Gets the connection from the given XUID, if applicable. This method only works for online connections.
        Parameters:
        xuid - the XUID of the session
        Returns:
        the connection from the given UUID, if applicable
      • isBedrockPlayer

        boolean isBedrockPlayer​(@NonNull java.util.UUID uuid)
        Method to determine if the given online player is a Bedrock player.
        Parameters:
        uuid - the uuid of the online player
        Returns:
        true if the given online player is a Bedrock player
      • sendForm

        boolean sendForm​(@NonNull java.util.UUID uuid,
                         @NonNull org.geysermc.cumulus.form.Form form)
        Sends a form to the given connection and opens it.
        Parameters:
        uuid - the uuid of the connection to open it on
        form - the form to send
        Returns:
        whether the form was successfully sent
      • sendForm

        boolean sendForm​(@NonNull java.util.UUID uuid,
                         @NonNull org.geysermc.cumulus.form.util.FormBuilder<?,​?,​?> formBuilder)
        Sends a form to the given connection and opens it.
        Parameters:
        uuid - the uuid of the connection to open it on
        formBuilder - the formBuilder to send
        Returns:
        whether the form was successfully sent
      • transfer

        boolean transfer​(@NonNull java.util.UUID uuid,
                         @NonNull java.lang.String address,
                         @org.checkerframework.common.value.qual.IntRange(from=0L, to=65535L) int port)
        Transfer the given connection to a server. A Bedrock player can successfully transfer to the same server they are currently playing on.
        Parameters:
        uuid - the uuid of the connection
        address - the address of the server
        port - the port of the server
        Returns:
        true if the transfer was a success
      • onlineConnections

        @NonNull java.util.List<? extends Connection> onlineConnections()
        Returns all the online connections.
      • onlineConnectionsCount

        int onlineConnectionsCount()
        Returns the amount of online connections.
      • usernamePrefix

        @MonotonicNonNull java.lang.String usernamePrefix()
        Returns the prefix used by Floodgate. Will be null when the auth-type isn't Floodgate.
      • majorApiVersion

        @Deprecated
        default int majorApiVersion()
        Deprecated.
        in favor of baseApiVersion().
      • minorApiVersion

        @Deprecated
        default int minorApiVersion()
        Deprecated.
        in favor of baseApiVersion().
      • baseApiVersion

        default ApiVersion baseApiVersion()
        Returns the Base API version.