File tree 1 file changed +7
-6
lines changed
cloud-minecraft/cloud-paper/src/main/java/cloud/commandframework/paper/argument 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -219,13 +219,14 @@ public Parser() {
219
219
return this .parser .suggestions (commandContext , input );
220
220
}
221
221
222
- final List <String > completions = new ArrayList <> ();
223
- for ( final World world : Bukkit . getWorlds ()) {
224
- if ( world . getKey (). getNamespace (). equals ( NamespacedKey . MINECRAFT ) ) {
225
- completions . add ( world .getKey (). getKey () );
226
- } else {
227
- completions .add (world .getKey (). toString ());
222
+ final List <World > worlds = Bukkit . getWorlds ();
223
+ final List < String > completions = new ArrayList <>( worlds . size () * 2 );
224
+ for ( final World world : worlds ) {
225
+ final NamespacedKey key = world .getKey ();
226
+ if (! input . isEmpty () && key . getNamespace (). equals ( NamespacedKey . MINECRAFT_NAMESPACE )) {
227
+ completions .add (key .getKey ());
228
228
}
229
+ completions .add (key .getNamespace () + ':' + key .getKey ());
229
230
}
230
231
return completions ;
231
232
}
You can’t perform that action at this time.
0 commit comments