]> git.lizzy.rs Git - BoundingBoxOutlineReloaded.git/blob - src/main/java/com/irtimaled/bbor/client/commands/CustomCommand.java
184a860ffae10659f718a090726a69472a99702e
[BoundingBoxOutlineReloaded.git] / src / main / java / com / irtimaled / bbor / client / commands / CustomCommand.java
1 package com.irtimaled.bbor.client.commands;
2
3 import com.irtimaled.bbor.client.providers.CustomBeaconProvider;
4 import com.irtimaled.bbor.client.providers.CustomBoxProvider;
5 import com.mojang.brigadier.CommandDispatcher;
6 import com.mojang.brigadier.builder.LiteralArgumentBuilder;
7 import net.minecraft.command.Commands;
8 import net.minecraft.command.ISuggestionProvider;
9
10 public class CustomCommand {
11     private static final String COMMAND = "bbor:custom";
12     private static final String BOX = "box";
13     private static final String BEACON = "beacon";
14
15     public static void register(CommandDispatcher<ISuggestionProvider> commandDispatcher) {
16         LiteralArgumentBuilder command = Commands.literal(COMMAND)
17                 .then(BoxCommandBuilder.build(BOX))
18                 .then(BeaconCommandBuilder.build(BEACON))
19                 .then(Commands.literal(ArgumentNames.CLEAR)
20                         .executes(context -> {
21                             CustomBoxProvider.clear();
22                             CustomBeaconProvider.clear();
23
24                             CommandHelper.feedback(context, "bbor.commands.custom.cleared.all");
25                             return 0;
26                         }));
27         commandDispatcher.register(command);
28     }
29 }
30