Package org.spongepowered.api
Interface Platform
-
public interface PlatformRepresents a possible platform or implementation aGamecould be running on.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classPlatform.ComponentRepresents a part of thePlatform.static classPlatform.TypeThe type of the platform, or where the game is currently running.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Map<String,Object>asMap()Returns this platform instance, as a key-value map.org.spongepowered.plugin.PluginContainercontainer(Platform.Component component)Returns thePluginContainerfor the specified platformPlatform.Component.Platform.TypeexecutionType()Retrieves the currentPlatform.Typethe platform is executing on.MinecraftVersionminecraftVersion()Gets the current Minecraft version of this platform.Platform.Typetype()Retrieves the currentPlatform.Typethis platform is running on.
-
-
-
Field Detail
-
API_ID
static final String API_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
type
Platform.Type type()
Retrieves the currentPlatform.Typethis platform is running on.- Returns:
- The current type
-
executionType
Platform.Type executionType()
Retrieves the currentPlatform.Typethe 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
type()would return Platform.Type.CLIENT.- Returns:
- The execution type
-
container
org.spongepowered.plugin.PluginContainer container(Platform.Component component)
Returns thePluginContainerfor the specified platformPlatform.Component.- Parameters:
component- The platform component- Returns:
- The plugin container for the component
-
minecraftVersion
MinecraftVersion minecraftVersion()
Gets the current Minecraft version of this platform.- Returns:
- The Minecraft version
-
asMap
Map<String,Object> asMap()
Returns this platform instance, as a key-value map.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.
- Returns:
- This platform as a map
-
-