43 lines
1.0 KiB
Markdown
43 lines
1.0 KiB
Markdown
## 📄 YML-Manager
|
|
_dveveloped by JernejTDO_
|
|
|
|
A lightweight, high-performance YAML configuration library designed to mimic the intuitive Spigot/Bukkit YamlConfiguration API. This manager provides a simple way to read, write, and update nested YAML files.
|
|
|
|
## 📥 Maven
|
|
Repository
|
|
```xml
|
|
<repositories>
|
|
<repository>
|
|
<id>gitea</id>
|
|
<url>https://git.triler.eu/api/packages/JernejTDO/maven</url>
|
|
</repository>
|
|
</repositories>
|
|
```
|
|
Dependency
|
|
```xml
|
|
<dependency>
|
|
<groupId>net.triler</groupId>
|
|
<artifactId>yml-manager</artifactId>
|
|
<version>0.1</version>
|
|
</dependency>
|
|
```
|
|
|
|
## 🛠 Usage Example
|
|
```java
|
|
File file = new File("config.yml");
|
|
ConfigManager config = new ConfigManager(file);
|
|
|
|
// Load the data from the disk
|
|
config.load();
|
|
|
|
// Read values easily
|
|
String host = config.getString("mysql.host");
|
|
int port = config.getInt("mysql.port");
|
|
|
|
// Update or Create new keys
|
|
config.set("mysql.port", 3307);
|
|
config.set("commands.fly.enable", true);
|
|
|
|
// Save the changes back to the file
|
|
config.save();
|
|
``` |