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