mirror of
https://github.com/aikar/commands.git
synced 2026-06-01 06:41:56 +00:00
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:
@@ -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")
|
||||
));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user