|
yunfaLib (yunfaLib)Github |相关wiki |源站链接支持: fabricA library for Minecraft using the Fabric API that adds config, math, events, modules, and more.
Setup
build.gradle
repositories {
maven { url \"https://jitpack.io\" }
}
dependencies {
modImplementation \"com.github.yunfachi:yunfaLib:${project.yunfalib_version}\"
}Copy已复制!
gradle.properties
yunfalib_version=0.1.0Copy已复制!
Features
Config
Example Java: The values are stored in theinner class
import moe.yunfachi.yunfalib.config.Config;
import java.io.File;
public class Example {
private static class ConfigKeys {
String truth = \"this value is immediately saved to a file\";
}
public Example() {
final Config<ConfigKeys> config = new Config<>(
new File(\"./modid/config.yml\"),
new ConfigKeys()
);
config.get().truth = \"this value will be written after config.save()\";
config.save();
}
}Copy已复制!
Example Java: The values are stored in thenested class
import moe.yunfachi.yunfalib.config.Config;
import java.io.File;
public class Example {
public Example() {
final Config<ConfigKeys> config = new Config<>(
new File(\"./modid/config.yml\"),
new ConfigKeys()
);
config.get().truth = \"this value will be written after config.save()\";
config.save();
}
}
class ConfigKeys {
String truth = \"this value is immediately saved to a file\";
}Copy已复制!
Example Kotlin: The values are stored in theinner class
import moe.yunfachi.yunfalib.config.Config
import java.io.File
class Example {
init {
class ConfigKeys {
var truth = \"this value is immediately saved to a file\"
}
val config = Config(
File(\"./modid/config.yml\"),
ConfigKeys()
)
config.get().truth = \"this value will be written after config.save()\"
config.save()
}
}Copy已复制!
Example Kotlin: The values are stored in ananonymous object
import moe.yunfachi.yunfalib.config.Config
import java.io.File
class Example {
init {
val config = Config(
File(\"./modid/config.yml\"),
object {
var truth: String = \"this value is immediately saved to a file\"
}
)
config.get().truth = \"this value will be written after config.save()\"
config.save()
}
}Copy已复制!
Thanks
ProjectAuthorDescription
AnnotamlWiIIiam278library for generating YAML files
Stats
来自Modrinth所有游戏版本1.20.1所有类型fabric0.1.0yunfalib-0.1.0.jar下载0.1.0#Release展开版本: 0.1.0支持游戏: 1.20.1类型:FabricRelease下载次数: 358全部版本
markdown_parsed
文章类型:收录
layui.use([\'form\'], function(){
var form = layui.form;
});
yunfaLib |
楼主
2025-8-10 20:00:35
回复(0)
收起回复
|