KenCommandAPI/kencommandapi-velocity/src/main/java/de/kentoj/kencommandapi/VelocityCommand.java
2026-06-02 23:48:07 +02:00

23 lines
735 B
Java

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());
}
}