drink
drink copied to clipboard
Add option to disable tab completion for specific commands
This pull allows users to utilize the @HideCommand annotation.
When this annotation is applied to a DrinkCommand method, it will be removed from tab completion,
and will not be displayed when doing /
For example, when we want to hide a reload command, it would look like this:
package net.pinger.hynick.commands;
import com.jonahseguin.drink.annotation.Command;
import com.jonahseguin.drink.annotation.HideCommand;
import com.jonahseguin.drink.annotation.Require;
import com.jonahseguin.drink.annotation.Sender;
import net.pinger.hynick.SpigotHynickPlugin;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
public class ReloadCommand {
private final SpigotHynickPlugin plugin;
public ReloadCommand(SpigotHynickPlugin plugin) {
this.plugin = plugin;
}
@Command(name = "reload", usage = "reload", desc = "Reload configuration files of this plugin")
@Require("hynick.reload")
@HideCommand
public void reload(@Sender CommandSender sender) {
this.plugin.getFeatureManager().reload();
sender.sendMessage(ChatColor.AQUA + "[Hynick] Reloaded configuration files.");
}
}