aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/shcm/shsupercm/fabric/citresewn/CITResewnCommand.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/shcm/shsupercm/fabric/citresewn/CITResewnCommand.java')
-rw-r--r--src/main/java/shcm/shsupercm/fabric/citresewn/CITResewnCommand.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/CITResewnCommand.java b/src/main/java/shcm/shsupercm/fabric/citresewn/CITResewnCommand.java
new file mode 100644
index 0000000..483cbfb
--- /dev/null
+++ b/src/main/java/shcm/shsupercm/fabric/citresewn/CITResewnCommand.java
@@ -0,0 +1,33 @@
+package shcm.shsupercm.fabric.citresewn;
+
+import net.fabricmc.fabric.api.client.command.v1.ClientCommandManager;
+import net.fabricmc.loader.api.FabricLoader;
+import shcm.shsupercm.fabric.citresewn.config.CITResewnConfig;
+
+import static net.fabricmc.fabric.api.client.command.v1.ClientCommandManager.literal;
+import static net.minecraft.text.Text.of;
+
+public class CITResewnCommand {
+ public static boolean openConfig = false;
+
+ public static void register() {
+ ClientCommandManager.DISPATCHER.register(literal("citresewn")
+ .executes(context -> {
+ context.getSource().sendFeedback(of("CIT Resewn v" + FabricLoader.getInstance().getModContainer("citresewn").get().getMetadata().getVersion() + ":"));
+ boolean active = CITResewnConfig.INSTANCE().enabled && CITResewn.INSTANCE.activeCITs != null;
+ context.getSource().sendFeedback(of(" Active: " + (active ? "yes" : "no")));
+ if (active) {
+ context.getSource().sendFeedback(of(" Loaded: " + CITResewn.INSTANCE.activeCITs.cits.size() + " CITs from " + CITResewn.INSTANCE.activeCITs.packs.size() + " resourcepacks"));
+ }
+ context.getSource().sendFeedback(of(" "));
+
+ return 1;
+ })
+ .then(literal("config")
+ .executes(context -> {
+ openConfig = true;
+
+ return 1;
+ })));
+ }
+}