跳到正文

ConfigAnytime

作者:Cleanroom

允许在任意时间设置 Forge 配置。尤其适合在核心模组/调整器加载阶段使用 Forge 配置系统的开发者。

收藏

介绍

介绍由机器翻译自 Modrinth 原页面,仅供参考。

ConfigAnytime

允许随时设置 Forge 配置。尤其适用于在核心模组/加载器的加载阶段使用 Forge 配置系统的开发者。

开发者用法:

  • 添加 CleanroomMC 的仓库,并依赖 ConfigAnytime 的 Maven 条目:
repositories {
    maven {
        url 'https://maven.cleanroommc.com'
    }
}

dependencies {
    implementation 'com.cleanroommc:configanytime:3.0'
}
  • API 使用示例:
@Config(modid = "configanytime")
public class ConfigClass {
    
    public static boolean configBooleanProperty = true;
    public static int configIntProperty = 42;
    
    public static final InnerClass INNER_CLASS = new InnerClass(); // Inner access via this member, this is processed automatically by ConfigManager
    
    public static class InnerClass {
        
        public boolean innerProperty = false; // Must be non-static, referenced via the member field in the outer class
        
    }
    
    // Static initializers go after the properties!
    // This will run automatically when you retrieve any properties from this config class
    static {
        ConfigAnytime.register(ConfigClass.class);
    }
    
}

常见问题

ConfigAnytime 支持哪些 Minecraft 版本?

ConfigAnytime 支持 Minecraft Java 版 1.12.2,可用的加载器:Forge。下载时注意选择和你游戏版本一致的文件。

ConfigAnytime 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Forge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:客户端和服务端都要装。

评论

登录后评论和评分

Cleanroom 的其他作品

查看全部 →