Skip to main content
Version: Minecraft 26.2

dev.polymodloader.api.system

Generated

This page is generated from the source's Javadoc by ./gradlew apiReference. Do not edit it; fix the source comment and generate it again.

TypeKindDescription
PolySysteminterfaceMarker for the contract interface of a replaceable system.
SystemContextrecordInformation passed to a SystemProvider when Poly Mod Loader creates the active implementation.
SystemIdrecordIdentifier of a replaceable Poly Mod Loader system in namespace:path form, e.g.
SystemLookupinterfaceRead access to the active implementation of each system.
SystemProviderfunctional interfaceCreates 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.

ComponentTypeDescription
systemIdSystemIdthe system being created
sideGameSidethe process side
providerModIdStringmod 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.

ComponentTypeDescription
valueStringthe 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.

ParameterTypeDescription
valueString—

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.

ParameterTypeDescription
contractClass<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.

ParameterTypeDescription
contextSystemContext—

Returns T

Buy me a coffee