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 GeyserConnection
connectionByName(@NonNull String name)
Gets the session from the given name, if applicable.@Nullable GeyserConnection
connectionByUuid(@NonNull UUID uuid)
Gets the session from the given UUID, if applicable.@Nullable GeyserConnection
connectionByXuid(@NonNull String xuid)
Gets the session from the given XUID, if applicable.@NonNull List<? extends GeyserConnection>
Gets all the online sessions.boolean
Gets if this Geyser instance is running in an IDE.void
reload()
Reloads the current Geyser instance.void
shutdown()
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:
connectionByUuid
in 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:
connectionByXuid
in 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:
connectionByName
in 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:
onlineConnections
in interfaceGeyserApiBase
- Returns:
- all the online sessions
-