mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2025-01-09 05:46:26 +01:00
a8de91d541
- Only one task engine for everything now - Fixes crash on LightUpdater init when Flywheel is off - Attempt to wrangle InstanceWorld init code - Misc. cleanup/renaming
61 lines
1.6 KiB
Java
61 lines
1.6 KiB
Java
package com.jozufozu.flywheel.config;
|
|
|
|
import org.apache.commons.lang3.tuple.Pair;
|
|
|
|
import net.minecraftforge.common.ForgeConfigSpec;
|
|
import net.minecraftforge.common.ForgeConfigSpec.BooleanValue;
|
|
import net.minecraftforge.common.ForgeConfigSpec.EnumValue;
|
|
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();
|
|
|
|
ModLoadingContext.get()
|
|
.registerConfig(ModConfig.Type.CLIENT, client.getRight());
|
|
}
|
|
|
|
public static FlwConfig get() {
|
|
return INSTANCE;
|
|
}
|
|
|
|
public BackendType getBackendType() {
|
|
return client.backend.get();
|
|
}
|
|
|
|
public boolean debugNormals() {
|
|
return client.debugNormals.get();
|
|
}
|
|
|
|
public boolean limitUpdates() {
|
|
return client.limitUpdates.get();
|
|
}
|
|
|
|
public static void init() {
|
|
}
|
|
|
|
public static class ClientConfig {
|
|
public final EnumValue<BackendType> backend;
|
|
public final BooleanValue debugNormals;
|
|
public final BooleanValue limitUpdates;
|
|
|
|
public ClientConfig(ForgeConfigSpec.Builder builder) {
|
|
backend = builder.comment("Select the backend to use.")
|
|
.defineEnum("backend", BackendType.INSTANCING);
|
|
|
|
debugNormals = builder.comment("Enable or disable a debug overlay that colors pixels by their normal.")
|
|
.define("debugNormals", false);
|
|
|
|
limitUpdates = builder.comment("Enable or disable instance update limiting with distance.")
|
|
.define("limitUpdates", true);
|
|
}
|
|
}
|
|
}
|