Cloth Config API (Fabric/Forge/NeoForge)

Cloth Config API (Fabric/Forge/NeoForge)

169M Downloads

AutoConfig Forge Documentation Improvements

macbrayne opened this issue ยท 2 comments

commented

The Documentation for Forge developers is probably missing some important steps:

  • Forge Mod Menu Registration is missing (using something like this):
public class ForgeConfigHelper {
    private static final Logger LOGGER = LogManager.getLogger();

    public static void registerConfig() {
        ModLoadingContext.get().registerExtensionPoint(ExtensionPoint.CONFIGGUIFACTORY, () -> (client, parent) -> AutoConfig.getConfigScreen(ModConfig.class, parent).get());
        LOGGER.debug("Registered Config Screen");
    }
}
  • there might also be more steps needed for getting translation keys to work (at least they don't seem to work the same way as standard forge)

For Fabric your mod is a breeze to set up and configure whereas in forge you seem to have to jump though a few hoops to get everything working.

commented

I don't think ModLoadingContext.get().registerExtensionPoint(ExtensionPoint.DISPLAYTEST, () -> Pair.of(() -> FMLNetworkConstants.IGNORESERVERONLY, (a, b) -> true)); is necessary, unless your entire mod is client-only. That line tells the forge server to ignore the mod if it is present on the client side.

In 1.17.1, registerConfig() should be ModLoadingContext.get().registerExtensionPoint(ConfigGuiFactory.class, () -> new ConfigGuiFactory((client, parent) -> AutoConfig.getConfigScreen(Configs.class, parent).get()));

commented

Ah yes, I didn't know when I wrote that issue and forgot to update it.