// This claas was created by JaTiTV package net.t2code.automatedMessages.command; import net.t2code.automatedMessages.Util; import net.t2code.t2codelib.SPIGOT.api.commands.T2Ctab; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.command.TabCompleter; import java.util.ArrayList; import java.util.HashMap; import java.util.List; public class CmdExecuter implements CommandExecutor, TabCompleter { @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (!sender.hasPermission("t2c.automatedmessages.admin")) { sender.sendMessage(Util.getPrefix() + "§cYou do not have permission for OPSecurity! §7"); return false; } if (args.length == 0) { Commands.reload(sender); } else { switch (args[0].toLowerCase()) { case "reload": case "rl": Commands.reload(sender); break; case "info": case "plugin": case "pl": case "version": case "ver": Commands.info(sender); break; } } return false; } private static HashMap arg1 = new HashMap() {{ put("reload", "t2c.automatedmessages.admin"); put("info", "t2c.automatedmessages.admin"); }}; @Override public List onTabComplete(CommandSender sender, Command cmd, String s, String[] args) { List list = new ArrayList<>(); T2Ctab.tab(list,sender,0,args,arg1); return list; } }