Skip to content

Commit 95c5085

Browse files
committed
Guard various commands to dev mode
1 parent 12aa683 commit 95c5085

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/main/java/dev/dfonline/codeclient/Commands.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import dev.dfonline.codeclient.action.impl.*;
66
import dev.dfonline.codeclient.actiondump.ActionDump;
77
import dev.dfonline.codeclient.config.Config;
8+
import dev.dfonline.codeclient.location.Dev;
89
import dev.dfonline.codeclient.websocket.SocketHandler;
910
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
1011
import net.minecraft.text.Text;
@@ -83,11 +84,13 @@ public static void register(CommandDispatcher<FabricClientCommandSource> dispatc
8384

8485

8586
dispatcher.register(literal("getspawn").executes(context -> {
87+
if(!(CodeClient.location instanceof Dev)) return 1;
8688
CodeClient.currentAction = new MoveToSpawn(() -> Utility.sendMessage("Done!", ChatType.SUCCESS));
8789
CodeClient.currentAction.init();
8890
return 0;
8991
}));
9092
dispatcher.register(literal("getsize").executes(context -> {
93+
if(!(CodeClient.location instanceof Dev)) return 1;
9194
CodeClient.currentAction = new GetPlotSize(() -> {
9295
CodeClient.currentAction = new None();
9396
Utility.sendMessage(Text.literal(CodeClient.worldPlot.name()));
@@ -107,6 +110,7 @@ public static void register(CommandDispatcher<FabricClientCommandSource> dispatc
107110
// }));
108111

109112
dispatcher.register(literal("codeforme").executes(context -> {
113+
if(!(CodeClient.location instanceof Dev)) return 1;
110114
CodeClient.currentAction = new ClearPlot(() -> {
111115
CodeClient.currentAction = new MoveToSpawn(() -> {
112116
CodeClient.currentAction = new PlaceTemplates(Utility.TemplatesInInventory(), () -> {

0 commit comments

Comments
 (0)