Unnamed Common Library (UCL)

Quick rating

Unnamed Common Library (UCL)

No reviews yet

A very simple, easy to use configuration library that fits right in your mod!

Magic
QoL & Tweaks
API/Library
Mod Loaders
NeoForge
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 Required
Server Optional

About

Project Details

Type
Mod
License
Creative Commons Attribution Non Commercial Share Alike 4.0 International
Latest Version
Unnamed Common Library 0.5.0 for 1.21.11 Neoforge
Authors
CurseForge
Modrinth

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

CurseForge ID
Modrinth ID

Resources

External Links

About

Description

Curseforge's description limitations annoy me so instead here is a link to the Modrinth's description, which is properly formatted how I want it to look

English

❔ Tell me more about it

Unnamed Common Library (UCL) is my attempt at making a simple, useful, (yet to be) powerful configuration library. Its goal is to be general purpose so that no matter the mod you build or your preferences, you can always use it. This library is obviously not meant to be used on its own,if you do so it will at most serve as an example and a test for its capabilities.

🤩 Why you should like it

  • Very easy to implement and use
  • Optional configuration screen integrations
  • JSON, TOML, and YAML support

🧑‍💻 For developers

Installation

Add the repository to your build.gradle(.kts):

repositories {
    maven {
        url = "https://maven.pkg.github.com/aurorarissime/unnamed-common-library"
    }
}

And in your buildscript, add the dependency (modImplementation for Fabric, implementation for NeoForge):

dependencies {
    (mod)Implementation("from.discorde:ucl:${ucl_version}+${minecraft_version}-fabric")
}
Usage

1. Create your configuration model

MyModConfig.java

import from.discorde.ucl.common.config.annotations.*;

@Configuration(
    name = "mymod"
)
public class MyModConfig {
    @Comment("Enable the awesome feature")
    public boolean awesomeFeature = true;

    @Comment("Maximum power level (0-100)")
    public int maxPower = 50;

    @Comment("Welcome message displayed to players")
    public String welcomeMessage = "Hello!";
}

2. Load the configuration in your mod initialiser

MyMod.java

public class MyMod implements ModInitializer {
    // The wrapper class is auto-generated at compile time
    public static final MyModConfigWrapper CONFIG = MyModConfigWrapper.createAndLoad();

    @Override
    public void onInitialize() {
        if (CONFIG.awesomeFeature) {
            System.out.println("Awesome feature is enabled!");
        }
    }
}
References

Annotations

@Configuration

Add this annotation right above your config class

Parameter Type Default Description
name String required Config file or folder name
location ConfigurationLocation SUBDIRECTORY Where to save the config
format ConfigurationFormat JSON5 File format to use
screen boolean true Generate YACL config screen

@Comment

Add this annotation above any field to include a comment in the config file

@Comment("This comment will appear above the field in the config file")
public boolean myOption = true;

Enums

ConfigurationLocation

Value Description
ROOT Save directly in the config folder as {name}.{ext}
SUBDIRECTORY Save in a subfolder as {name}/configuration.{ext}

ConfigurationFormat

Value Extension Description
JSON5 .json5 JSON with comments, trailing commas, and unquoted keys
TOML .toml Tom's Obvious Minimal Language
YAML .yaml YAML Ain't Markup Language
Configuration screens integration

If screen = true (default) in your @Configuration annotation and YetAnotherConfigLib (YACL) is installed, a configuration screen will be auto-generated and accessible through Mod Menu.
To disable the config screen, just set the screen parameter to false in the @Configuration annotation.

Enjoy 🙂

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
Total Downloads
CurseForge
<1,000
Modrinth
<1,000
Last Updated
CurseForge
Modrinth
Created
CurseForge
Modrinth
Last synced
When ModDex last fetched this project from CurseForge or Modrinth. Every project is re-checked on a schedule, and any project that ships a new file is synced automatically within hours of the release.
New file updates sync automatically
How syncing works