mirror of
https://github.com/aikar/commands.git
synced 2026-06-01 23:02:18 +00:00
Almost done with modular work
This commit is contained in:
@@ -24,14 +24,13 @@
|
||||
package co.aikar.acfexample;
|
||||
|
||||
import co.aikar.commands.BukkitCommandManager;
|
||||
import co.aikar.commands.CommandManager;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public final class ACFExample extends JavaPlugin {
|
||||
|
||||
private static ACFExample plugin;
|
||||
private static CommandManager commandManager;
|
||||
private static BukkitCommandManager commandManager;
|
||||
@Override
|
||||
public void onEnable() {
|
||||
plugin = this;
|
||||
@@ -54,7 +53,7 @@ public final class ACFExample extends JavaPlugin {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
public static CommandManager getCommandManager() {
|
||||
public static BukkitCommandManager getCommandManager() {
|
||||
return commandManager;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,14 +27,14 @@ import co.aikar.commands.BaseCommand;
|
||||
import co.aikar.commands.annotation.CommandAlias;
|
||||
import co.aikar.commands.annotation.CommandCompletion;
|
||||
import co.aikar.commands.annotation.Subcommand;
|
||||
import org.bukkit.command.CommandIssuer;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
@CommandAlias("acf")
|
||||
public class SomeCommand_ExtraSubs extends BaseCommand {
|
||||
|
||||
@Subcommand("testsub test2")
|
||||
@CommandCompletion("Foo2")
|
||||
public void onTestSub2(CommandIssuer sender, String hi) {
|
||||
public void onTestSub2(CommandSender sender, String hi) {
|
||||
sender.sendMessage(hi);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
package co.aikar.acfexample;
|
||||
|
||||
import co.aikar.commands.BukkitCommandExecutionContext;
|
||||
import co.aikar.commands.InvalidCommandArgument;
|
||||
import co.aikar.commands.contexts.ContextResolver;
|
||||
|
||||
@@ -37,7 +38,7 @@ public abstract class SomeObject {
|
||||
return this.thisValue;
|
||||
}
|
||||
|
||||
public static ContextResolver<SomeObject> getContextResolver() {
|
||||
public static ContextResolver<SomeObject, BukkitCommandExecutionContext> getContextResolver() {
|
||||
return (c) -> {
|
||||
String first = c.popFirstArg();
|
||||
if (first == null) {
|
||||
|
||||
Reference in New Issue
Block a user