JsonConfigAPI 1.0

A simple API for the creation of Json configs

  1. Vengine
    Tested Minecraft Versions:
    • 1.7
    • 1.8
    • 1.9
    • 1.10
    • 1.11
    • 1.12
    • 1.13
    • 1.14
    • 1.15
    • 1.16
    Source Code:
    https://github.com/SkillC0de/JsonConfigAPI
    IMPORTANT: This isn't a plugin!

    This is a simple API for the creation of Json configs.
    Example of how to use the API:

    Code (Java):
    package net.skillcode.jsonconfig.example;

    import net.skillcode.jsonconfig.JsonConfig;

    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.List;

    public class ExampleJsonConfig implements JsonConfig {

        private String exampleString = "This is an example String";
        private int exampleInt = 0;
        private List<String> exampleList = new ArrayList<>(Arrays.asList("example1", "example2", "example3"));

        public String getExampleString() {
            return exampleString;
        }

        public int getExampleInt() {
            return exampleInt;
        }

        public List<String> getExampleList() {
            return exampleList;
        }
    }
    Code (Java):
    package net.skillcode.jsonconfig.example;

    import net.skillcode.jsonconfig.JsonConfigAPI;
    import org.jetbrains.annotations.NotNull;

    public class Example {

        @NotNull
        private final static String PATH = "C:/Users/example/";
        @NotNull
        private final static String FILE_NAME = "example.json";

        public static void main(String[] args) {
            final JsonConfigAPI jsonConfigAPI = new JsonConfigAPI(true);
            jsonConfigAPI.registerConfig(new ExampleJsonConfig(), PATH, FILE_NAME);
            final ExampleJsonConfig exampleJsonConfig = jsonConfigAPI.getConfig(ExampleJsonConfig.class);

            System.out.println(exampleJsonConfig.getExampleString());
            System.out.println(exampleJsonConfig.getExampleInt());
            exampleJsonConfig.getExampleList().forEach(System.out::println);
        }

    }