mirror of
https://github.com/aikar/commands.git
synced 2026-05-31 06:11:55 +00:00
Big Break: Change the Command Completion Handler signature to match Context
For consistency, make Completion Handlers be implemented the same way Context Handlers are. Previously when we added the Context parameter, we left the original signature in place and simply tacked , c on the end. This made migration easier than changing all completion handlers bodies. But since 0.5.0 is a big migration already, let's just get it over with. See changes to Bukkit default completions and the example plugin for migration example.
This commit is contained in:
@@ -42,7 +42,7 @@ public final class ACFExample extends JavaPlugin {
|
||||
commandManager.getCommandReplacements().addReplacements("test", "foobar", "%foo", "barbaz");
|
||||
commandManager.getCommandReplacements().addReplacement("testcmd", "test4|foobar|barbaz");
|
||||
commandManager.getCommandContexts().registerContext(SomeObject.class, SomeObject.getContextResolver());
|
||||
commandManager.getCommandCompletions().registerCompletion("test", (sender, config, input, c) -> (
|
||||
commandManager.getCommandCompletions().registerCompletion("test", c -> (
|
||||
Lists.newArrayList("foo", "bar", "baz")
|
||||
));
|
||||
commandManager.registerCommand(new SomeCommand());
|
||||
|
||||
Reference in New Issue
Block a user