Interface Game
- All Superinterfaces:
RegistryHolder
The core accessor of the API. The implementation uses this to pass
constructed objects.
-
Method Summary
Modifier and TypeMethodDescriptionGets the asyncScheduler.Retrieves theBuilderProvider.Gets theChannelManagerfor creating network channels.default Clientclient()Gets theClient.Gets theConfigManagerused to load and manage configuration files for plugins.Gets theEventManager.Retrieves theFactoryProvider.Gets the directory where the game's files are located.default booleanReturns if theClientis available for use.booleanReturns if theServeris available for use.Gets a locale for the specified locale code, e.g.Gets theMetricsConfigManagerinstance, allowing data/metric gathering systems to determine whether they have permission to gather server metrics.platform()Returns the current platform, or implementation, thisGameis running on.Gets thePluginManager.server()Gets theServer.Gets theServiceProvider.GameScoped, used to provide Sponge services that plugins may provide.Gets theSystemSubject.Methods inherited from interface RegistryHolder
findRegistry, registry, streamRegistries, streamRegistries
-
Method Details
-
asyncScheduler
-
gameDirectory
Path gameDirectory()Gets the directory where the game's files are located.- Returns:
- The game directory
-
isServerAvailable
boolean isServerAvailable()Returns if theServeris available for use. The result of this method is entirely dependent on the implementation.- Returns:
- True if the Server is available, false if not
-
server
Server server()Gets theServer.- Returns:
- The server
- Throws:
IllegalStateException- If the Server isn't currently available
-
systemSubject
SystemSubject systemSubject()Gets theSystemSubject. Depending on the implementation, this may also represent the game console.- Returns:
- The
SystemSubject
-
locale
-
isClientAvailable
default boolean isClientAvailable()Returns if theClientis available for use. The result of this method is entirely dependent on the implementation.- Returns:
- True if the Client is available, false if not
-
client
Gets theClient.- Returns:
- The client
- Throws:
UnsupportedEngineException- If the client engine is not supportedIllegalStateException- If the Client isn't currently available
-
platform
-
builderProvider
-
factoryProvider
-
dataManager
DataManager dataManager()- Returns:
- The serialization service
-
pluginManager
-
eventManager
-
configManager
ConfigManager configManager()Gets theConfigManagerused to load and manage configuration files for plugins.- Returns:
- The configuration manager
-
channelManager
ChannelManager channelManager()Gets theChannelManagerfor creating network channels.- Returns:
- The channel manager
-
metricsConfigManager
MetricsConfigManager metricsConfigManager()Gets theMetricsConfigManagerinstance, allowing data/metric gathering systems to determine whether they have permission to gather server metrics.- Returns:
- The
MetricsConfigManagerinstance
-
serviceProvider
ServiceProvider.GameScoped serviceProvider()Gets theServiceProvider.GameScoped, used to provide Sponge services that plugins may provide. Services provided here are scoped to the lifetime of the Game.- Returns:
- The service manager
-