mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-01 22:16:08 +00:00
34 lines
1.0 KiB
Java
34 lines
1.0 KiB
Java
package me.william278.huskhomes2.commands;
|
|
|
|
import org.bukkit.command.Command;
|
|
import org.bukkit.command.CommandExecutor;
|
|
import org.bukkit.command.CommandSender;
|
|
import org.bukkit.command.PluginCommand;
|
|
import org.bukkit.command.TabCompleter;
|
|
|
|
import java.util.Collections;
|
|
import java.util.List;
|
|
import java.util.Objects;
|
|
|
|
public abstract class CommandBase implements CommandExecutor {
|
|
/**
|
|
* Register base for bukkit command
|
|
* @param command Command for registration
|
|
*/
|
|
public PluginCommand register(PluginCommand command) {
|
|
Objects.requireNonNull(command);
|
|
command.setExecutor(this);
|
|
if (this instanceof TabCompleter) {
|
|
command.setTabCompleter((TabCompleter) this);
|
|
}
|
|
return command;
|
|
}
|
|
|
|
public static class EmptyTab implements TabCompleter {
|
|
@Override
|
|
public List<String> onTabComplete(CommandSender commandSender, Command command, String s, String[] strings) {
|
|
return Collections.emptyList();
|
|
}
|
|
}
|
|
}
|