.
This commit is contained in:
parent
c2aec2842a
commit
5cec83b992
34 changed files with 269 additions and 58 deletions
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue