use of net.md_5.bungee.api.CommandSender in project FireAPI by FireBlade-Serv.
the class Discord method execute.
@Override
public void execute(CommandSender sender, String[] args) {
TextComponent comp = new TextComponent("§aCliquez ICI");
comp.setClickEvent(new ClickEvent(Action.OPEN_URL, "https://discordapp.com/invite/H7acUcX"));
comp.setHoverEvent(new HoverEvent(net.md_5.bungee.api.chat.HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("Cliquez ici pour acceder au discord !").color(ChatColor.GREEN).create()));
TextComponent base = new TextComponent("§b[Discord] ");
base.addExtra(comp);
sender.sendMessage(base);
}
use of net.md_5.bungee.api.CommandSender in project FireAPI by FireBlade-Serv.
the class Website method execute.
@Override
public void execute(CommandSender sender, String[] args) {
TextComponent comp = new TextComponent("§aCliquez ICI");
comp.setClickEvent(new ClickEvent(Action.OPEN_URL, "http://www.fireblade-serv.eu/"));
comp.setHoverEvent(new HoverEvent(net.md_5.bungee.api.chat.HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("Cliquez ici pour acceder au site internet !").color(ChatColor.GREEN).create()));
TextComponent base = new TextComponent("§c[Site] ");
base.addExtra(comp);
sender.sendMessage(base);
}
use of net.md_5.bungee.api.CommandSender in project LuckPerms by lucko.
the class BungeeCommandExecutor method onTabComplete.
@Override
public Iterable<String> onTabComplete(CommandSender sender, String[] args) {
Sender lpSender = this.plugin.getSenderFactory().wrap(sender);
List<String> arguments = CommandManager.stripQuotes(TAB_COMPLETE_ARGUMENT_SPLITTER.splitToList(ARGUMENT_JOINER.join(args)));
return this.manager.onTabComplete(lpSender, arguments);
}
use of net.md_5.bungee.api.CommandSender in project ChangeSkin by games647.
the class SetCommand method execute.
@Override
public void execute(CommandSender sender, String[] args) {
boolean isOp = sender.getGroups().contains(plugin.getName() + "-OP");
if (sender instanceof ProxiedPlayer) {
sender.removeGroups(plugin.getName() + "-OP");
if (plugin.getCore().getCooldownService().isTracked(((ProxiedPlayer) sender).getUniqueId())) {
plugin.sendMessage(sender, "cooldown");
return;
}
}
if (args.length > 0 && "set".equalsIgnoreCase(args[0])) {
args = Arrays.copyOfRange(args, 1, args.length);
}
if (args.length > 1) {
if (!sender.hasPermission(plugin.getName().toLowerCase() + ".command.setskin.other") && !sender.hasPermission(plugin.getName().toLowerCase() + ".command.setskin.*")) {
plugin.sendMessage(sender, "no-permission-other");
return;
}
String targetPlayerName = args[0];
String toSkin = args[1];
ProxiedPlayer targetPlayer = ProxyServer.getInstance().getPlayer(targetPlayerName);
if (targetPlayer == null) {
plugin.sendMessage(sender, "not-online");
} else {
setSkin(sender, targetPlayer, toSkin, isOp, isKeepSkin(args));
}
} else if (sender instanceof ProxiedPlayer) {
if (args.length == 1) {
if ("reset".equalsIgnoreCase(args[0])) {
onReset(sender, isOp);
return;
}
setSkin(sender, (ProxiedPlayer) sender, args[0], isOp, isKeepSkin(args));
} else {
plugin.sendMessage(sender, "no-skin");
}
} else {
plugin.sendMessage(sender, "no-console");
}
}
use of net.md_5.bungee.api.CommandSender in project DiscordBot by LXGaming.
the class DiscordBotCommand method execute.
@Override
public void execute(CommandSender sender, String[] args) {
if (args.length == 0) {
sender.sendMessage(new ComponentBuilder("===== ").color(ChatColor.GOLD).append("DiscordBot - Bungeecord Edition").color(ChatColor.GREEN).append(" =====").color(ChatColor.GOLD).create());
sender.sendMessage(new ComponentBuilder("Version - ").color(ChatColor.GOLD).append(DiscordBotCore.getInstance().getConfiguration().getDiscordBotVersion()).color(ChatColor.AQUA).create());
sender.sendMessage(new ComponentBuilder("JDA - ").color(ChatColor.GOLD).append(DiscordBotCore.getInstance().getConfiguration().getJDAVersion()).color(ChatColor.AQUA).create());
sender.sendMessage(new ComponentBuilder("Author - ").color(ChatColor.GOLD).append("LX_Gaming").color(ChatColor.AQUA).create());
return;
}
if (args.length == 1 && args[0].equalsIgnoreCase("reload") && sender.hasPermission("DiscordBot.Reload")) {
DiscordBot.getInstance().reloadDiscordBot();
sender.sendMessage(new ComponentBuilder("DiscordBot reloaded.").color(ChatColor.GREEN).create());
return;
}
if (!(sender instanceof ProxiedPlayer)) {
sender.sendMessage(new ComponentBuilder("Command cannot be run from Console").color(ChatColor.RED).create());
return;
}
ProxiedPlayer proxiedPlayer = (ProxiedPlayer) sender;
if (args.length == 1 && (args[0].equalsIgnoreCase("toggle") || args[0].equalsIgnoreCase("t")) && proxiedPlayer.hasPermission("DiscordBot.Toggle")) {
DiscordBotCore.getInstance().getDatabaseManager().togglePlayerDatabase(proxiedPlayer.getUniqueId());
}
}
Aggregations