From b7808b79386f45829667d4c5aff3ad681d42369b Mon Sep 17 00:00:00 2001 From: alemidev Date: Mon, 30 Jan 2023 02:20:05 +0100 Subject: fix: pop configspec! --- src/main/java/co/fantabos/bscv/BoSCoVicino.java | 17 +++++++++++++++-- 1 file 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 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"); -- cgit v1.2.3-56-ga3b1