- 跨版本、易于移植的配置工具,依赖极少
- 专门针对易用性和可移植性进行优化
- 名为 Cryonic(低温)是因为它酷到爆
功能说明
- 此工具会将 JSON 文件存储在
{minecraft_dir}/config目录下,命名为 "mod_id.json" - 所有配置文件都会在早期初始化阶段通过字典从 "cryonicconfig.json" 中读取
- 配置只能通过直接编辑 JSON 文件来修改,暂无 GUI 配置计划
- 为了方便移植,同步变量会直接发送给玩家聊天栏,并被拦截处理
- 使用哈希表(HashMap)来查找 String 到 ConfigStorage 以及 String 到 Obj(变量)的映射
API
Groovy (build.gradle) 添加依赖
添加 Maven 仓库:
repositories {
maven { url "https://api.modrinth.com/maven" }
}
Modern/Architectury:
仅针对 Fabric 或 NeoForge 时,请将 ${project.name} 替换为 fabric、forge、neoforge
dependencies {
modImplementation "maven.modrinth:cryonicconfig:fabric-${project.name}:1.0.0+mc${rootProject.minecraft_version}"
}
b1.7.3:
dependencies {
modImplementation "maven.modrinth:cryonicconfig:babric:1.0.0+mcb1.7.3"
}
简单用法:
// 你可以即时存储或使用,这可以在任何地方调用
ConfigStorage config = CryonicConfig.getConfig("mod_id");
// 你可以存储整数、双精度浮点数、布尔值和字符串
// 获取它们的同时也设置了默认值
// getter 格式(变量名,默认值)
// 你不能重用变量名!它们会被覆盖。
config.getInt("varName", 3);
config.getDouble("name", 3.3);
config.getBoolean("var", true);
config.getString("str", "Geronimo!")
// 变量将在客户端和服务端本地存在
// 如果你想让连接的服务端玩家使用服务端配置
// 你必须调用以下方法,使客户端使用服务端的值
config.sync("varName", playerEntity);
// 随意使用这种格式:
CryonicConfig.getConfig("mod_id").getInt("varName", 3);
// 你可以手动设置变量,而不是让 getter 自动生成
// 这也适用于覆盖旧值
config.setInt("varName", 3);
config.setDouble("name", 3.3);
config.setBoolean("var", true);
config.setString("str", "Geronimo!");
标记依赖
在 fabric.mod.json 中:
{
"depends": {
"cryonicconfig": "*"
}
}
在 mods.toml / neoforge.mods.toml 中:
[[dependencies.cryonicconfig]]
modId = "cryonicconfig"
type = "required"
versionRange = "[0,)"
- Cross-version easy to port config tool with minimal dependencies
- Specifically targeting ease of use and portability
- Cryonic because it's cool as hell
Explanation of Functionality
- This will store jsons in {minecraft_dir}/config as "mod_id.json"
- All config files will be read by dictionary in "cryonicconfig.json" on early init
- Configs are only configurable by editing the jsons directly, no plans of GUI config
- For ease of portability, synced variables are sent directly to a player in chat, and intercepted
- Hashmaps are used to look up Str to ConfigStorage and Str to Obj (variable)
API
Groovy (build.gradle) Add Dependency
Add Maven:
repositories {
maven { url "https://api.modrinth.com/maven" }
}
Modern/Architectury:
For only fabric or neoforge, replace ${project.name} with fabric,forge,neoforge
dependencies {
modImplementation "maven.modrinth:cryonicconfig:fabric-${project.name}:1.0.0+mc${rootProject.minecraft_version}"
}
b1.7.3:
dependencies {
modImplementation "maven.modrinth:cryonicconfig:babric:1.0.0+mcb1.7.3"
}
Simple Usage:
// You can store or use on the fly, this can be called anywhere
ConfigStorage config = CryonicConfig.getConfig("mod_id");
// You can store ints, doubles, booleans, and strings
// By getting them, you are setting their default value too
// getter format (variable name, default value)
// You cannot reuse variable names! They will be overridden.
config.getInt("varName", 3);
config.getDouble("name", 3.3);
config.getBoolean("var", true);
config.getString("str", "Geronimo!")
// The variable will exist locally on client and server
// If you want a connected server player to use a server config
// You must call, making client use the server's value
config.sync("varName", playerEntity);
// Feel free to use this format:
CryonicConfig.getConfig("mod_id").getInt("varName", 3);
// You can set variables manually, instead of letting get generate them
// This is also useful for overriding old values
config.setInt("varName", 3);
config.setDouble("name", 3.3);
config.setBoolean("var", true);
config.setString("str", "Geronimo!");
Mark Dependency
In fabric.mod.json:
{
"depends": {
"cryonicconfig": "*"
}
}
In mods.toml/neoforge.mods.toml:
[[dependencies.cryonicconfig]]
modId = "cryonicconfig"
type = "required"
versionRange = "[0,)"
下载 Cryonic Config
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Cryonic Config
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Cryonic Config
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Cryonic Config
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Cryonic Config
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Cryonic Config
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Cryonic Config
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Cryonic Config
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Cryonic Config
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Cryonic Config
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
适用于 Fabric 和 NeoForge 的 Minecraft 26.3。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
查看物品与配方
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
适用于 MC 1.18+ 的 Effekseer 加载器
模组
那是什么?一个 Waila/Hwyla 的分支。

评论 0
登录后参与评分
还没有评论,来抢沙发吧