James 的配置模组是一个轻量级的配置管理模组,用于轻松添加可扩展的配置。内置了两种“类型”的配置:注册表配置(Registry configs)和设置配置(Setting configs)。
注册表配置是可以包含任意数量对象的配置,所有这些对象都会被读取到配置中。在注册表配置中,每个非基本类型的对象都需要指定其类型。另一方面,设置配置拥有固定数量的对象,且每个对象都具有特定的类型。因此,设置配置无需指定类型。
开发者文档 - 如果你是普通用户请忽略
使用 Maven 依赖
添加仓库
我使用 Modrinth Maven 来托管这些文件(懒得搭建正式的 Maven 仓库 lol)。要添加该仓库,请将以下内容添加到你的 build.gradle 文件的 repositories 代码块中:
repositories {
maven {
name = "Modrinth Maven"
url = "https://api.modrinth.com/maven"
}
}
添加依赖
要添加依赖项,请将以下内容添加到你的 build.gradle 文件的 dependencies 代码块中:
dependencies {
implementation(fg.deobf("maven.modrinth:config-lib:VERSION-MODLOADER"))
}
其中 VERSION 是库的版本号(例如 1.2),MODLOADER 是加载器名称(对于 Fabric 和 Quilt,填写 fabric;对于 Forge 和 NeoForge,填写 forge)。
创建你的第一个配置
要创建你的第一个配置,请查看 common/src/main/java/net/vakror/jamesconfig/config/example 目录。这里是示例存放的位置。
这里提供了注册表配置和设置配置的示例。
James's config mod is a lightweight config mod for easily adding extendible configs. There are two built-in "types" of configs: Registry configs and Setting configs. Registry configs are configs which can have any amount of objects, which will all be read into the config. Each non-primitive object in a registry config needs to specify its type. On the other hand, setting configs have a set amount of objects, each of which are a certain type. Because of this, setting configs do not need to specify types.
Developer Docs- Ignore if you are a user
Depending on using maven
Adding The Repository
I am using modrinth maven to host these files (too lazy to set up a proper maven repo lol). To add it, add this to your repositories block in your build.gradle:
repositories {
maven {
name = "Modrinth Maven"
url = "https://api.modrinth.com/maven"
}
}
Adding the dependency
To add the dependency, add this to the dependencies block in your build.gradle:
dependencies {
implementation(fg.deobf("maven.modrinth:config-lib:VERSION-MODLOADER"))
}
Version is the version of the lib (e.g 1.2) and loader is the loader (for fabric and quilt, this is fabric, for forge and neoforge, this is forge)
Making Your first config
To make your first config, look at the common/src/main/java/net/vakror/jamesconfig/config/example directory. this is where examples are placed.
There are examples for both registry config and setting configs.
下载 James's Config Lib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 James's Config Lib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 James's Config Lib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 James's Config Lib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 James's Config Lib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 James's Config Lib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 James's Config Lib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 James's Config Lib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 James's Config Lib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 James's Config Lib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
修复一些方法冲突
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
查看物品与配方
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
适用于 MC 1.18+ 的 Effekseer 加载器
模组
添加区块认领和玩家组队功能,并与 Xaero's Minimap 和 World Map 集成
评论 0
登录后参与评分
还没有评论,来抢沙发吧