Interface ConfigEntrypoint
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Lets a mod provide its own OneConfig layout, which replaces the one OneConfig would otherwise extract
from the mod's original config screen (YACL, Cloth Config, MidnightLib, ...). The original screen stays
reachable from the "open original" button.
A mod provides one by naming an implementation under the "oneconfig:config" entrypoint of its
Only Fabric is supported for now. On NeoForge the entrypoint is never discovered, so OneConfig keeps extracting the original screen.
A mod provides one by naming an implementation under the "oneconfig:config" entrypoint of its
fabric.mod.json. The class is only loaded when OneConfig is installed, so this can be a
compileOnly dependency.
Only Fabric is supported for now. On NeoForge the entrypoint is never discovered, so OneConfig keeps extracting the original screen.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceInformation about, and actions for, the mod whose entrypoint is being called. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidregisterConfigs(ConfigEntrypoint.Context context) Called once after every mod has initialized.
-
Field Details
-
ENTRYPOINT
- See Also:
-
-
Method Details
-
registerConfigs
Called once after every mod has initialized. Create yourConfiginstances here. Configs whose class is in your mod (or a mod nested in its jar) belong to it automatically if they were created before this returns. Any other config, such as one whose class is in a library, must be passed toConfigEntrypoint.Context.register(Config).
If none of its configs ends up registered, because this registered none, threw before registering any, or every one failed to initialize, OneConfig extracts the original screen as if there were no entrypoint. A config whose constructor throws out of this method is discarded. If you catch that exception yourself, OneConfig cannot tell and still initializes the half-built config, so let it propagate instead.
-