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.

@FunctionalInterface public interface ConfigEntrypoint
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 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 Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Information about, and actions for, the mod whose entrypoint is being called.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Called once after every mod has initialized.
  • Field Details

  • Method Details

    • registerConfigs

      void registerConfigs(ConfigEntrypoint.Context context)
      Called once after every mod has initialized. Create your Config instances 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 to ConfigEntrypoint.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.