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 onTabComplete(CommandSender commandSender, Command command, String s, String[] strings) { return Collections.emptyList(); } } }