Mod

Millie's Config & Utils

Quick rating

Millie's Config & Utils

No reviews yet

Small config and utils library for creating and managing .properties, .json, .json5 and .yaml/yml configs and saving on duplicate util classes between my projects

API/Library
Mod Loaders
Fabric
Minecraft

Community voices

Reviews

Versions
Loading versions…
Match includes

Click once to include, again to exclude, again to clear

Rating Any
Any 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0
Min
Max
Play Status
Reviews
Time Played
hrs+
Verified developers only
Has developer response
List view
Grid view
Compact view
Sort by
Date
Rating
Helpful
Unhelpful
Edited
Sort ascending
Delete this review?

This removes your review from the project. You can write a new review after.

Review submitted for moderation

Your review has been sent to moderators, who will check that it meets our guidelines before it appears publicly.

No reviews yet. Be the first to review this project!

Get it on

Available Platforms

Compatibility

Supported Environments

Dev Environment
Client Optional
Server Optional

About

Project Details

Type
Mod
Authors

For authors

Embed Badge

If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.

Custom banner text
ModDex rating badge preview

Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.

Identifiers

Platform IDs

Modrinth ID

Resources

External Links

Source Issues Wiki Discord

About

Description

Millie's Config & Utils

Easy to use :D


Why?

I really needed a config lib and utils for the stuff I often make.

Dev Noted

I'm currently working on the 1.1 version of the mod for Fabric 1.21.11, then version 1.2 for Fabric 1.21.11 and only then I'll start porting to older and newer versions of Minecraft as well as porting the entire mod over to Forge/NeoForge


Documentation

Config Library - Example Config
A lot of design inspiration came from SuperMartijn642's Config Lib (No code was directly copied from that project.)

How to Add to Gradle Project

In Kotlin (build.gradle.kts)


repositories {
    maven("https://api.modrinth.com/maven")
}

dependencies {
    // Replace [VERSION] with whatever latest version is available 
    // for the Minecraft version and loader you need
    modImplementation("maven.modrinth:millies-config-n-utils:[VERSION]")
}

In Groovy (build.gradle)

I dunno

Config Files
package net.yourmod.mod;

import net.justmili.libs.config.FileType;
import net.justmili.libs.config.build.ConfigEntry;
import net.justmili.libs.config.build.ListConfigEntry;
import net.justmili.libs.config.build.MConfigBuilder;

import java.util.List;

public class ExampleConfig {
    public static ConfigEntry<Integer> someInt;
    public static ConfigEntry<Float> someFloat;
    public static ConfigEntry<Double> someDouble;
    public static ConfigEntry<Long> someLong;
    public static ConfigEntry<Boolean> someBool;
    public static ConfigEntry<String> someString;
    public static ListConfigEntry someDoubleList; // ListConfigEntries will change to use the params
    public static ListConfigEntry someStringList; // as ConfigEnties (ListConfigEntry -> ListConfigEntry<T>)

    public static void register() {
        MConfigBuilder builder = new MConfigBuilder(YourMod.MODID, "suffix-or-name", FileType.JSON5, false);

        someInt = builder.comment("Integer entry comment")
            .define("someInt", 10, 0, 100);

        builder.openCat("DecimalNumbers");
        someFloat = builder.comment("Float entry comment")
            .define("someFloat", 1.0f, 0.1f, 5.0f);

        someDouble = builder.comment("Double entry comment")
            .define("someDouble", 2.5, 0.0, 20.0);

        someLong = builder.comment("Long entry comment")
            .define("someLong", 123456789L, Long.MIN_VALUE, Long.MAX_VALUE);
        builder.closeCat();

        someBool = builder.comment("Boolean entry comment")
            .define("someBool", true);

        builder.comment("A category comment").openCat("Strings");
        someString = builder.comment("String entry comment")
            .define("someString", "Awawawa");

        someStringList = builder.comment("List entry comment - A string list")
            .defineList("someStringList", List.of("minecraft:grass_block", "minecraft:dirt", "minecraft:stone"), String.class);
        builder.closeCat();
        
        someDoubleList = builder.comment("List entry comment - A double list")
            .defineList("someDoubleList", List.of(4.2, 6.9, 6.7), Double.class);

        builder.build(); // Will create, load and update the config file depending on the situation
    }
}

TL;DR:

  • Config creation logic is similar to SuperMartijn642's Config Lib, but isn't based on Suppliers making it editable through your own code instead of it being read-only
  • MConfigBuilder takes:
    • Mod ID,
    • A file suffix/file name when subdirectory is made,
    • Config file type,
    • Boolean true/false do you want your config to be in a subfolder
    • Config Entries can be Integers, Floats, Doubles, Longs, Booleans, Strings or Lists of those same
    • value = builder.define(key, ...) defines a config key
    • value = builder.defineList(key, ...) defines a config list key
    • builder.openCat("CategoryName") opens a new category
      • Some config file types don't support categories (.properties)
    • builder.closeCat() closes last opened category
    • Categories can be put within eachother
    • .comment("example") can be used standalone with just builder.comment("An example");, or combined with entries or categories, e.g. value = builder.comment("A value").define(key, ...)
      • Some config file types don't support comments (.json)
Initializing The config
package net.yourmod.mod;

import net.fabricmc.api.ModInitializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class YourMod implements ModInitializer {
    @Override
    public void onInitialize() {
        ExampleConfig.register(); // That's literally it
    }
}

Util Library

How to Use The Util Classes

Idk how to explain all that so good luck


How long will this be kept updated?

Very long

Planned version-loader support?

  • 26.2.x - Fabric
  • 26.1.x - Fabric, NeoForge
  • 1.21.11 - Fabric/Quilt, NeoForge
  • (1.21.6-)1.21.8 - Fabric/Quilt, NeoForge
  • 1.21.4 - Fabric/Quilt, NeoForge
  • 1.21.1 - Fabric/Quilt, NeoForge
  • 1.20.1 - Fabric/Quilt, Forge

Planned config UI?

Yes I'm planning on it


Screenshots

Gallery

This project has no gallery images yet.

Versions

Files

Relations

Project Relations

More like this

Similar Mods

Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.

On ModDex

Community snapshot

0
Ratings
0
Followers
0
In stacks

By the numbers

Statistics

<1,000
Downloads
Last Updated
CurseForge
Created
Last synced
When ModDex last fetched and imported data for this project from CurseForge or Modrinth. High-traffic and active projects are checked more often.