]> git.lizzy.rs Git - BoundingBoxOutlineReloaded.git/blob - src/main/java/com/irtimaled/bbor/client/commands/StructuresCommand.java
Setup for 1.14.4-Fabric
[BoundingBoxOutlineReloaded.git] / src / main / java / com / irtimaled / bbor / client / commands / StructuresCommand.java
1 package com.irtimaled.bbor.client.commands;
2
3 import com.irtimaled.bbor.client.gui.LoadSavesScreen;
4 import com.irtimaled.bbor.client.interop.ClientInterop;
5 import com.mojang.brigadier.CommandDispatcher;
6 import com.mojang.brigadier.builder.LiteralArgumentBuilder;
7 import net.minecraft.server.command.CommandManager;
8 import net.minecraft.server.command.CommandSource;
9
10 public class StructuresCommand {
11     private static final String COMMAND = "bbor:structures";
12     private static final String LOAD = "load";
13
14     public static void register(CommandDispatcher<CommandSource> commandDispatcher) {
15         LiteralArgumentBuilder command = CommandManager.literal(COMMAND)
16                 .then(CommandManager.literal(LOAD)
17                         .executes(context -> {
18                             LoadSavesScreen.show();
19                             return 0;
20                         }))
21                 .then(CommandManager.literal(ArgumentNames.CLEAR)
22                         .executes(context -> {
23                             ClientInterop.clearStructures();
24                             return 0;
25                         }));
26
27         commandDispatcher.register(command);
28     }
29 }