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 Details

    • 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
    • server

      Server server()
      Gets the Server.
      Returns:
      The server
      Throws:
      IllegalStateException - If the Server isn't currently available
    • systemSubject

      SystemSubject systemSubject()
      Gets the SystemSubject. Depending on the implementation, this may also represent the game console.
      Returns:
      The SystemSubject
    • 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
    • client

      default Client client()
      Gets the Client.
      Returns:
      The client
      Throws:
      UnsupportedEngineException - If the client engine is not supported
      IllegalStateException - If the Client isn't currently available
    • platform

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

      BuilderProvider builderProvider()
      Retrieves the BuilderProvider.
      Returns:
      The builder provider
    • factoryProvider

      FactoryProvider factoryProvider()
      Retrieves the FactoryProvider.
      Returns:
      The factory provider
    • dataManager

      DataManager dataManager()
      Gets the DataManager instance to register DataSerializables, and get the related DataBuilders.
      Returns:
      The serialization service
    • pluginManager

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

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

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

      ChannelManager channelManager()
      Gets the ChannelManager for creating network channels.
      Returns:
      The channel manager
    • metricsConfigManager

      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
    • sqlManager

      SqlManager sqlManager()
      Gets the SqlManager for grabbing sql data sources.
      Returns:
      The SqlManager instance.
    • 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.
      Returns:
      The service manager