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.irtimaled.bbor.client.providers.CustomSphereProvider;
7 import com.mojang.brigadier.CommandDispatcher;
8 import com.mojang.brigadier.builder.LiteralArgumentBuilder;
9 import net.minecraft.server.command.CommandManager;
10 import net.minecraft.server.command.CommandSource;
12 public class CustomCommand {
13 private static final String COMMAND = "bbor:custom";
14 private static final String BOX = "box";
15 private static final String BEACON = "beacon";
16 private static final String LINE = "line";
17 private static final String SPHERE = "sphere";
19 public static void register(CommandDispatcher<CommandSource> commandDispatcher) {
20 LiteralArgumentBuilder command = CommandManager.literal(COMMAND)
21 .then(BoxCommandBuilder.build(BOX))
22 .then(BeaconCommandBuilder.build(BEACON))
23 .then(LineCommandBuilder.build(LINE))
24 .then(SphereCommandBuilder.build(SPHERE))
25 .then(CommandManager.literal(ArgumentNames.CLEAR)
26 .executes(context -> {
27 CustomBoxProvider.clear();
28 CustomBeaconProvider.clear();
29 CustomLineProvider.clear();
30 CustomSphereProvider.clear();
32 CommandHelper.feedback(context, "bbor.commands.custom.cleared.all");
35 commandDispatcher.register(command);