Search in sources :

Example 16 with CommandSender

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);
}
Also used : TextComponent(net.md_5.bungee.api.chat.TextComponent) HoverEvent(net.md_5.bungee.api.chat.HoverEvent) ClickEvent(net.md_5.bungee.api.chat.ClickEvent) ComponentBuilder(net.md_5.bungee.api.chat.ComponentBuilder)

Example 17 with CommandSender

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);
}
Also used : TextComponent(net.md_5.bungee.api.chat.TextComponent) HoverEvent(net.md_5.bungee.api.chat.HoverEvent) ClickEvent(net.md_5.bungee.api.chat.ClickEvent) ComponentBuilder(net.md_5.bungee.api.chat.ComponentBuilder)

Example 18 with CommandSender

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);
}
Also used : CommandSender(net.md_5.bungee.api.CommandSender) Sender(me.lucko.luckperms.common.sender.Sender)

Example 19 with CommandSender

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");
    }
}
Also used : ProxiedPlayer(net.md_5.bungee.api.connection.ProxiedPlayer)

Example 20 with CommandSender

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());
    }
}
Also used : ProxiedPlayer(net.md_5.bungee.api.connection.ProxiedPlayer) ComponentBuilder(net.md_5.bungee.api.chat.ComponentBuilder)

Aggregations

TextComponent (net.md_5.bungee.api.chat.TextComponent)22 ProxiedPlayer (net.md_5.bungee.api.connection.ProxiedPlayer)15 ComponentBuilder (net.md_5.bungee.api.chat.ComponentBuilder)11 CommandSender (net.md_5.bungee.api.CommandSender)9 HoverEvent (net.md_5.bungee.api.chat.HoverEvent)8 Player (org.bukkit.entity.Player)8 CoreStateInitException (com.solinia.solinia.Exceptions.CoreStateInitException)6 ClickEvent (net.md_5.bungee.api.chat.ClickEvent)6 ISoliniaPlayer (com.solinia.solinia.Interfaces.ISoliniaPlayer)5 ArrayList (java.util.ArrayList)4 ServerInfo (de.dytanic.cloudnet.lib.server.info.ServerInfo)3 BaseComponent (net.md_5.bungee.api.chat.BaseComponent)3 ChatSender (at.pcgamingfreaks.Bungee.Message.Sender.ChatSender)2 SendMethod (at.pcgamingfreaks.Bungee.Message.Sender.SendMethod)2 CommandHandler (com.Ben12345rocks.AdvancedCore.Objects.CommandHandler)2 ISoliniaLivingEntity (com.solinia.solinia.Interfaces.ISoliniaLivingEntity)2 ISoliniaSpell (com.solinia.solinia.Interfaces.ISoliniaSpell)2 SoliniaActiveSpell (com.solinia.solinia.Models.SoliniaActiveSpell)2 SoliniaEntitySpells (com.solinia.solinia.Models.SoliniaEntitySpells)2 CloudPlayer (de.dytanic.cloudnet.lib.player.CloudPlayer)2