Issue with suggestions
So I'm attempting to add suggestions to the commands like so
public class Commands {
public static void register(PluginCommand command, Commodore commodore) {
LiteralArgumentBuilder<Object> commandBuild = LiteralArgumentBuilder.literal("foo")
.then(
RequiredArgumentBuilder.argument("bar", StringArgumentType.string())
.suggests((context, builder) -> {
builder.suggest("bara");
builder.suggest("barb");
return builder.buildFuture();
})
);
commodore.register(command, commandBuild);
}
}
However when doing so, the only time a player is able to actually properly use the tab completion is when you reload the server while the players are online. If a player is to (re)join in, then it requires a reload in order for them to tab complete
This is likely due to the way Spigot/CB sends the command data, I'm not totally sure and need to look into it a bit more.
This may be fixed in version 1.3 - I've improved the way arguments are registered.
It looks like this is still an issue in version 1.3. Also occurs if you use JavaPlugin::onTabComplete from the Bukkit API (and in a similar fashion, reloading with players online seems to temporarily fix it). Just thought I'd share my findings.