James's Config Lib - Universal Configuration Library
James's Config Lib is a lightweight solution for creating extensible configuration files in Minecraft mods. The library offers two main types of configurations, each designed for different usage scenarios.
Configuration Types
Registry configurations allow adding unlimited objects that are automatically read from the file. Each non-primitive object in such configuration requires specifying its data type.
Setting configurations contain a fixed set of objects with predefined data types. Thanks to this, they don't require explicit type specification for each element.
For Developers
Connecting via Maven
To use the library in your project, add the following repository to the repositories block in your build.gradle file:
repositories {
maven {
name = "Modrinth Maven"
url = "https://api.modrinth.com/maven"
}
}
Adding Dependency
Include the library in your project dependencies by adding the following line to the dependencies block:
dependencies {
implementation(fg.deobf("maven.modrinth:config-lib:VERSION-MODLOADER"))
}
Replace VERSION with the current library version (e.g., 1.2), and MODLOADER with the appropriate loader (fabric for Fabric and Quilt, forge for Forge and NeoForge).
Creating Your First Configuration
To get familiar with the library's operation, study the examples in the common/src/main/java/net/vakror/jamesconfig/config/example directory. Here you'll find working examples of both registry and setting configurations.