Class Sponge


  • public final class Sponge
    extends Object
    A static all access class granting static access to various systems for the API.
    • Constructor Detail

      • Sponge

        public Sponge()
    • Method Detail

      • game

        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

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

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

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

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

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

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

        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:
        Game.isServerAvailable()
      • isClientAvailable

        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:
        Game.isClientAvailable()
      • asyncScheduler

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