Package org.geysermc.api
Interface GeyserApiBase
-
public interface GeyserApiBaseThe base API class.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description @Nullable ConnectionconnectionByUuid(@NonNull java.util.UUID uuid)Gets the connection from the given UUID, if applicable.@Nullable ConnectionconnectionByXuid(@NonNull java.lang.String xuid)Gets the connection from the given XUID, if applicable.booleanisBedrockPlayer(@NonNull java.util.UUID uuid)Method to determine if the given online player is a Bedrock player.default intmajorApiVersion()Returns the major API version.default intminorApiVersion()Returns the minor API version.@NonNull java.util.List<? extends Connection>onlineConnections()Returns all the online connections.intonlineConnectionsCount()Returns the amount of online connections.booleansendForm(@NonNull java.util.UUID uuid, @NonNull org.geysermc.cumulus.form.Form form)Sends a form to the given connection and opens it.booleansendForm(@NonNull java.util.UUID uuid, @NonNull org.geysermc.cumulus.form.util.FormBuilder<?,?,?> formBuilder)Sends a form to the given connection and opens it.booleantransfer(@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.StringusernamePrefix()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 onform- 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 onformBuilder- 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 connectionaddress- the address of the serverport- 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
default int majorApiVersion()
Returns the major API version. Bumped whenever a significant breaking change or feature addition is added.
-
minorApiVersion
default int minorApiVersion()
Returns the minor API version. May be bumped for new API additions.
-
-