Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yunfachi/yunfalib
A library for Minecraft using the Fabric API that adds config, math, events, modules, and more.
https://github.com/yunfachi/yunfalib
fabric-mod minecraft minecraft-mod
Last synced: 8 days ago
JSON representation
A library for Minecraft using the Fabric API that adds config, math, events, modules, and more.
- Host: GitHub
- URL: https://github.com/yunfachi/yunfalib
- Owner: yunfachi
- License: other
- Created: 2022-12-04T12:08:03.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-11-05T14:16:30.000Z (about 1 year ago)
- Last Synced: 2024-11-13T23:11:09.135Z (about 2 months ago)
- Topics: fabric-mod, minecraft, minecraft-mod
- Language: Kotlin
- Homepage: https://modrinth.com/mod/yunfalib
- Size: 70.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# yunfaLib
A library for Minecraft using the Fabric API that adds config, math, events, modules, and more.## Setup
##### build.gradle
```groovy
repositories {
maven { url "https://jitpack.io" }
}dependencies {
modImplementation "com.github.yunfachi:yunfaLib:${project.yunfalib_version}"
}
```
##### gradle.properties
```properties
yunfalib_version=0.1.0
```## Features
### Config
Example Java: The values are stored in the inner class
```java
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 config = new Config<>(
new File("./modid/config.yml"),
new ConfigKeys()
);
config.get().truth = "this value will be written after config.save()";
config.save();
}
}
```Example Java: The values are stored in the nested class
```java
import moe.yunfachi.yunfalib.config.Config;
import java.io.File;public class Example {
public Example() {
final Config 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";
}
```
Example Kotlin: The values are stored in the inner class
```kotlin
import moe.yunfachi.yunfalib.config.Config
import java.io.Fileclass 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()
}
}
```Example Kotlin: The values are stored in an anonymous object
```kotlin
import moe.yunfachi.yunfalib.config.Config
import java.io.Fileclass 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()
}
}
```## Thanks
| Project | Author | Description |
|----------------------------------------------------|---------------------------------------------|------------------------------------|
| [Annotaml](https://github.com/WiIIiam278/Annotaml) | [WiIIiam278](https://github.com/WiIIiam278) | library for generating YAML files |## Stats
![Alt](https://repobeats.axiom.co/api/embed/321da4fd0a3bf68fb4f40ef705be5c7da467e646.svg "Repobeats analytics image")