2021-06-19 07:52:33 +02:00
|
|
|
package com.jozufozu.flywheel.config;
|
|
|
|
|
2021-06-30 21:43:54 +02:00
|
|
|
import org.apache.commons.lang3.tuple.Pair;
|
|
|
|
|
2021-06-19 07:52:33 +02:00
|
|
|
import net.minecraftforge.common.ForgeConfigSpec;
|
|
|
|
import net.minecraftforge.common.ForgeConfigSpec.BooleanValue;
|
|
|
|
import net.minecraftforge.fml.ModLoadingContext;
|
|
|
|
import net.minecraftforge.fml.config.ModConfig;
|
|
|
|
|
|
|
|
public class FlwConfig {
|
|
|
|
|
|
|
|
private static final FlwConfig INSTANCE = new FlwConfig();
|
|
|
|
|
|
|
|
public final ClientConfig client;
|
|
|
|
|
|
|
|
public FlwConfig() {
|
|
|
|
Pair<ClientConfig, ForgeConfigSpec> client = new ForgeConfigSpec.Builder().configure(ClientConfig::new);
|
|
|
|
|
|
|
|
this.client = client.getLeft();
|
|
|
|
|
2021-06-30 21:43:54 +02:00
|
|
|
ModLoadingContext.get()
|
|
|
|
.registerConfig(ModConfig.Type.CLIENT, client.getRight());
|
2021-06-19 07:52:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public static FlwConfig get() {
|
|
|
|
return INSTANCE;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean enabled() {
|
|
|
|
return client.enabled.get();
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean normalOverlayEnabled() {
|
|
|
|
return client.normalDebug.get();
|
|
|
|
}
|
|
|
|
|
2021-06-30 21:43:54 +02:00
|
|
|
public static void init() {
|
|
|
|
}
|
2021-06-19 07:52:33 +02:00
|
|
|
|
|
|
|
public static class ClientConfig {
|
|
|
|
public final BooleanValue enabled;
|
|
|
|
public final BooleanValue normalDebug;
|
|
|
|
|
|
|
|
public ClientConfig(ForgeConfigSpec.Builder builder) {
|
|
|
|
|
|
|
|
enabled = builder.comment("Enable or disable the entire engine")
|
2021-06-30 21:43:54 +02:00
|
|
|
.define("enabled", true);
|
2021-06-19 07:52:33 +02:00
|
|
|
|
|
|
|
normalDebug = builder.comment("Enable or disable a debug overlay that colors pixels by their normal")
|
2021-06-30 21:43:54 +02:00
|
|
|
.define("normalDebug", false);
|
2021-06-19 07:52:33 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|