public class CommandManager extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
CommandManager.CommandParser |
static class |
CommandManager.RegistrationEnvironment
Describes the environment in which commands are registered.
|
Modifier and Type | Field and Description |
---|---|
private com.mojang.brigadier.CommandDispatcher<ServerCommandSource> |
dispatcher |
private static Logger |
LOGGER |
Constructor and Description |
---|
CommandManager(CommandManager.RegistrationEnvironment environment) |
Modifier and Type | Method and Description |
---|---|
static <T> com.mojang.brigadier.builder.RequiredArgumentBuilder<ServerCommandSource,T> |
argument(String name,
com.mojang.brigadier.arguments.ArgumentType<T> type) |
static void |
checkMissing() |
int |
execute(ServerCommandSource commandSource,
String command) |
static Predicate<String> |
getCommandValidator(CommandManager.CommandParser parser) |
com.mojang.brigadier.CommandDispatcher<ServerCommandSource> |
getDispatcher() |
static <S> com.mojang.brigadier.exceptions.CommandSyntaxException |
getException(com.mojang.brigadier.ParseResults<S> parse) |
static com.mojang.brigadier.builder.LiteralArgumentBuilder<ServerCommandSource> |
literal(String literal) |
private void |
makeTreeForSource(com.mojang.brigadier.tree.CommandNode<ServerCommandSource> tree,
com.mojang.brigadier.tree.CommandNode<CommandSource> result,
ServerCommandSource source,
Map<com.mojang.brigadier.tree.CommandNode<ServerCommandSource>,com.mojang.brigadier.tree.CommandNode<CommandSource>> resultNodes) |
void |
sendCommandTree(ServerPlayerEntity player) |
private static final Logger LOGGER
private final com.mojang.brigadier.CommandDispatcher<ServerCommandSource> dispatcher
public CommandManager(CommandManager.RegistrationEnvironment environment)
public int execute(ServerCommandSource commandSource, String command)
public void sendCommandTree(ServerPlayerEntity player)
private void makeTreeForSource(com.mojang.brigadier.tree.CommandNode<ServerCommandSource> tree, com.mojang.brigadier.tree.CommandNode<CommandSource> result, ServerCommandSource source, Map<com.mojang.brigadier.tree.CommandNode<ServerCommandSource>,com.mojang.brigadier.tree.CommandNode<CommandSource>> resultNodes)
public static com.mojang.brigadier.builder.LiteralArgumentBuilder<ServerCommandSource> literal(String literal)
public static <T> com.mojang.brigadier.builder.RequiredArgumentBuilder<ServerCommandSource,T> argument(String name, com.mojang.brigadier.arguments.ArgumentType<T> type)
public static Predicate<String> getCommandValidator(CommandManager.CommandParser parser)
public com.mojang.brigadier.CommandDispatcher<ServerCommandSource> getDispatcher()
@Nullable public static <S> com.mojang.brigadier.exceptions.CommandSyntaxException getException(com.mojang.brigadier.ParseResults<S> parse)
public static void checkMissing()