dev.polymodloader.api.system
This page is generated from the source's Javadoc by ./gradlew apiReference. Do not edit it; fix the source comment and generate it again.
| Type | Kind | Description |
|---|---|---|
PolySystem | interface | Marker for the contract interface of a replaceable system. |
SystemContext | record | Information passed to a SystemProvider when Poly Mod Loader creates the active implementation. |
SystemId | record | Identifier of a replaceable Poly Mod Loader system in namespace:path form, e.g. |
SystemLookup | interface | Read access to the active implementation of each system. |
SystemProvider | functional interface | Creates the implementation of one system. |
PolySystem
interface · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
public interface PolySystem
Marker for the contract interface of a replaceable system. Every system has exactly one active implementation: Poly Mod Loader's default or one explicit replacement declared by a mod (design doc §4.3, §4.4).
SystemContext
record · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
public record SystemContext(SystemId systemId, GameSide side, String providerModId)
Information passed to a SystemProvider when Poly Mod Loader creates the active implementation.
| Component | Type | Description |
|---|---|---|
systemId | SystemId | the system being created |
side | GameSide | the process side |
providerModId | String | mod that supplies the provider, or poly for the default |
SystemId
record · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
public record SystemId(String value)
Identifier of a replaceable Poly Mod Loader system in namespace:path form, e.g. poly:game_brand.
| Component | Type | Description |
|---|---|---|
value | String | the identifier text |
parse(String)
public static Optional<SystemId> parse(String value)
Since 0.1.0-alpha.4 or earlier
Parses value, or returns empty when it is not a valid system ID.
| Parameter | Type | Description |
|---|---|---|
value | String | — |
Returns Optional<SystemId>
SystemLookup
interface · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
public interface SystemLookup
Read access to the active implementation of each system.
get(Class<T>)
<T extends PolySystem> T get(Class<T> contract)
Since 0.1.0-alpha.4 or earlier
Returns the active implementation of contract.
| Parameter | Type | Description |
|---|---|---|
contract | Class<T> | — |
Returns T
Throws IllegalArgumentException — when no system with that contract is registered
SystemProvider
functional interface · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
public interface SystemProvider<T extends PolySystem>
Creates the implementation of one system. A mod that replaces a system declares its provider class in poly.mod.json under replacesSystems; the class needs a public no-argument constructor.
Timing: called once on the main thread after all mods are resolved and before any mod entrypoint runs.
Failure: an exception, a null result, or a result that does not implement the system's contract stops the launch (POLY-SYSTEM-003).
create(SystemContext)
T create(SystemContext context)
Since 0.1.0-alpha.4 or earlier
Creates the system implementation.
| Parameter | Type | Description |
|---|---|---|
context | SystemContext | — |
Returns T