Radon
这个模组是一个极易使用的配置库。
使用方法如下:
- 将 Modrinth Maven 仓库添加到你的项目中:
repositories {
maven {
url = "https://api.modrinth.com/maven"
}
}
- 将 Radon 添加到你模组的依赖项中:
dependencies {
modImplementation "maven.modrinth:radon-lib:FIND_THE_LATEST_VERSION_ON_MODRINTH"
}
- 创建一个继承自
ConfigScreen的类:
package your.mod;
import me.kitty.radon.api.*;
public class MyConfig extends ConfigScreen {
@Override
public String getScreenTitle() {
return "your screen's title";
}
@Override
protected void radon() {
// 你需要标签页(Tab)来创建行
Tab tab = tab("tab's name");
Tab otherTab = tab("second tab");
// 你也可以创建分区(Section)
Section section = section(otherTab, "name");
// 这里我们来创建选项
// 如果你需要布尔值或枚举类型
// 请使用 ButtonRow
enum myEnum {
RADON,
CONFIG
}
ButtonRow buttonRow = buttonRow(
tab,
key("button_row"), // 行的键:Radon 将使用此键将行的内容保存到磁盘
"Label of the row",
List.of("Tooltip", "shows when you", "hover the row", "with your mouse"),
myEnum.RADON // 枚举的一个选项,或者 true / false
);
// 有时你想在按钮值改变时运行代码
// 这非常简单:
buttonRow.subscribe(newValue -> {
// newValue 是一个对象
// 但你可以将其转换为
(boolean) newValue
// 或者
(myEnum) newValue
// 未来可能会简化此操作
});
// 接下来是滑块行
// 如果你需要一个数字,请使用此选项
SliderRow sliderRow = sliderRow(
section, // 这里你可以使用分区而不是标签页
key("slider_key"),
"Label of the row",
List.of("Tooltip again"),
80, // 初始值
50, // 最小值
100 // 最大值
);
// 这里的 subscribe 会给你一个 long 类型的 newValue
// 你也可以在 Radon 加载该选项的保存值时运行代码
sliderRow.onInit(() -> {
long value = sliderRow.getValue();
});
// 如果你需要字符串值,请使用 InputRow
InputRow inputRow = inputRow(
tab,
key("input"),
"Label of the row",
List.of("Tooltip"),
"Placeholder",
16 // 限制字符数量
);
// 这里的 subscribe 会给你一个 String 类型的 newValue
}
}
- 将你的类作为入口点添加到
fabric.mod.json中:
{
"entrypoints": {
"radon": ["your.mod.MyConfig"]
}
}
就是这么简单!
Radon
This mod is a very easily usable configuration library.
Here's how to use it:
- Add the Modrinth Maven repository to your project:
repositories {
maven {
url = "https://api.modrinth.com/maven"
}
}
- Add Radon to the dependencies of your mod:
dependencies {
modImplementation "maven.modrinth:radon-lib:FIND_THE_LATEST_VERSION_ON_MODRINTH"
}
- Create a class which extends ConfigScreen:
package your.mod;
import me.kitty.radon.api.*;
public class MyConfig extends ConfigScreen {
@Override
public String getScreenTitle() {
return "your screen's title";
}
@Override
protected void radon() {
// you need tabs to create rows
Tab tab = tab("tab's name");
Tab otherTab = tab("second tab");
// you can also create sections
Section section = section(otherTab, "name");
// this is where we create our options
// if you want a boolean or an enum
// then you want to use ButtonRow
enum myEnum {
RADON,
CONFIG
}
ButtonRow buttonRow = buttonRow(
tab,
key("button_row"), // key of the row: Radon will save the content of the row to the disk with this key
"Label of the row",
List.of("Tooltip", "shows when you", "hover the row", "with your mouse"),
myEnum.RADON // either an option of your enum or true or false
);
// you sometimes want to run code, if the button's value is changed
// it's very simple to do that:
buttonRow.subscribe(newValue -> {
// newValue is an object
// but you can cast it into
(boolean) newValue
// or
(myEnum) newValue
// this will probably be made easier
});
// now, comes the slider row
// use this if you want a number
SliderRow sliderRow = sliderRow(
section, // here you can use a section instead of the tab
key("slider_key"),
"Label of the row",
List.of("Tooltip again"),
80, // initial value
50, // minimum value
100 // maximum value
);
// here subscribe gives you a long as newValue
// you can also run code, if Radon loaded the saved value of the option
sliderRow.onInit(() -> {
long value = sliderRow.getValue();
});
// and if you need a string value, use InputRow
InputRow inputRow = inputRow(
tab,
key("input"),
"Label of the row",
List.of("Tooltip"),
"Placeholder",
16 // limit how many characters it can be
);
// subscribe gives newValue as String here
}
}
- Add your class to
fabric.mod.jsonas an entrypoint:
{
"entrypoints": {
"radon": ["your.mod.MyConfig"]
}
}
It's that easy!
版本游戏版本平台发布时间本站下载
测试版
1.0.0-beta.7+1.21.11
Radon 1.0.0-beta.7+1.21.11
1.21.11 Fabric 8 个月前 ·
0
1.21.11
Fabric
8 个月前
0
下载 Radon
版本:1.0.0-beta.7+1.21.11
游戏版本:1.21.11
平台:Fabric
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
测试版
1.0.0-beta.7+1.21.10
Radon 1.0.0-beta.7+1.21.10
1.21.101.21.9 Fabric 8 个月前 ·
0
1.21.10
1.21.9
Fabric
8 个月前
0
下载 Radon
版本:1.0.0-beta.7+1.21.10
游戏版本:1.21.10、1.21.9
平台:Fabric
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
测试版
1.0.0-beta.7+1.21.8
Radon 1.0.0-beta.7+1.21.8
1.21.81.21.7 Fabric 8 个月前 ·
0
1.21.8
1.21.7
1.21.6
Fabric
8 个月前
0
下载 Radon
版本:1.0.0-beta.7+1.21.8
游戏版本:1.21.8、1.21.7、1.21.6
平台:Fabric
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
测试版
1.0.0-beta.7+1.21.5
Radon 1.0.0-beta.7+1.21.5
1.21.5 Fabric 8 个月前 ·
0
1.21.5
Fabric
8 个月前
0
下载 Radon
版本:1.0.0-beta.7+1.21.5
游戏版本:1.21.5
平台:Fabric
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
测试版
1.0.0-beta.7+1.21.4
Radon 1.0.0-beta.7+1.21.4
1.21.41.21.3 Fabric 8 个月前 ·
0
1.21.4
1.21.3
1.21.2
Fabric
8 个月前
0
下载 Radon
版本:1.0.0-beta.7+1.21.4
游戏版本:1.21.4、1.21.3、1.21.2
平台:Fabric
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
测试版
1.0.0-beta.7+1.21.1
Radon 1.0.0-beta.7+1.21.1
1.21.11.21 Fabric 8 个月前 ·
0
1.21.1
1.21
Fabric
8 个月前
0
下载 Radon
版本:1.0.0-beta.7+1.21.1
游戏版本:1.21.1、1.21
平台:Fabric
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
测试版
1.0.0-beta.6+1.21.11
Radon 1.0.0-beta.6+1.21.11
1.21.11 Fabric 8 个月前 ·
0
1.21.11
Fabric
8 个月前
0
下载 Radon
版本:1.0.0-beta.6+1.21.11
游戏版本:1.21.11
平台:Fabric
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
测试版
1.0.0-beta.6+1.21.10
Radon 1.0.0-beta.6+1.21.10
1.21.101.21.9 Fabric 8 个月前 ·
0
1.21.10
1.21.9
Fabric
8 个月前
0
下载 Radon
版本:1.0.0-beta.6+1.21.10
游戏版本:1.21.10、1.21.9
平台:Fabric
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
测试版
1.0.0-beta.6+1.21.8
Radon 1.0.0-beta.6+1.21.8
1.21.81.21.7 Fabric 8 个月前 ·
0
1.21.8
1.21.7
1.21.6
Fabric
8 个月前
0
下载 Radon
版本:1.0.0-beta.6+1.21.8
游戏版本:1.21.8、1.21.7、1.21.6
平台:Fabric
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
测试版
1.0.0-beta.6+1.21.5
Radon 1.0.0-beta.6+1.21.5
1.21.5 Fabric 8 个月前 ·
0
1.21.5
Fabric
8 个月前
0
下载 Radon
版本:1.0.0-beta.6+1.21.5
游戏版本:1.21.5
平台:Fabric
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
暂无更新日志
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
Woot Revived
pharuxtan
一个用于收集生物掉落物的多区块模组。
生物科技
349
模组
玉Jade ?
Snownee
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
实用前置
339
模组
物品管理器Just Enough Items (JEI)
mezz
查看物品与配方
前置实用
239
模组
KubeJS
Lat
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
前置实用
239
模组
AAA Particles
ChloePrime
适用于 MC 1.18+ 的 Effekseer 加载器
前置装饰
186
模组
WTHIT
deirn
那是什么?一个 Waila/Hwyla 的分支。
前置实用
165
评论 0
登录后参与评分
还没有评论,来抢沙发吧