summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author alemi <me@alemi.dev>2023-02-19 23:47:51 +0100
committer alemi <me@alemi.dev>2023-02-19 23:47:51 +0100
commit184aa773bad91975f3309d4408f308437ca17e2a (patch)
treefb03908982ed3c79a2a33f1b9f27316ed956f0ea
parentc6dff8df7d3c4959c7e1a2e80456a8ea59ba5b73 (diff)
feat: command to toggle all modules (dirty fix...)
-rw-r--r--src/main/java/ftbsc/bscv/BoSCoVicino.java13
1 files changed, 13 insertions, 0 deletions
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