Add Support for Async Tab Completions for Paper Servers

This adds the ability for plugins to define completion handlers as async safe (not on games main thread)

When they are defined async safe, and ran on a Paper 1.12.2+ server, with a Paper ACF manager,
completions will be handled mostly async, letting you safely do heavier operations in tab completions.
This commit is contained in:
Aikar
2017-11-26 23:21:15 -05:00
parent 229192f99c
commit fbed6f2be3
31 changed files with 278 additions and 103 deletions
@@ -60,7 +60,7 @@ public final class ACFExample extends JavaPlugin {
SomeObject.getContextResolver());
// 4: Register Command Completions - this will be accessible with @CommandCompletion("@test")
commandManager.getCommandCompletions().registerCompletion("test", c -> (
commandManager.getCommandCompletions().registerAsyncCompletion("test", c -> (
Lists.newArrayList("foo", "bar", "baz")
));