
Что это
A YAML api to read and write to YAML files for Fabric.
- Тип: мод
- Загрузчик: fabric
- Версии Minecraft: 1.19.4 – 1.21
- Скачиваний на Modrinth: 1 618
Подробно
Overview 5q12's YAML API is a simple and efficient API for reading and writing YAML files within the Minecraft Fabric modding environment. This API facilitates seamless integration of YAML configuration files, allowing mod developers to easily manage configuration data.
Features - Read YAML Files: Parse YAML files into Java objects with ease. - Write YAML Files: Serialize Java objects into YAML format. - Integration: Designed specifically for use with Fabric, ensuring compatibility and performance.
repositories { maven { url = uri("https://yml.ccls.app/v1.1.3") } mavenCentral() }
dependencies { modImplementation 'app.ccls.yml:yamlapi:1.1.3' }
Imports java import app.ccls.yml.YamlHandler; import app.ccls.yml.YamlHandlerFactory;
Simple Key-Value Storage java import app.ccls.yml.YamlHandler; import app.ccls.yml.YamlHandlerFactory; import java.io.IOException; import java.util.HashMap; import java.util.Map;
public class SimpleKeyValueExample { public static void main(String[] args) { // Initialize YamlHandler with the "nested" format YamlHandler yamlHandler = YamlHandlerFactory.getHandler("nested");
// Define a file path String filePath = "config/simpledata.yml";
// Create a simple key-value map Map data = new HashMap<>(); data.put("username", "exampleUser"); data.put("score", 1500);
try { // Write the data to the YAML file yamlHandler.writeYaml(filePath, data); System.out.println("Data saved to " + filePath);
// Read the data back from the YAML file Map loadedData = yamlHandler.readYaml(filePath); System.out.println("Loaded data: " + loadedData); } catch (IOException e) { e.printStackTrace(); } } }
Nested Structures java import app.ccls.yml.YamlHandler; import app.ccls.yml.YamlHandlerFactory; import java.io.IOException; import java.util.HashMap; import java.util.Map;
public class NestedStructureExample { public static void main(String[] args) { // Initialize YamlHandler with the "nested" format YamlHandler yamlHandler = YamlHandlerFactory.getHandler("nested");
// Define a file path String filePath = "config/nesteddata.yml";
// Create a nested structure map Map data = new HashMap<>(); Map userDetails = new HashMap<>(); userDetails.put("age", 25); userDetails.put("email", "user@example.com")
Как установить
Скачайте файл на официальной странице ниже и положите его в папку mods (для модов) или plugins (для плагинов) вашего сервера или клиента. Для модов нужен совместимый загрузчик. Версия должна совпадать с версией Minecraft.
Текст подготовлен автоматически из описания на Modrinth и ждёт проверки редакцией.
Комментарии 0
Комментарии к этому материалу отключены.
Читайте также
Better Archeology (1.20 Update)
Better Archeology adds new life to the archeology mechanic in Minecraft. 05.12.2026
Dragon Ball Z Totems Pack Optifine
A fan-made resource pack that transforms your Totem of Undying into Dragon Ball Z characters with OptiFine CIT support. Featuring Goku… 05.12.2026
Vivecraft Perfected - spooky scary edition
A variation of Vivecraft perfected leaning towards a horror experience 05.12.2026
Create: Eternal Zinc
This is an addon for the Create mod that makes zinc an infinite resource. 05.12.2026
TalkingClouds
Speech bubbles for players and for any other entities. 05.12.2026
New Sniffer Egg
Changing the texture of the sniffer egg to a more beautiful one! 05.12.2026