clean up command parsing
This commit is contained in:
parent
c22f707556
commit
2c3307e59e
10 changed files with 89 additions and 183 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue