Interface Commands
public interface Commands
Interface for managing commands
-
Method Summary
Modifier and TypeMethodDescriptionio.github.jwdeveloper.spigot.commands.api.argumetns.ArgumentTypesArgument types registry object, modify of create new commands argumentsio.github.jwdeveloper.spigot.commands.api.builder.CommandBuilderCreates a new command builder for a command using the specified template object.io.github.jwdeveloper.spigot.commands.api.builder.CommandBuilderCreates a new command builder for a command with the specified pattern.findAll()Finds and returns all commands managed by the command manager.java.util.stream.Stream<Command>Finds and returns commands that match the specified predicate.findByName(String commandName) Finds and returns a command with the specified name.io.github.jwdeveloper.spigot.commands.api.services.EventsServiceGlobal event handler for the commands eventsio.github.jwdeveloper.spigot.commands.api.patterns.Patternspatterns()voidAdds the specified command to the command manager.voidRemoves all commands from the command manager.voidunregister(Command command) Removes the specified command from the command manager.
-
Method Details
-
globalEvents
io.github.jwdeveloper.spigot.commands.api.services.EventsService globalEvents()Global event handler for the commands events- Returns:
- eventHandler
-
patterns
io.github.jwdeveloper.spigot.commands.api.patterns.Patterns patterns() -
argumentTypes
io.github.jwdeveloper.spigot.commands.api.argumetns.ArgumentTypes argumentTypes()Argument types registry object, modify of create new commands arguments- Returns:
- a new instance of
ArgumentTypes.
-
create
Creates a new command builder for a command with the specified pattern.- Parameters:
pattern- the pattern for the command.- Returns:
- a new instance of
CommandBuilder.
-
create
Creates a new command builder for a command using the specified template object.- Parameters:
templateObject- the template object for the command.- Returns:
- a new instance of
CommandBuilder.
-
register
Adds the specified command to the command manager.- Parameters:
command- the command to be added.
-
unregister
Removes the specified command from the command manager.- Parameters:
command- the command to be removed.
-
removeAll
void removeAll()Removes all commands from the command manager. -
findAll
Finds and returns all commands managed by the command manager.- Returns:
- a list of all commands.
-
findBy
Finds and returns commands that match the specified predicate.- Parameters:
predicate- the predicate to filter commands.- Returns:
- a stream of commands that match the predicate.
-
findByName
Finds and returns a command with the specified name.- Parameters:
commandName- the name of the command.- Returns:
- an optional containing the command if found, or empty if not found.
-