@@ -41,8 +41,8 @@ public class CommandPathMeta {
4141 // ignore binds
4242 private final Map <Integer , Annotation []> argAnnotations ;
4343 private final Map <Integer , Class <?>> argClasses ;
44- private final Map <Integer , CommandArgument > argNames ;
45- private final Map <Integer , CommandArgument > argDisplayNames ;
44+ private final Map <Integer , ArgumentEntry > argNames ;
45+ private final Map <Integer , ArgumentEntry > argDisplayNames ;
4646
4747 // all parameters
4848 private final Map <Integer , Annotation []> paramAnnotations ;
@@ -89,8 +89,8 @@ public CommandPathMeta(@NonNull CommandMeta commandMeta, @NonNull Method method,
8989 final String name = Objects .equals (arg .value (), "" ) ? parameter .getName () : arg .value ();
9090
9191 this .argClasses .put (atomicNameIndex .get (), parameter .getType ());
92- this .argNames .put (atomicNameIndex .get (), new CommandArgument ( CommandArgument .Type .ARG , name ));
93- this .argDisplayNames .put (atomicNameIndex .getAndIncrement (), new CommandArgument ( CommandArgument .Type .ARG , "<" + name + ">" ));
92+ this .argNames .put (atomicNameIndex .get (), new ArgumentEntry ( ArgumentEntry .Type .ARG , name ));
93+ this .argDisplayNames .put (atomicNameIndex .getAndIncrement (), new ArgumentEntry ( ArgumentEntry .Type .ARG , "<" + name + ">" ));
9494
9595 continue ;
9696 }
@@ -104,8 +104,8 @@ public CommandPathMeta(@NonNull CommandMeta commandMeta, @NonNull Method method,
104104 final String name = Objects .equals (args .value (), "" ) ? parameter .getName () : args .value ();
105105
106106 this .argClasses .put (atomicNameIndex .get (), parameter .getType ());
107- this .argNames .put (atomicNameIndex .get (), new CommandArgument ( CommandArgument .Type .ARGS , name ));
108- this .argDisplayNames .put (atomicNameIndex .getAndIncrement (), new CommandArgument ( CommandArgument .Type .ARGS , "(" + name + ")" ));
107+ this .argNames .put (atomicNameIndex .get (), new ArgumentEntry ( ArgumentEntry .Type .ARGS , name ));
108+ this .argDisplayNames .put (atomicNameIndex .getAndIncrement (), new ArgumentEntry ( ArgumentEntry .Type .ARGS , "(" + name + ")" ));
109109
110110 continue ;
111111 }
@@ -131,8 +131,8 @@ public CommandPathMeta(@NonNull CommandMeta commandMeta, @NonNull Method method,
131131 }
132132
133133 this .argClasses .put (atomicNameIndex .get (), rawType );
134- this .argNames .put (atomicNameIndex .get (), new CommandArgument ( CommandArgument .Type .OPTIONAL_ARG , name ));
135- this .argDisplayNames .put (atomicNameIndex .getAndIncrement (), new CommandArgument ( CommandArgument .Type .OPTIONAL_ARG , "[" + name + "]" ));
134+ this .argNames .put (atomicNameIndex .get (), new ArgumentEntry ( ArgumentEntry .Type .OPTIONAL_ARG , name ));
135+ this .argDisplayNames .put (atomicNameIndex .getAndIncrement (), new ArgumentEntry ( ArgumentEntry .Type .OPTIONAL_ARG , "[" + name + "]" ));
136136 }
137137 }
138138
@@ -240,15 +240,15 @@ public List<DreamSender.Type> getSendersType() {
240240 public String getUsage () {
241241
242242 final List <String > listBuilder = new ArrayList <>();
243- listBuilder .add ("/" + this .commandMeta .getCommandContext ().getName ());
243+ listBuilder .add ("/" + this .commandMeta .getCommandEntry ().getName ());
244244
245245 if (!this .path .isEmpty ()) {
246246 listBuilder .addAll (Arrays .asList (this .path .split (" " )));
247247 }
248248
249249 this .argDisplayNames .values ()
250250 .stream ()
251- .map (CommandArgument ::getValue )
251+ .map (ArgumentEntry ::getValue )
252252 .forEach (listBuilder ::add );
253253
254254 return StringUtil .join (listBuilder , " " );
@@ -308,15 +308,15 @@ public List<String> getSuggestion(@NonNull SuggestionService suggestionService,
308308 return listBuilder .build ();
309309 }
310310
311- final CommandArgument commandArgument = this .argNames .get (argumentParamLength );
311+ final ArgumentEntry argumentEntry = this .argNames .get (argumentParamLength );
312312 final Optional <Completion > optionalCompletion = Arrays .stream (this .method .getAnnotationsByType (Completion .class ))
313- .filter (completion -> Objects .equals (completion .arg (), commandArgument .getValue ()))
313+ .filter (completion -> Objects .equals (completion .arg (), argumentEntry .getValue ()))
314314 .findAny ();
315315
316316 if (!optionalCompletion .isPresent ()) {
317- final CommandArgument commandDisplayArgument = this .argDisplayNames .get (argumentParamLength );
317+ final ArgumentEntry commandDisplayArgument = this .argDisplayNames .get (argumentParamLength );
318318
319- if (!commandDisplayArgument .getType ().equals (CommandArgument .Type .ARGS )) {
319+ if (!commandDisplayArgument .getType ().equals (ArgumentEntry .Type .ARGS )) {
320320 listBuilder .add (commandDisplayArgument .getValue ());
321321 }
322322
0 commit comments