Interface Connection


  • public interface Connection
    Represents a player connection.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      @NonNull java.lang.String bedrockUsername()
      Returns the bedrock name of the connection.
      @NonNull InputMode inputMode()
      Returns the Input Mode of the Bedrock client.
      boolean isLinked()
      Returns whether the connection is linked.
      @MonotonicNonNull java.lang.String javaUsername()
      Returns the java name of the connection.
      @MonotonicNonNull java.util.UUID javaUuid()
      Returns the UUID of the connection.
      @NonNull java.lang.String languageCode()
      Returns the language code of the connection.
      @NonNull BedrockPlatform platform()
      Returns the platform that the connection is playing on.
      boolean sendForm​(@NonNull org.geysermc.cumulus.form.Form form)
      Sends a form to the connection and opens it.
      boolean sendForm​(@NonNull org.geysermc.cumulus.form.util.FormBuilder<?,​?,​?> formBuilder)
      Sends a form to the connection and opens it.
      @NonNull java.net.InetSocketAddress socketAddress()
      Returns the socket address of the connection.
      boolean transfer​(@NonNull java.lang.String address, @org.checkerframework.common.value.qual.IntRange(from=0L, to=65535L) int port)
      Transfer the connection to a server.
      @NonNull UiProfile uiProfile()
      Returns the User Interface Profile of the connection.
      @NonNull java.lang.String version()
      Returns the version of the Bedrock client.
      @NonNull java.lang.String xuid()
      Returns the XUID of the connection.
    • Method Detail

      • bedrockUsername

        @NonNull java.lang.String bedrockUsername()
        Returns the bedrock name of the connection.
      • javaUsername

        @MonotonicNonNull java.lang.String javaUsername()
        Returns the java name of the connection.
      • javaUuid

        @MonotonicNonNull java.util.UUID javaUuid()
        Returns the UUID of the connection.
      • xuid

        @NonNull java.lang.String xuid()
        Returns the XUID of the connection.
      • version

        @NonNull java.lang.String version()
        Returns the version of the Bedrock client.
      • platform

        @NonNull BedrockPlatform platform()
        Returns the platform that the connection is playing on.
      • languageCode

        @NonNull java.lang.String languageCode()
        Returns the language code of the connection.
      • uiProfile

        @NonNull UiProfile uiProfile()
        Returns the User Interface Profile of the connection.
      • inputMode

        @NonNull InputMode inputMode()
        Returns the Input Mode of the Bedrock client.
      • isLinked

        boolean isLinked()
        Returns whether the connection is linked. This will always return false when the auth-type isn't Floodgate.
      • sendForm

        boolean sendForm​(@NonNull org.geysermc.cumulus.form.Form form)
        Sends a form to the connection and opens it.
        Parameters:
        form - the form to send
        Returns:
        whether the form was successfully sent
      • sendForm

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

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

        @NonNull java.net.InetSocketAddress socketAddress()
        Returns the socket address of the connection.