aboutsummaryrefslogtreecommitdiff
path: root/src/testmod/java/dev/isxander/yacl/test/config/Entrypoint.java
blob: 7875700736d0e4f71d5c3a18934c9a4fd073bb16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package dev.isxander.yacl.test.config;

import com.google.gson.Gson;
import dev.isxander.yacl.config.ConfigInstance;
import dev.isxander.yacl.config.GsonConfigInstance;
import dev.isxander.yacl.config.YACLConfigManager;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.loader.api.FabricLoader;

public class Entrypoint implements ClientModInitializer {
    @Override
    public void onInitializeClient() {
        YACLConfigManager.register(new GsonConfigInstance<>(ConfigData.class, FabricLoader.getInstance().getConfigDir().resolve("yacl-test.json"), new Gson()));
    }

    public static ConfigInstance<ConfigData> getConfig() {
        return YACLConfigManager.getConfigInstance(ConfigData.class);
    }
}