Package org.geysermc.api
Interface GeyserApiBase
public interface GeyserApiBase
The base API class.
-
Method Summary
Modifier and TypeMethodDescriptiondefault ApiVersionReturns the Base API version.@Nullable ConnectionconnectionByUuid(@NonNull UUID uuid) Gets the connection from the given UUID, if applicable.@Nullable ConnectionconnectionByXuid(@NonNull String xuid) Gets the connection from the given XUID, if applicable.booleanisBedrockPlayer(@NonNull UUID uuid) Method to determine if the given online player is a Bedrock player.default intDeprecated.default intDeprecated.in favor ofbaseApiVersion().@NonNull List<? extends Connection>Returns all the online connections.intReturns the amount of online connections.booleanSends a form to the given connection and opens it.booleansendForm(@NonNull UUID uuid, @NonNull org.geysermc.cumulus.form.util.FormBuilder<?, ?, ?> formBuilder) Sends a form to the given connection and opens it.booleantransfer(@NonNull UUID uuid, @NonNull String address, @org.checkerframework.common.value.qual.IntRange(from=0L, to=65535L) int port) Transfer the given connection to a server.@MonotonicNonNull StringReturns the prefix used by Floodgate.
-
Method Details
-
connectionByUuid
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
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
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
Sends a form to the given connection and opens it.- Parameters:
uuid- the uuid of the connection to open it onform- the form to send- Returns:
- whether the form was successfully sent
-
sendForm
boolean sendForm(@NonNull 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 onformBuilder- the formBuilder to send- Returns:
- whether the form was successfully sent
-
transfer
boolean transfer(@NonNull UUID uuid, @NonNull 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 connectionaddress- the address of the serverport- the port of the server- Returns:
- true if the transfer was a success
-
onlineConnections
@NonNull List<? extends Connection> onlineConnections()Returns all the online connections. -
onlineConnectionsCount
int onlineConnectionsCount()Returns the amount of online connections. -
usernamePrefix
@MonotonicNonNull String usernamePrefix()Returns the prefix used by Floodgate. Will be null when the auth-type isn't Floodgate. -
majorApiVersion
Deprecated.in favor ofbaseApiVersion(). -
minorApiVersion
Deprecated.in favor ofbaseApiVersion(). -
baseApiVersion
Returns the Base API version.
-
baseApiVersion().