This commit is contained in:
kento2 2026-04-16 10:44:45 +02:00
parent bcce74a050
commit 9fd2752b3a
5 changed files with 113 additions and 3 deletions

View file

@ -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;
}
}