Package org.spongepowered.api
Class Sponge
- java.lang.Object
-
- org.spongepowered.api.Sponge
-
public final class Sponge extends java.lang.ObjectA static all access class granting static access to various systems for the API.
-
-
Constructor Summary
Constructors Constructor Description Sponge()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SchedulerasyncScheduler()Gets theSchedulerused to schedule async tasks.static ChannelManagerchannelManager()Gets theChannelManagerfor creating network channels.static Clientclient()static ConfigManagerconfigManager()Gets theConfigManagerused to load and manage configuration files for plugins.static DataManagerdataManager()Gets theDataManagerinstance.static EventManagereventManager()Gets theEventManagerinstance.static Gamegame()Gets theGameinstance.static booleanisClientAvailable()static booleanisServerAvailable()static MetricsConfigManagermetricsConfigManager()Gets theMetricsConfigManagerinstance, allowing data/metric gathering systems to determine whether they have permission to gather server metrics.static Platformplatform()Returns the current platform, or implementation, thisGameis running on.static PluginManagerpluginManager()Gets thePluginManagerinstance.static Serverserver()static ServiceProvider.GameScopedserviceProvider()Gets theGamescopedServiceProviderfor providing services.static SqlManagersqlManager()Gets theSqlManagerfor grabbing sql data sources.static SystemSubjectsystemSubject()Gets theSystemSubjectinstance from theGameinstance.
-
-
-
Method Detail
-
game
public static Game game()
Gets theGameinstance. There is ever only going to be a single game instance at any given time.- Returns:
- The game instance
-
platform
public static Platform platform()
Returns the current platform, or implementation, thisGameis running on.- Returns:
- The current implementation
-
dataManager
public static DataManager dataManager()
Gets theDataManagerinstance.- Returns:
- The data manager instance
-
pluginManager
public static PluginManager pluginManager()
Gets thePluginManagerinstance.- Returns:
- The plugin manager instance
-
eventManager
public static EventManager eventManager()
Gets theEventManagerinstance.- Returns:
- The event manager instance
-
configManager
public static ConfigManager configManager()
Gets theConfigManagerused to load and manage configuration files for plugins.- Returns:
- The configuration manager
-
channelManager
public static ChannelManager channelManager()
Gets theChannelManagerfor creating network channels.- Returns:
- The channel registry
-
isServerAvailable
public static boolean isServerAvailable()
- Returns:
- True if the server instance is available
- See Also:
Game.isServerAvailable()
-
server
public static Server server()
Gets theServerinstance from theGameinstance.Note: During various
events, aServerinstance may NOT be available. CallingGame.server()during one will throw an exception. To double check, callisServerAvailable()- Returns:
- The server instance
- See Also:
Game.server(),Game.isServerAvailable()
-
isClientAvailable
public static boolean isClientAvailable()
- Returns:
- True if the client instance is available
- See Also:
Game.isClientAvailable()
-
client
public static Client client()
Gets theClientinstance from theGameinstance.Note: Not all implementations support a client, consult your vendor for further information.
- Returns:
- The client instance
- See Also:
Game.client(),Game.isClientAvailable()
-
systemSubject
public static SystemSubject systemSubject()
Gets theSystemSubjectinstance from theGameinstance.- Returns:
- The system subject
- See Also:
()
-
metricsConfigManager
public static MetricsConfigManager metricsConfigManager()
Gets theMetricsConfigManagerinstance, allowing data/metric gathering systems to determine whether they have permission to gather server metrics.- Returns:
- The
MetricsConfigManagerinstance
-
asyncScheduler
public static Scheduler asyncScheduler()
Gets theSchedulerused to schedule async tasks.- Returns:
- The async scheduler
-
sqlManager
public static SqlManager sqlManager()
Gets theSqlManagerfor grabbing sql data sources.- Returns:
- The
SqlManagerinstance.
-
serviceProvider
public static ServiceProvider.GameScoped serviceProvider()
Gets theGamescopedServiceProviderfor providing services.Enginescoped services, if they exist, can be found on the respective engine.- Returns:
- The service provider.
-
-