Package cpw.mods.modlauncher.api
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.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
static final record
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
arguments
(BiFunction<String, String, joptsimple.OptionSpecBuilder> argumentBuilder) Define command line arguments for your mod service.default void
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)default List
<ITransformationService.Resource> completeScan
(IModuleLayerManager layerManager) void
initialize
(IEnvironment environment) Initialize your service.name()
The name of this mod service.void
onLoad
(IEnvironment env, Set<String> otherServices) Load your service.List
<? extends ITransformer<?>> TheITransformer
is the fundamental operator of the system.
-
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
Define command line arguments for your mod service. These will be prefixed by yourname()
to prevent collisions.- Parameters:
argumentBuilder
- a function mapping name, description to a set of JOptSimple properties for that argument
-
argumentValues
-
initialize
Initialize your service.- Parameters:
environment
- environment - query state from here to determine viability
-
beginScanning
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
-
onLoad
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 hereotherServices
- 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()TheITransformer
is the fundamental operator of the system.- Returns:
- A list of transformers for your ITransformationService. This is called after
onLoad(IEnvironment, Set)
andinitialize(IEnvironment)
, so you can return an appropriate Transformer set for the environment you find yourself in.
-