Package one.tranic.t.base.command.simple
Interface SimpleCommandImpl<C extends CommandSource<?,?>>
- Type Parameters:
C- the type of the source implementingCommandSource, representing the context in which the command is executed
- All Known Implementing Classes:
SimpleCommand
public interface SimpleCommandImpl<C extends CommandSource<?,?>>
Represents a command implementation designed to be executed by or for a specific source type.
Commands implementing this interface can be executed, provide suggestions for input, and verify permissions based on the context of the source.
-
Method Summary
Modifier and TypeMethodDescriptionvoidExecutes the command for the provided source.booleanhasPermission(C source) Checks if the given source has the required permissions to execute a command or perform an action.Provides a list of suggestions based on the given source context.
-
Method Details
-
execute
Executes the command for the provided source.- Parameters:
source- the source context in which the command is executed, must not be null
-
suggest
Provides a list of suggestions based on the given source context.The suggestions are typically utilized for auto-completion or assistance purposes while interacting with commands associated with a specific source type.
- Parameters:
source- the context of the source from which the suggestions are generated; must implementSimpleCommandImpl- Returns:
- a list of suggested strings, or an empty list if no suggestions are available
-
hasPermission
Checks if the given source has the required permissions to execute a command or perform an action.- Parameters:
source- the contextual source for which the permission check is being performed- Returns:
- true if the source has the appropriate permissions, otherwise false
-