diff --git a/gradle.properties b/gradle.properties index 7976fd7..df371fd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx2G # Mod Properties -mod_version = 0.0.41 +mod_version = 0.0.42 maven_group = dev.ithundxr archives_base_name = RailwaysTweaks diff --git a/src/main/java/dev/ithundxr/railwaystweaks/commands/RailwaysTweaksCommands.java b/src/main/java/dev/ithundxr/railwaystweaks/commands/RailwaysTweaksCommands.java index 9c3f823..6eaf0cb 100644 --- a/src/main/java/dev/ithundxr/railwaystweaks/commands/RailwaysTweaksCommands.java +++ b/src/main/java/dev/ithundxr/railwaystweaks/commands/RailwaysTweaksCommands.java @@ -8,7 +8,9 @@ import dev.ithundxr.railwaystweaks.mixin.compat.tconstruct.SimpleChannelAccessor; import me.pepperbell.simplenetworking.C2SPacket; import me.pepperbell.simplenetworking.S2CPacket; +import net.fabricmc.api.EnvType; import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; +import net.fabricmc.loader.api.FabricLoader; import net.minecraft.Util; import net.minecraft.commands.CommandSourceStack; import net.minecraft.network.chat.Component; @@ -39,15 +41,17 @@ public static void init() { .executes(ctx -> avgMSPT(ctx.getSource()))); }); - CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> { - dispatcher.register(literal("railwaystweaks") - .then(literal("dump_db") - .requires(cs -> cs.hasPermission(4)) - .executes(ctx -> { - Util.ioPool().execute(DumpDatabase::dump); - return 0; - }))); - }); + if (FabricLoader.getInstance().getEnvironmentType() == EnvType.SERVER) { + CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> { + dispatcher.register(literal("railwaystweaks") + .then(literal("dump_db") + .requires(cs -> cs.hasPermission(4)) + .executes(ctx -> { + Util.ioPool().execute(DumpDatabase::dump); + return 0; + }))); + }); + } } private static ArgumentBuilder $dump_hephaestus_packets() {