Package org.spongepowered.api
Interface Game
- All Superinterfaces:
- RegistryHolder
The core accessor of the API. The implementation uses this to pass
 constructed objects.
- 
Method SummaryModifier 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 theSqlManagerfor grabbing sql data sources.Gets theSystemSubject.Methods inherited from interface org.spongepowered.api.registry.RegistryHolderfindRegistry, registry, streamRegistries
- 
Method Details- 
asyncSchedulerScheduler asyncScheduler()Gets the asyncScheduler.- Returns:
- The async scheduler
 
- 
gameDirectoryPath gameDirectory()Gets the directory where the game's files are located.- Returns:
- The game directory
 
- 
isServerAvailableboolean 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
 
- 
serverServer server()Gets theServer.- Returns:
- The server
- Throws:
- IllegalStateException- If the Server isn't currently available
 
- 
systemSubjectSystemSubject systemSubject()Gets theSystemSubject. Depending on the implementation, this may also represent the game console.- Returns:
- The SystemSubject
 
- 
localeGets a locale for the specified locale code, e.g.en_US.- Parameters:
- locale- The locale to lookup (e.g.- en_US.
- Returns:
- The locale
 
- 
isClientAvailabledefault 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
 
- 
clientGets theClient.- Returns:
- The client
- Throws:
- UnsupportedEngineException- If the client engine is not supported
- IllegalStateException- If the Client isn't currently available
 
- 
platformPlatform platform()Returns the current platform, or implementation, thisGameis running on.- Returns:
- The current implementation
 
- 
builderProviderBuilderProvider builderProvider()Retrieves theBuilderProvider.- Returns:
- The builder provider
 
- 
factoryProviderFactoryProvider factoryProvider()Retrieves theFactoryProvider.- Returns:
- The factory provider
 
- 
dataManagerDataManager dataManager()- Returns:
- The serialization service
 
- 
pluginManagerPluginManager pluginManager()Gets thePluginManager.- Returns:
- The plugin manager
 
- 
eventManagerEventManager eventManager()Gets theEventManager.- Returns:
- The event manager
 
- 
configManagerConfigManager configManager()Gets theConfigManagerused to load and manage configuration files for plugins.- Returns:
- The configuration manager
 
- 
channelManagerChannelManager channelManager()Gets theChannelManagerfor creating network channels.- Returns:
- The channel manager
 
- 
metricsConfigManagerMetricsConfigManager metricsConfigManager()Gets theMetricsConfigManagerinstance, allowing data/metric gathering systems to determine whether they have permission to gather server metrics.- Returns:
- The MetricsConfigManagerinstance
 
- 
sqlManagerSqlManager sqlManager()Gets theSqlManagerfor grabbing sql data sources.- Returns:
- The SqlManagerinstance.
 
- 
serviceProviderServiceProvider.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.The provider will not be available during plugin construction and will throw an IllegalStateExceptionif there is an attempt to access this before the provider is ready.- Returns:
- The service manager
 
 
-