.
This commit is contained in:
parent
bcce74a050
commit
9fd2752b3a
5 changed files with 113 additions and 3 deletions
|
|
@ -0,0 +1,26 @@
|
|||
package de.kentoj.kencommandapi;
|
||||
|
||||
import de.kentoj.kencommandapi.api.KenCommandApi;
|
||||
import de.kentoj.kencommandapi.api.processing.CommandContext;
|
||||
import de.kentoj.kencommandapi.api.structure.node.CommandNode;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class BukkitKenCommand extends Command {
|
||||
|
||||
private final CommandNode<CommandContext<CommandSender>> rootNode;
|
||||
private final KenCommandApi<CommandSender, CommandContext<CommandSender>> commandManager;
|
||||
|
||||
protected BukkitKenCommand(KenCommandApi<CommandSender, CommandContext<CommandSender>> commandManager, CommandNode<CommandContext<CommandSender>> rootNode) {
|
||||
super(rootNode.getNames()[0]);
|
||||
this.rootNode = rootNode;
|
||||
this.commandManager = commandManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(@NotNull CommandSender sender, @NotNull String commandLabel, @NotNull String[] args) {
|
||||
commandManager.invoke(rootNode, sender, args);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue