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 Details Link icon

    • Sponge Link icon

      public Sponge()
  • Method Details Link icon

    • game Link icon

      public static Game game()
      Gets the Game instance. There is ever only going to be a single game instance at any given time.
      Returns:
      The game instance
    • platform Link icon

      public static Platform platform()
      Returns the current platform, or implementation, this Game is running on.
      Returns:
      The current implementation
    • dataManager Link icon

      public static DataManager dataManager()
      Gets the DataManager instance.
      Returns:
      The data manager instance
    • pluginManager Link icon

      public static PluginManager pluginManager()
      Gets the PluginManager instance.
      Returns:
      The plugin manager instance
    • eventManager Link icon

      public static EventManager eventManager()
      Gets the EventManager instance.
      Returns:
      The event manager instance
    • configManager Link icon

      public static ConfigManager configManager()
      Gets the ConfigManager used to load and manage configuration files for plugins.
      Returns:
      The configuration manager
    • channelManager Link icon

      public static ChannelManager channelManager()
      Gets the ChannelManager for creating network channels.
      Returns:
      The channel registry
    • isServerAvailable Link icon

      public static boolean isServerAvailable()
      Gets whether a Server instance is available without throwing an exception from calling server().
      Returns:
      True if the server instance is available
      See Also:
    • server Link icon

      public static Server server()
      Gets the Server instance from the Game instance.
      Returns:
      The server instance
      See Also:
    • isClientAvailable Link icon

      public static boolean isClientAvailable()
      Gets whether a Client instance is available without throwing an exception from calling client().
      Returns:
      True if the client instance is available
      See Also:
    • client Link icon

      public static Client client()
      Gets the Client instance from the Game instance.
      Returns:
      The client instance
      See Also:
    • systemSubject Link icon

      public static SystemSubject systemSubject()
      Gets the SystemSubject instance from the Game instance.
      Returns:
      The system subject
      See Also:
    • metricsConfigManager Link icon

      public static MetricsConfigManager metricsConfigManager()
      Gets the MetricsConfigManager instance, allowing data/metric gathering systems to determine whether they have permission to gather server metrics.
      Returns:
      The MetricsConfigManager instance
    • asyncScheduler Link icon

      public static Scheduler asyncScheduler()
      Gets the Scheduler used to schedule async tasks.
      Returns:
      The async scheduler
    • serviceProvider Link icon

      public static ServiceProvider.GameScoped serviceProvider()
      Gets the Game scoped ServiceProvider for providing services.

      Engine scoped services, if they exist, can be found on the respective engine.

      Returns:
      The service provider.