This commit is contained in:
kento2 2026-06-02 23:48:07 +02:00
parent c2aec2842a
commit 5cec83b992
34 changed files with 269 additions and 58 deletions

View file

@ -0,0 +1,23 @@
package de.kentoj.kencommandapi;
import com.velocitypowered.api.command.CommandSource;
import com.velocitypowered.api.command.SimpleCommand;
import de.kentoj.kencommandapi.api.nodes.CommandNode;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
public class VelocityCommand implements SimpleCommand {
private final VelocityKenCommandApi commandApi;
private final CommandNode<CommandSource, VelocityCommandContext> rootNode;
@Override
public void execute(Invocation ctx) {
commandApi.invoke(rootNode, ctx.source(), ctx.arguments());
}
@Override
public boolean hasPermission(Invocation ctx) {
return commandApi.hasPermission(ctx.source(), rootNode.getPermission());
}
}