Interface ITransformationService

All Known Implementing Classes:
FMLServiceProvider

public interface ITransformationService
Users who wish to provide a mod service which plugs into this API should implement this interface, and provide a ServiceLoader configuration file pointing at their implementation.
  • Method Details

    • name

      String name()
      The name of this mod service. It will be used throughout the system. It should be lower case, the first character should be alphanumeric and it should only consist of standard alphanumeric characters
      Returns:
      the name of the mod service
    • arguments

      default void arguments(BiFunction<String,String,joptsimple.OptionSpecBuilder> argumentBuilder)
      Define command line arguments for your mod service. These will be prefixed by your name() to prevent collisions.
      Parameters:
      argumentBuilder - a function mapping name, description to a set of JOptSimple properties for that argument
    • argumentValues

      default void argumentValues(ITransformationService.OptionResult option)
    • initialize

      void initialize(IEnvironment environment)
      Initialize your service.
      Parameters:
      environment - environment - query state from here to determine viability
    • beginScanning

      default List<ITransformationService.Resource> beginScanning(IEnvironment environment)
      Scan for mods (but don't classload them), identify metadata that might drive game functionality, return list of elements and target module layer (One of PLUGIN or GAME)
      Parameters:
      environment - environment
    • completeScan

      default List<ITransformationService.Resource> completeScan(IModuleLayerManager layerManager)
    • onLoad

      void onLoad(IEnvironment env, Set<String> otherServices) throws IncompatibleEnvironmentException
      Load your service. Called immediately on loading with a list of other services found. Use to identify and immediately indicate incompatibilities with other services, and environment configuration. This is to try and immediately abort a guaranteed bad environment.
      Parameters:
      env - environment - query state from here
      otherServices - other services loaded with the system
      Throws:
      IncompatibleEnvironmentException - if there is an incompatibility detected. Identify specifics in the exception message
    • transformers

      List<? extends ITransformer<?>> transformers()
      The ITransformer is the fundamental operator of the system.
      Returns:
      A list of transformers for your ITransformationService. This is called after onLoad(IEnvironment, Set) and initialize(IEnvironment), so you can return an appropriate Transformer set for the environment you find yourself in.