From 184aa773bad91975f3309d4408f308437ca17e2a Mon Sep 17 00:00:00 2001 From: alemi Date: Sun, 19 Feb 2023 23:47:51 +0100 Subject: feat: command to toggle all modules (dirty fix...) --- src/main/java/ftbsc/bscv/BoSCoVicino.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/ftbsc/bscv/BoSCoVicino.java b/src/main/java/ftbsc/bscv/BoSCoVicino.java index 79dc3d9..6c06c42 100644 --- a/src/main/java/ftbsc/bscv/BoSCoVicino.java +++ b/src/main/java/ftbsc/bscv/BoSCoVicino.java @@ -127,6 +127,19 @@ public class BoSCoVicino implements ICommons { } }) ); + + dispatcher.register( + Commands.literal("toggle-all") + .executes(ctx -> { + for (Module mod : BoSCoVicino.mods) { + if (mod.enabled.get()) { + mod.disable(); + mod.enable(); + } + } + return 1; + }) + ); } @SubscribeEvent -- cgit v1.2.3-56-ga3b1