Use generics for sub commands, fix user lookup bugs

This commit is contained in:
Luck committed 2016-08-03 00:54:50 +02:00
1 parent 98c5a91beb
commit 5e23b6961e
60 files changed
+570 -794

No files matched your search

@@ -0,0 +1,36 @@
package me.lucko.luckperms.commands;
import me.lucko.luckperms.LuckPermsPlugin;
import me.lucko.luckperms.api.data.Callback;
import java.util.Collections;
import java.util.List;
/**
* An extension of {@link MainCommand} for implementations without any subcommands
*/
public class SingleMainCommand extends MainCommand<Object> {
public SingleMainCommand(String name, String usage, int requiredArgsLength) {
super(name, usage, requiredArgsLength);
}
@Override
protected void getTarget(String target, LuckPermsPlugin plugin, Sender sender, Callback onSuccess) {
}
@Override
protected List<String> getObjects(LuckPermsPlugin plugin) {
return Collections.emptyList();
}
@Override
protected List<String> onTabComplete(Sender sender, List<String> args, LuckPermsPlugin plugin) {
return Collections.emptyList();
}
@Override
public List<SubCommand<Object>> getSubCommands() {
return Collections.emptyList();
}
}