clean up command parsing
Some checks failed
/ test (push) Successful in 1m10s
/ deploy (push) Failing after 56s

This commit is contained in:
kento2 2026-08-30 12:10:14 +02:00
parent c22f707556
commit 2c3307e59e
10 changed files with 89 additions and 183 deletions

View file

@ -12,10 +12,10 @@ public class VelocityCommand<C extends VelocityCommandContext<C>> implements Raw
private final CommandHandler<C> commandHandler;
private final CommandContextFactory<C> commandContextFactory;
private final PlatformAdapter platformAdapter;
private final PlatformAdapter<C> platformAdapter;
private final RootLiteral<C> rootLiteral;
public VelocityCommand(CommandHandler<C> commandHandler, CommandContextFactory<C> commandContextFactory, PlatformAdapter platformAdapter, RootLiteral<C> rootLiteral) {
public VelocityCommand(CommandHandler<C> commandHandler, CommandContextFactory<C> commandContextFactory, PlatformAdapter<C> platformAdapter, RootLiteral<C> rootLiteral) {
this.commandHandler = commandHandler;
this.commandContextFactory = commandContextFactory;
this.platformAdapter = platformAdapter;
@ -32,7 +32,7 @@ public class VelocityCommand<C extends VelocityCommandContext<C>> implements Raw
@Override
public boolean hasPermission(Invocation ctx) {
return platformAdapter.checkPermission(ctx, rootLiteral.permission());
return platformAdapter.checkPermission(commandContextFactory.createContext(rootLiteral, ctx.source()), rootLiteral.permission());
}
@Override