55import xyz .bitsquidd .bits .lib .command .exceptions .ArgumentParseException ;
66import xyz .bitsquidd .bits .lib .command .requirements .CommandRequirement ;
77
8+ import java .util .ArrayList ;
89import java .util .List ;
910
1011// Sub-command paths.
@@ -27,11 +28,17 @@ public CommandPath(@NotNull String name, @NotNull String description, @NotNull L
2728
2829
2930 public boolean matchesPartial (CommandContext commandContext ) {
30- if (commandContext .getArgsLength () > getArgLength ()) {
31+ int argLength = commandContext .getArgLength ();
32+
33+ if (getArgLength () == 0 && argLength == 0 ) {
34+ return true ;
35+ }
36+
37+ if (argLength > getArgLength ()) {
3138 return false ;
3239 }
3340
34- for (int i = 0 ; i < commandContext . getArgsLength () ; i ++) {
41+ for (int i = 0 ; i < argLength ; i ++) {
3542 CommandArgumentInfo <?> commandArgumentInfo = getCommandParamAtIndex (i );
3643 if (!commandContext .getArg (i ).isEmpty () && !commandArgumentInfo .param .canParseArg (commandContext , i )) {
3744 return false ;
@@ -43,6 +50,10 @@ public boolean matchesPartial(CommandContext commandContext) {
4350 public boolean matchesFully (CommandContext commandContext ) {
4451 int argLength = commandContext .getArgLength ();
4552
53+ if (getArgLength () == 0 && argLength == 0 ) {
54+ return true ;
55+ }
56+
4657 if (argLength != getArgLength ()) {
4758 return false ;
4859 }
@@ -109,7 +120,11 @@ public boolean execute(CommandContext commandContext) {
109120
110121 public List <String > tabComplete (@ NotNull CommandContext commandContext ) {
111122 CommandArgumentInfo <?> commandArgumentInfo = getCommandParamAtIndex (commandContext .getArgLength ()-1 );
112- return commandArgumentInfo .param .tabComplete (commandContext , getCommandParamIndex (commandArgumentInfo ));
123+
124+ ArrayList <String > availableCompletions = new ArrayList <>(commandArgumentInfo .param .getAddedTabCompletions ());
125+ availableCompletions .addAll (commandArgumentInfo .param .tabComplete (commandContext , getCommandParamIndex (commandArgumentInfo )));
126+
127+ return availableCompletions ;
113128 }
114129
115130 public boolean hasPermissions (CommandContext commandContext ) {
0 commit comments