Interface GeyserApiBase


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

      • connectionByUuid

        @Nullable Connection connectionByUuid​(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​(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​(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​(java.util.UUID uuid,
                         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​(java.util.UUID uuid,
                         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​(java.util.UUID uuid,
                         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

        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.