Prism Config

Quick rating

Community listing page, reviews here may not be monitored by the author.

Prism Config

By moechakuchaOwner

No reviews yet

A lightweight config library for Java to let you write your config elegantly and flexibly. Theoretically standalone from any loaders.

API/Library
Mod Loaders
Fabric
Quilt
Minecraft

Community voices

Reviews

List view
Grid view
Compact view
Sort by
Date
Rating
Helpful
Unhelpful
Edited
Sort ascending
Show per page
10
25
50
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

Where It Runs
Either Side, Better on Both

Works on the client or the server alone, but does more when on both.

About

Project Details

Type
Mod
License
MIT License
Latest Version
0.2.0

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

About

Description

Icon

java8 gradle Release

A lightweight config library for Java to let you write your config elegantly and flexibly.

Getting Started

For users, Prism Config can be installed as a Fabric mod natively as it includes a fabric.mod.json, but it is mostly for JiJ, and the mod itself is actually just a normal Java library, so it can theoretically run on any Minecraft version with any loader. However, support for specific mods, like Mod Menu, is planned.

For developers, to add Prism Config to your project, you need to add following into your build.gradle(.kts):

Groovy DSL:

repositories {
    // ...
    maven {
        name = "Nova Committee - Release"
        url = "https://maven.nova-committee.cn/releases/"
    }
    maven {
        name = "Nova Committee - Snapshot"
        url = "https://maven.nova-committee.cn/snapshots/"
    }
}

dependencies {
    // ...
    implementation "io.github.prismwork:prismconfig:0.2.0:all"
    // Or use the slim jar if you have the libraries included in your project (Gson, Jankson...)
    // implementation "io.github.prismwork:prismconfig:0.2.0"
}

Kotlin DSL:

repositories {
    // ...
    maven {
        name = "Nova Committee - Release"
        url = uri("https://maven.nova-committee.cn/releases/")
    }
    maven {
        name = "Nova Committee - Snapshot"
        url = uri("https://maven.nova-committee.cn/snapshots/")
    }
}

dependencies {
    // ...
    implementation("io.github.prismwork:prismconfig:0.2.0:all")
    // Or use the slim jar if you have the libraries included in your project (Gson, Jankson...)
    // implementation("io.github.prismwork:prismconfig:0.2.0")
}

Prism Config by default provides serializers and deserializers for JSON (Gson), JSON5 (Jankson) and TOML 0.4.0 (toml4j).

To parse a config from string into object, you can do this:

String content;
MyConfig config = PrismConfig.getInstance().serialize(
        MyConfig.class,
        content,
        DefaultSerializers.getInstance().json5(MyConfig.class) // We assume that your config is written in JSON5
);

To parse a config from object into string, you can do this:

MyConfig content;
String config = PrismConfig.getInstance().deserialize(
        MyConfig.class,
        content,
        DefaultDeserializers.getInstance().json5(MyConfig.class) // We assume that your config is written in JSON5
);

You can also write it to a file:

MyConfig content;
File configFile;
PrismConfig.getInstance().deserializeAndWrite(
        MyConfig.class,
        content,
        DefaultDeserializers.getInstance().json5(MyConfig.class), // We assume that your config is written in JSON5
        configFile
);

To write your own serializer/deserializer, you can use the following code (we use serializing as an example):

String content;
PrismConfig.getInstance().serialize(
        MyConfig.class,
        content,
        (string) -> {
            // Do your own parsing here
        }
);

Libraries Used

  • Jankson by falkreon, licensed under MIT.
  • Gson by Google, licensed under Apache-2.0.
  • toml4j by Moandji Ezana, licensed under MIT.

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 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