Package org.geysermc.geyser.api
Interface GeyserApi
- All Superinterfaces:
GeyserApiBase
- All Known Implementing Classes:
GeyserImpl
Represents the API used in Geyser.
-
Method Summary
Modifier and TypeMethodDescription@Nullable GeyserConnectionconnectionByName(@NonNull String name)Gets the session from the given name, if applicable.@Nullable GeyserConnectionconnectionByUuid(@NonNull UUID uuid)Gets the session from the given UUID, if applicable.@Nullable GeyserConnectionconnectionByXuid(@NonNull String xuid)Gets the session from the given XUID, if applicable.@NonNull List<? extends GeyserConnection>Gets all the online sessions.booleanGets if this Geyser instance is running in an IDE.voidreload()Reloads the current Geyser instance.voidshutdown()Shuts down the current Geyser instance.Methods inherited from interface org.geysermc.api.GeyserApiBase
majorApiVersion, minorApiVersion
-
Method Details
-
shutdown
void shutdown()Shuts down the current Geyser instance. -
reload
void reload()Reloads the current Geyser instance. -
productionEnvironment
boolean productionEnvironment()Gets if this Geyser instance is running in an IDE. This only needs to be used in cases where files expected to be in a jarfile are not present.- Returns:
- true if the version number is not 'DEV'.
-
connectionByUuid
Gets the session from the given UUID, if applicable. The player must be logged in to the Java server for this to return a non-null value.- Specified by:
connectionByUuidin interfaceGeyserApiBase- Parameters:
uuid- the UUID of the session- Returns:
- the session from the given UUID, if applicable
-
connectionByXuid
Gets the session from the given XUID, if applicable.- Specified by:
connectionByXuidin interfaceGeyserApiBase- Parameters:
xuid- the XUID of the session- Returns:
- the session from the given UUID, if applicable
-
connectionByName
Gets the session from the given name, if applicable.- Specified by:
connectionByNamein interfaceGeyserApiBase- Parameters:
name- the uuid of the session- Returns:
- the session from the given name, if applicable
-
onlineConnections
@NonNull List<? extends GeyserConnection> onlineConnections()Gets all the online sessions.- Specified by:
onlineConnectionsin interfaceGeyserApiBase- Returns:
- all the online sessions
-