Interface Game

  • All Superinterfaces:
    RegistryHolder

    public interface Game
    extends RegistryHolder
    The core accessor of the API. The implementation uses this to pass constructed objects.
    • Method Detail

      • asyncScheduler

        Scheduler asyncScheduler()
        Gets the async Scheduler.
        Returns:
        The async scheduler
      • gameDirectory

        Path gameDirectory()
        Gets the directory where the game's files are located.
        Returns:
        The game directory
      • isServerAvailable

        boolean isServerAvailable()
        Returns if the Server is available for use. The result of this method is entirely dependent on the implementation.
        Returns:
        True if the Server is available, false if not
      • locale

        Locale locale​(@NonNull String locale)
        Gets a locale for the specified locale code, e.g. en_US.
        Parameters:
        locale - The locale to lookup (e.g. en_US.
        Returns:
        The locale
      • isClientAvailable

        default boolean isClientAvailable()
        Returns if the Client is available for use. The result of this method is entirely dependent on the implementation.
        Returns:
        True if the Client is available, false if not
      • platform

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

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

        ServiceProvider.GameScoped serviceProvider()
        Gets the ServiceProvider.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 IllegalStateException if there is an attempt to access this before the provider is ready.

        Returns:
        The service manager