Brigadier Mojang API

Adds AsyncPlayerSendCommandsEvent
  - Allows modifying on a per command basis what command data they see.

Adds CommandRegisteredEvent
  - Allows manipulating the CommandNode to add more children/metadata for the client
This commit is contained in:
Aikar
2020-04-19 18:15:29 -04:00
parent 41218728d9
commit 05f977e3d1
6 changed files with 189 additions and 95 deletions

View File

@@ -16,10 +16,11 @@
public abstract class CommandNode<S> implements Comparable<CommandNode<S>> {
private final Map<String, CommandNode<S>> children = new LinkedHashMap<>();
@@ -32,6 +34,13 @@
@@ -32,6 +34,14 @@
private final RedirectModifier<S> modifier;
private final boolean forks;
private Command<S> command;
+ public CommandNode<CommandSourceStack> clientNode; // Paper - Brigadier API
+ // CraftBukkit start
+ public void removeCommand(String name) {
+ this.children.remove(name);
@@ -30,7 +31,7 @@
protected CommandNode(final Command<S> command, final Predicate<S> requirement, final CommandNode<S> redirect, final RedirectModifier<S> modifier, final boolean forks) {
this.command = command;
@@ -61,7 +70,17 @@
@@ -61,7 +71,17 @@
return this.modifier;
}