File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/main/java/com/datasiqn/commandcore/managers Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,11 @@ public void registerCommand(@NotNull CommandBuilder command) {
31
31
if (name .contains (" " )) throw new IllegalArgumentException ("Command name cannot contain spaces" );
32
32
if (name .isEmpty ()) throw new IllegalArgumentException ("Command name cannot be empty" );
33
33
InitOptions options = CommandCore .getInstance ().getOptions ();
34
- options .warnIf (Warning .MISSING_DESCRIPTION , !builtCommand .hasDescription (), name );
35
- options .warnIf (Warning .MISSING_PERMISSION , !builtCommand .hasPermission (), name );
34
+ // the default help command doesn't have a permission, so suppress all warnings if the command is the default help command
35
+ if (!options .createHelpCommand () || !builtCommand .getName ().equals ("help" )) {
36
+ options .warnIf (Warning .MISSING_DESCRIPTION , !builtCommand .hasDescription (), name );
37
+ options .warnIf (Warning .MISSING_PERMISSION , !builtCommand .hasPermission (), name );
38
+ }
36
39
if (commandMap .putIfAbsent (name , builtCommand ) != null ) throw new IllegalArgumentException ("Command name already in use" );
37
40
for (String alias : builtCommand .getAliases ()) {
38
41
if (alias .contains (" " )) throw new IllegalArgumentException ("Command aliases cannot contain spaces" );
You can’t perform that action at this time.
0 commit comments