1 package com.irtimaled.bbor.client.commands;
3 import com.irtimaled.bbor.client.providers.CustomBeaconProvider;
4 import com.irtimaled.bbor.client.providers.CustomBoxProvider;
5 import com.irtimaled.bbor.client.providers.CustomLineProvider;
6 import com.mojang.brigadier.CommandDispatcher;
7 import com.mojang.brigadier.builder.LiteralArgumentBuilder;
8 import net.minecraft.command.Commands;
9 import net.minecraft.command.ISuggestionProvider;
11 public class CustomCommand {
12 private static final String COMMAND = "bbor:custom";
13 private static final String BOX = "box";
14 private static final String BEACON = "beacon";
15 private static final String LINE = "line";
17 public static void register(CommandDispatcher<ISuggestionProvider> commandDispatcher) {
18 LiteralArgumentBuilder command = Commands.literal(COMMAND)
19 .then(BoxCommandBuilder.build(BOX))
20 .then(BeaconCommandBuilder.build(BEACON))
21 .then(LineCommandBuilder.build(LINE))
22 .then(Commands.literal(ArgumentNames.CLEAR)
23 .executes(context -> {
24 CustomBoxProvider.clear();
25 CustomBeaconProvider.clear();
26 CustomLineProvider.clear();
28 CommandHelper.feedback(context, "bbor.commands.custom.cleared.all");
31 commandDispatcher.register(command);