Package revxrsal.commands.help
Interface CommandHelpWriter<T>
- Type Parameters:
T
- The command help entry type. If we want to merely use strings as what is generated for each command, this would be aString
.Similarly, more complex types, such as chat components, can have this type as the appropriate chat component type.
public interface CommandHelpWriter<T>
A writer for generating entries for help commands.
-
Method Summary
Modifier and TypeMethodDescriptiongenerate
(@NotNull ExecutableCommand command, @NotNull CommandActor actor) Generates a command help entry for the specified commanddefault CommandHelpWriter<T>
ignore
(@NotNull Predicate<ExecutableCommand> predicate) Ignores any command that matches the specified predicatedefault CommandHelpWriter<T>
only
(@NotNull Predicate<ExecutableCommand> predicate) Writes commands that only matches the specified predicate
-
Method Details
-
generate
@Nullable T generate(@NotNull @NotNull ExecutableCommand command, @NotNull @NotNull CommandActor actor) Generates a command help entry for the specified command- Parameters:
command
- Command to generate for. It is generally advisable to do permission checks as well as other filters such asExecutableCommand.isSecret()
.actor
- Actor to generate for- Returns:
- The generated help entry. If null, this entry will not appear on the generated help list.
-
ignore
Ignores any command that matches the specified predicate- Parameters:
predicate
- Predicate to test for- Returns:
- The command help writer that filters according to that predicate.
-
only
Writes commands that only matches the specified predicate- Parameters:
predicate
- Predicate to test for- Returns:
- The command help writer that only allows elements that match the predicate.
-