GithubHelp home page GithubHelp logo

testure / configurator Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 98 KB

Library mod for creating JSON based configs

License: GNU General Public License v3.0

Java 100.00%
minecraft minecraft-mod forge library-mod

configurator's Introduction

About

Configurator is a 1.16+ Forge library mod that allows developers to define .json config files in the same style as Forge's own config system.

Usage

Mods

A typical config class goes as such:

public static final BooleanConfigValue boolValue;
public static final StringConfigValue stringValue;

static {
    Config.Builder builder = Config.Builder.builder().withName("cool_config").withFolder("i_am_config").ofType(Config.Type.COMMON);
    
    builder.push("cool_booleans");
    boolValue = builder.define("i_am_cool", true);
    builder.pop();
    builder.push("cool_strings");
    stringValue = builder.define("my_name_is", "Dan");
    builder.pop();
    
    Configurator.register(builder);
}

This will create a json file called cool_config.json in config/i_am_config/common with the following contents:

{
    "cool_booleans": {
        "i_am_cool": true
    },
    "cool_strings": {
        "my_name_is": "Dan"
    }
}

You will then be able to get these values by doing:

boolValue.get();

and

stringValue.get();

You can use Config.Type.UNCATEGORIZED to have config files generate directly in their defined folder.

CT

Coming soon!

Installation

  1. Add the cursemaven to your build.gradle:
    repositories {
        maven {
            url "https://cursemaven.com"
        }
    }
    
  2. Go to the page for the jar you want to use on curseforge and get the ID at the end of the link. (example: 3695530 is version 1.0)
  3. Add implementation fg.deobf("curse.maven:configurator-594414:FileID") (replace "FileID" with the ID you got) to your dependencies in your build.gradle.
  4. Run refreshDependencies

configurator's People

Contributors

testure avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.