public interface Game
Modifier and Type | Method and Description |
---|---|
default AssetManager |
getAssetManager()
Gets the
AssetManager . |
default CauseStackManager |
getCauseStackManager()
Gets the
CauseStackManager for handling the current event cause
stack and context information. |
default ChannelRegistrar |
getChannelRegistrar()
Gets the
ChannelRegistrar for creating network channels. |
default CommandManager |
getCommandManager()
Gets the command dispatcher used for registering and dispatching
registered commands.
|
default ConfigManager |
getConfigManager()
Gets the
ConfigManager used to load and manage configuration files
for plugins. |
default DataManager |
getDataManager()
|
default EventManager |
getEventManager()
Gets the
EventManager . |
default Optional<GameDictionary> |
getGameDictionary()
Retrieves the GameDictionary (item dictionary) for this
Game . |
Path |
getGameDirectory()
Gets the directory where the game's files are located.
|
default Platform |
getPlatform()
Returns the current platform, or implementation, this
Game is running on. |
default PluginManager |
getPluginManager()
Gets the
PluginManager . |
default PropertyRegistry |
getPropertyRegistry()
Gets the
PropertyRegistry instance to register
PropertyStore s. |
default GameRegistry |
getRegistry()
Gets the
GameRegistry . |
Path |
getSavesDirectory()
Gets the directory where the game will store save files.
|
default Scheduler |
getScheduler()
Gets the scheduler used to schedule tasks.
|
Server |
getServer()
Gets the
Server . |
default ServiceManager |
getServiceManager()
Gets the game's instance of the service manager, which is the gateway
to various services provided by Sponge (command registration and so on).
|
GameState |
getState()
Gets the current
GameState that this game is currently in. |
default TeleportHelper |
getTeleportHelper()
Gets the
TeleportHelper , used to find safe Location s. |
boolean |
isServerAvailable()
Returns if the
Server is available for use. |
GameState getState()
GameState
that this game is currently in.Path getGameDirectory()
Path getSavesDirectory()
This location differs based on the implementation and is therefore implementation-specific.
To elaborate, this is how it is handled in Minecraft based on side:
getGameDirectory()
.resolve("saves").resolve(currentSaveName)getGameDirectory()
.resolve(level-name).Consult your specific implementation if they support placing this elsewhere.
boolean isServerAvailable()
Server
is available for use. The result of this method is entirely
dependent on the implementation.Server getServer()
Server
.IllegalStateException
- If the Server isn't currently availabledefault Optional<GameDictionary> getGameDictionary()
Game
.default Platform getPlatform()
Game
is running on.default GameRegistry getRegistry()
GameRegistry
.default DataManager getDataManager()
default PropertyRegistry getPropertyRegistry()
PropertyRegistry
instance to register
PropertyStore
s.default PluginManager getPluginManager()
PluginManager
.default EventManager getEventManager()
EventManager
.default AssetManager getAssetManager()
AssetManager
.default ConfigManager getConfigManager()
ConfigManager
used to load and manage configuration files
for plugins.default CommandManager getCommandManager()
default ServiceManager getServiceManager()
Services registered by other plugins may be available too.
default Scheduler getScheduler()
default ChannelRegistrar getChannelRegistrar()
ChannelRegistrar
for creating network channels.default TeleportHelper getTeleportHelper()
TeleportHelper
, used to find safe Location
s.default CauseStackManager getCauseStackManager()
CauseStackManager
for handling the current event cause
stack and context information.