Package org.spongepowered.api
Class Sponge
- java.lang.Object
-
- org.spongepowered.api.Sponge
-
public final class Sponge extends Object
A 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 Scheduler
asyncScheduler()
Gets theScheduler
used to schedule async tasks.static ChannelManager
channelManager()
Gets theChannelManager
for creating network channels.static Client
client()
static ConfigManager
configManager()
Gets theConfigManager
used to load and manage configuration files for plugins.static DataManager
dataManager()
Gets theDataManager
instance.static EventManager
eventManager()
Gets theEventManager
instance.static Game
game()
Gets theGame
instance.static boolean
isClientAvailable()
static boolean
isServerAvailable()
static MetricsConfigManager
metricsConfigManager()
Gets theMetricsConfigManager
instance, allowing data/metric gathering systems to determine whether they have permission to gather server metrics.static Platform
platform()
Returns the current platform, or implementation, thisGame
is running on.static PluginManager
pluginManager()
Gets thePluginManager
instance.static Server
server()
static ServiceProvider.GameScoped
serviceProvider()
Gets theGame
scopedServiceProvider
for providing services.static SqlManager
sqlManager()
Gets theSqlManager
for grabbing sql data sources.static SystemSubject
systemSubject()
Gets theSystemSubject
instance from theGame
instance.
-
-
-
Method Detail
-
game
public static Game game()
Gets theGame
instance. 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, thisGame
is running on.- Returns:
- The current implementation
-
dataManager
public static DataManager dataManager()
Gets theDataManager
instance.- Returns:
- The data manager instance
-
pluginManager
public static PluginManager pluginManager()
Gets thePluginManager
instance.- Returns:
- The plugin manager instance
-
eventManager
public static EventManager eventManager()
Gets theEventManager
instance.- Returns:
- The event manager instance
-
configManager
public static ConfigManager configManager()
Gets theConfigManager
used to load and manage configuration files for plugins.- Returns:
- The configuration manager
-
channelManager
public static ChannelManager channelManager()
Gets theChannelManager
for 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 theServer
instance from theGame
instance.Note: During various
events
, aServer
instance 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 theClient
instance from theGame
instance.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 theSystemSubject
instance from theGame
instance.- Returns:
- The system subject
- See Also:
()
-
metricsConfigManager
public static MetricsConfigManager metricsConfigManager()
Gets theMetricsConfigManager
instance, allowing data/metric gathering systems to determine whether they have permission to gather server metrics.- Returns:
- The
MetricsConfigManager
instance
-
asyncScheduler
public static Scheduler asyncScheduler()
Gets theScheduler
used to schedule async tasks.- Returns:
- The async scheduler
-
sqlManager
public static SqlManager sqlManager()
Gets theSqlManager
for grabbing sql data sources.- Returns:
- The
SqlManager
instance.
-
serviceProvider
public static ServiceProvider.GameScoped serviceProvider()
Gets theGame
scopedServiceProvider
for providing services.Engine
scoped services, if they exist, can be found on the respective engine.- Returns:
- The service provider.
-
-