public interface Platform
Game
could be
running on.Modifier and Type | Interface and Description |
---|---|
static class |
Platform.Type
The type of the platform, or where the game is currently running.
|
Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
asMap()
Returns this platform instance, as a key-value map.
|
String |
getApiVersion()
Retrieves the current Sponge API version that this platform is
implementing.
|
Platform.Type |
getExecutionType()
Retrieves the current
Platform.Type the platform is executing on. |
MinecraftVersion |
getMinecraftVersion()
Gets current Minecraft version of this platform.
|
String |
getName()
Retrieves the current platform name.
|
Platform.Type |
getType()
Retrieves the current
Platform.Type this platform is running on. |
String |
getVersion()
Retrieves the current platform version.
|
Platform.Type getType()
Platform.Type
this platform is running on.Platform.Type getExecutionType()
Platform.Type
the platform is executing on.
A Minecraft instance will have a client and server thread. If the
server is executing, this will return Platform.Type.SERVER but
getType()
would return Platform.Type.CLIENT.
String getName()
String getVersion()
This version can be in any format, like a build number or semantic versioning.
String getApiVersion()
MinecraftVersion getMinecraftVersion()
Map<String,Object> asMap()
The returned map instance is connected directly to this platform instance. Existing keys like name and version are not modifiable, but new keys are stored in this instance and are shared between any references to a map obtained through the retrieved map.
This mechanism allows for platform-specific information like Forge version.