Class CommandRegistrationContext
- java.lang.Object
-
- ca.stellardrift.permissionsex.minecraft.command.CommandRegistrationContext
-
public final class CommandRegistrationContext extends Object
Context for executing command registrations
-
-
Constructor Summary
Constructors Constructor Description CommandRegistrationContext(String commandPrefix, MinecraftPermissionsEx<?> manager, cloud.commandframework.CommandManager<Commander> commandManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description cloud.commandframework.Command.Builder<Commander>absoluteBuilder(String primaryAlias, String... aliases)Create a new command builder at the root of the tree.cloud.commandframework.CommandManager<Commander>commandManager()StringcommandPrefix()ca.stellardrift.permissionsex.PermissionsEngineengine()cloud.commandframework.Command.Builder<Commander>head()Get the current command builder at the head of the command stack.MinecraftPermissionsEx<?>manager()voidpush(cloud.commandframework.Command.Builder<Commander> builder, Consumer<CommandRegistrationContext> handler)voidpush(Consumer<CommandRegistrationContext> handler, String primaryAlias, String... aliases)cloud.commandframework.Command<Commander>register(cloud.commandframework.Command.Builder<Commander> builder)Register a command with the manager.cloud.commandframework.Command<Commander>register(Function<cloud.commandframework.Command.Builder<Commander>,cloud.commandframework.Command.Builder<Commander>> maker, String primaryAlias, String... aliases)Simple helper to register a subcommand of the PEX base command.
-
-
-
Constructor Detail
-
CommandRegistrationContext
public CommandRegistrationContext(String commandPrefix, MinecraftPermissionsEx<?> manager, cloud.commandframework.CommandManager<Commander> commandManager)
-
-
Method Detail
-
engine
public ca.stellardrift.permissionsex.PermissionsEngine engine()
-
manager
public MinecraftPermissionsEx<?> manager()
-
commandPrefix
public String commandPrefix()
-
commandManager
public cloud.commandframework.CommandManager<Commander> commandManager()
-
head
public cloud.commandframework.Command.Builder<Commander> head()
Get the current command builder at the head of the command stack.- Returns:
- the head of the stack
-
push
public void push(cloud.commandframework.Command.Builder<Commander> builder, Consumer<CommandRegistrationContext> handler)
-
push
public void push(Consumer<CommandRegistrationContext> handler, String primaryAlias, String... aliases)
-
register
public cloud.commandframework.Command<Commander> register(Function<cloud.commandframework.Command.Builder<Commander>,cloud.commandframework.Command.Builder<Commander>> maker, String primaryAlias, String... aliases)
Simple helper to register a subcommand of the PEX base command.- Parameters:
maker- a function that will add arguments to the PEX base commandprimaryAlias- the primary alias for this subcommandaliases- any other aliases
-
register
public cloud.commandframework.Command<Commander> register(cloud.commandframework.Command.Builder<Commander> builder)
Register a command with the manager.- Parameters:
builder- the builder to register- Returns:
- the built command
-
absoluteBuilder
public cloud.commandframework.Command.Builder<Commander> absoluteBuilder(String primaryAlias, String... aliases)
Create a new command builder at the root of the tree.- Parameters:
primaryAlias- the primary command aliasaliases- the aliases so tadd- Returns:
- the builder
-
-