diff options
author | alemidev <me@alemi.dev> | 2023-01-30 02:20:05 +0100 |
---|---|---|
committer | alemidev <me@alemi.dev> | 2023-01-30 02:20:05 +0100 |
commit | b7808b79386f45829667d4c5aff3ad681d42369b (patch) | |
tree | b8669c32b6d3138a9086533fc25dd2955ef99349 /src | |
parent | 2aa64795f5bf196429e9ca729b0717c40b77d432 (diff) |
fix: pop configspec!
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/co/fantabos/bscv/BoSCoVicino.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/main/java/co/fantabos/bscv/BoSCoVicino.java b/src/main/java/co/fantabos/bscv/BoSCoVicino.java index 5dab510..1808c99 100644 --- a/src/main/java/co/fantabos/bscv/BoSCoVicino.java +++ b/src/main/java/co/fantabos/bscv/BoSCoVicino.java @@ -28,6 +28,7 @@ import java.util.ArrayList; import java.util.List; import co.fantabos.bscv.modules.*; +import co.fantabos.bscv.modules.hud.*; // The value here should match an entry in the META-INF/mods.toml file @Mod("bscv") @@ -41,6 +42,8 @@ public class BoSCoVicino { private final CommandDispatcher<CommandSource> dispatcher = new CommandDispatcher<>(); + public static ForgeConfigSpec spec; + public BoSCoVicino() { // Register the setup method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientSetup); @@ -53,11 +56,21 @@ public class BoSCoVicino { ForgeConfigSpec.Builder builder = new ForgeConfigSpec.Builder(); - BoSCoVicino.mods.add(new Hud(builder, this.dispatcher)); + // TODO also push! + // modules cannot easily pop from their builder, but here we can't easily get + // the module name yet. We should push and pop the builder ourselves and not + // bother the modules themselves. + BoSCoVicino.mods.add(new Fullbright(builder, this.dispatcher)); + builder.pop(); BoSCoVicino.mods.add(new VanillaFlight(builder, this.dispatcher)); + builder.pop(); + BoSCoVicino.mods.add(new Coordinates(builder, this.dispatcher)); + builder.pop(); + BoSCoVicino.mods.add(new ActiveModules(builder, this.dispatcher)); + builder.pop(); - ForgeConfigSpec spec = builder.build(); + BoSCoVicino.spec = builder.build(); // register config handler ModLoadingContext.get().registerConfig(Type.CLIENT, spec, "bscv.toml"); |