Fiber2Cloth

Fiber2Cloth is a convenient library that allows converting Fiber configuration nodes into Cloth Config interfaces with just one line of code.
Compatibility and Requirements
The library requires Cloth Config 2 version 1.1.1 or higher. Please note that this is an experimental version with a limited set of features. The developer is actively testing it in their own projects.
Supported Data Types
The library automatically works with the following types:
- Integer values (Integer, Long)
- Floating-point numbers (Float, Double)
- Boolean values
- Strings
- Arrays of various types
API Usage
The main functionality is implemented with one line of code:
Fiber2Cloth.create(screen, modid, configNode, configScreenTitleKey).setSaveRunnable(() -> {
// Here the node serialization into configuration file is performed
}).build().getScreen();
The system automatically creates categories for values without parent nodes, supports multi-level nesting, and forms subcategories starting from the second level.
Extending Functionality
To work with unsupported data types, use the Fiber2Cloth#registerConfigEntryFunction method, which accepts the object class and a conversion function from ConfigValue to AbstractConfigListEntry.
Interface Customization
To change the default "Yes/No" texts in boolean toggles, add translations to language files with keys in the format config.{modid}.{valueName}.boolean.{true/false}.