Search in sources :

Example 21 with TextComponent

use of net.md_5.bungee.api.chat.TextComponent 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 22 with TextComponent

use of net.md_5.bungee.api.chat.TextComponent 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 23 with TextComponent

use of net.md_5.bungee.api.chat.TextComponent in project FireAPI by FireBlade-Serv.

the class FireFriends method acceptRequest.

public void acceptRequest(ProxiedPlayer receiver, ProxiedPlayer sender) throws IOException {
    if (this.outdated.containsKey(receiver)) {
        if (this.outdated.get(receiver).equals(sender)) {
            if (!isAlreadyFriends(receiver, sender)) {
                // accepted
                receiver.sendMessage(new TextComponent(this.pre + "§aVous êtes maintenant ami avec §2" + sender.getName() + "§a !"));
                sender.sendMessage(new TextComponent(this.pre + "§aVous êtes maintenant ami avec §2" + receiver.getName() + "§a !"));
                addFriend(sender, receiver);
                return;
            } else {
                receiver.sendMessage(new TextComponent(this.pre + "§cErreur, vous êtes déjà " + "ami avec " + sender.getName() + " !"));
                return;
            }
        }
    }
    receiver.sendMessage(new TextComponent(this.pre + "§cErreur, vous n'avez reçu aucune demande récente de ce §cjoueur !"));
}
Also used : TextComponent(net.md_5.bungee.api.chat.TextComponent)

Example 24 with TextComponent

use of net.md_5.bungee.api.chat.TextComponent in project ViaCheckConnection by x9nico.

the class Bungee method join.

@SuppressWarnings({ "unchecked" })
@EventHandler
public void join(ServerConnectedEvent e) throws IOException {
    ProxiedPlayer p = e.getPlayer();
    Configuration config = ConfigurationProvider.getProvider(YamlConfiguration.class).load(new File(getDataFolder(), "config.yml"));
    if (Bungee.isProtocolSupport()) {
        if (Via.getAPI().getPlayerVersion(p) == ProtocolVersion.v1_8.getId()) {
            p.sendMessage(new TextComponent(config.getString("v1_8").replace("&", "§")));
        } else if (Via.getAPI().getPlayerVersion(p) == ProtocolVersion.v1_9.getId()) {
            p.sendMessage(new TextComponent(config.getString("v1_9").replace("&", "§")));
        } else if (Via.getAPI().getPlayerVersion(p) == ProtocolVersion.v1_9_1.getId()) {
            p.sendMessage(new TextComponent(config.getString("v1_9_1").replace("&", "§")));
        } else if (Via.getAPI().getPlayerVersion(p) == ProtocolVersion.v1_9_2.getId()) {
            p.sendMessage(new TextComponent(config.getString("v1_9_2").replace("&", "§")));
        } else if (Via.getAPI().getPlayerVersion(p) == ProtocolVersion.v1_9_3.getId()) {
            p.sendMessage(new TextComponent(config.getString("v1_9_3").replace("&", "§")));
        } else if (Via.getAPI().getPlayerVersion(p) == ProtocolVersion.v1_10.getId()) {
            p.sendMessage(new TextComponent(config.getString("v1_10").replace("&", "§")));
        } else if (Via.getAPI().getPlayerVersion(p) == ProtocolVersion.v1_11.getId()) {
            p.sendMessage(new TextComponent(config.getString("v1_11").replace("&", "§")));
        } else if (Via.getAPI().getPlayerVersion(p) == ProtocolVersion.v1_11_1.getId()) {
            p.sendMessage(new TextComponent(config.getString("v1_11_1").replace("&", "§")));
        } else if (Via.getAPI().getPlayerVersion(p) == ProtocolVersion.v1_12.getId()) {
            p.sendMessage(new TextComponent(config.getString("v1_12").replace("&", "§")));
        } else if (Via.getAPI().getPlayerVersion(p) == ProtocolVersion.unknown.getId()) {
            p.sendMessage(new TextComponent(config.getString("unknown_version").replace("&", "§")));
        } else if (Via.getAPI().getPlayerVersion(p) == ProtocolVersion.v1_7_1.getId()) {
            p.sendMessage(new TextComponent(config.getString("v1_7_1").replace("&", "§")));
        } else if (Via.getAPI().getPlayerVersion(p) == ProtocolVersion.v1_7_6.getId()) {
            p.sendMessage(new TextComponent(config.getString("v1_7_6").replace("&", "§")));
        } else if (Via.getAPI().getPlayerVersion(p) == ProtocolVersion.v1_12_1.getId()) {
            p.sendMessage(new TextComponent(config.getString("v1_12_1").replace("&", "§")));
        } else if (Via.getAPI().getPlayerVersion(p) == ProtocolVersion.v1_12_2.getId()) {
            p.sendMessage(new TextComponent(config.getString("v1_12_2").replace("&", "§")));
        } else if (Via.getAPI().getPlayerVersion(p) == ProtocolVersion.v1_13.getId()) {
            p.sendMessage(new TextComponent(config.getString("v1_13").replace("&", "§")));
        }
    } else {
        if (Via.getAPI().getPlayerVersion(p) == ProtocolVersion.v1_8.getId()) {
            p.sendMessage(new TextComponent(config.getString("v1_8").replace("&", "§")));
        } else if (Via.getAPI().getPlayerVersion(p) == ProtocolVersion.v1_9.getId()) {
            p.sendMessage(new TextComponent(config.getString("v1_9").replace("&", "§")));
        } else if (Via.getAPI().getPlayerVersion(p) == ProtocolVersion.v1_9_1.getId()) {
            p.sendMessage(new TextComponent(config.getString("v1_9_1").replace("&", "§")));
        } else if (Via.getAPI().getPlayerVersion(p) == ProtocolVersion.v1_9_2.getId()) {
            p.sendMessage(new TextComponent(config.getString("v1_9_2").replace("&", "§")));
        } else if (Via.getAPI().getPlayerVersion(p) == ProtocolVersion.v1_9_3.getId()) {
            p.sendMessage(new TextComponent(config.getString("v1_9_3").replace("&", "§")));
        } else if (Via.getAPI().getPlayerVersion(p) == ProtocolVersion.v1_10.getId()) {
            p.sendMessage(new TextComponent(config.getString("v1_10").replace("&", "§")));
        } else if (Via.getAPI().getPlayerVersion(p) == ProtocolVersion.v1_11.getId()) {
            p.sendMessage(new TextComponent(config.getString("v1_11").replace("&", "§")));
        } else if (Via.getAPI().getPlayerVersion(p) == ProtocolVersion.v1_11_1.getId()) {
            p.sendMessage(new TextComponent(config.getString("v1_11_1").replace("&", "§")));
        } else if (Via.getAPI().getPlayerVersion(p) == ProtocolVersion.v1_12.getId()) {
            p.sendMessage(new TextComponent(config.getString("v1_12").replace("&", "§")));
        } else if (Via.getAPI().getPlayerVersion(p) == ProtocolVersion.unknown.getId()) {
            p.sendMessage(new TextComponent(config.getString("unknown_version").replace("&", "§")));
        } else if (Via.getAPI().getPlayerVersion(p) == ProtocolVersion.v1_12_1.getId()) {
            p.sendMessage(new TextComponent(config.getString("v1_12_1").replace("&", "§")));
        } else if (Via.getAPI().getPlayerVersion(p) == ProtocolVersion.v1_12_2.getId()) {
            p.sendMessage(new TextComponent(config.getString("v1_12_2").replace("&", "§")));
        } else if (Via.getAPI().getPlayerVersion(p) == ProtocolVersion.v1_13.getId()) {
            p.sendMessage(new TextComponent(config.getString("v1_13").replace("&", "§")));
        }
    }
}
Also used : TextComponent(net.md_5.bungee.api.chat.TextComponent) ProxiedPlayer(net.md_5.bungee.api.connection.ProxiedPlayer) YamlConfiguration(net.md_5.bungee.config.YamlConfiguration) Configuration(net.md_5.bungee.config.Configuration) YamlConfiguration(net.md_5.bungee.config.YamlConfiguration) File(java.io.File) EventHandler(net.md_5.bungee.event.EventHandler)

Example 25 with TextComponent

use of net.md_5.bungee.api.chat.TextComponent in project Arcade2 by ShootGame.

the class CycleCountdown method onTick.

@Override
public void onTick(long ticks) {
    if (!this.plugin.getGames().getQueue().hasNextMap()) {
        this.cancelCountdown();
        return;
    } else if (this.getProgress() > 1) {
        return;
    }
    OfflineMap nextMap = this.plugin.getGames().getQueue().getNextMap();
    Game game = this.plugin.getGames().getCurrentGame();
    if (game == null) {
        return;
    }
    String message = this.getPrintMessage(this.getCycleMessage(nextMap.getName()));
    BossBar bossBar = this.getBossBar();
    bossBar.setProgress(Percentage.finite(this.getProgress()));
    bossBar.setText(new TextComponent(message));
    for (ArcadePlayer online : this.plugin.getPlayers()) {
        GamePlayer player = online.getGamePlayer();
        if (player != null) {
            bossBar.addPlayer(player, BAR_PRIORITY);
        }
    }
}
Also used : TextComponent(net.md_5.bungee.api.chat.TextComponent) Game(pl.themolka.arcade.game.Game) ArcadePlayer(pl.themolka.arcade.session.ArcadePlayer) GamePlayer(pl.themolka.arcade.game.GamePlayer) OfflineMap(pl.themolka.arcade.map.OfflineMap) BossBar(pl.themolka.arcade.bossbar.BossBar)

Aggregations

TextComponent (net.md_5.bungee.api.chat.TextComponent)50 CoreStateInitException (com.solinia.solinia.Exceptions.CoreStateInitException)12 ProxiedPlayer (net.md_5.bungee.api.connection.ProxiedPlayer)12 Player (org.bukkit.entity.Player)12 ISoliniaPlayer (com.solinia.solinia.Interfaces.ISoliniaPlayer)11 ClickEvent (net.md_5.bungee.api.chat.ClickEvent)11 ComponentBuilder (net.md_5.bungee.api.chat.ComponentBuilder)9 HoverEvent (net.md_5.bungee.api.chat.HoverEvent)9 IOException (java.io.IOException)6 Configuration (net.md_5.bungee.config.Configuration)6 YamlConfiguration (net.md_5.bungee.config.YamlConfiguration)6 ISoliniaItem (com.solinia.solinia.Interfaces.ISoliniaItem)5 ArrayList (java.util.ArrayList)5 ISoliniaLivingEntity (com.solinia.solinia.Interfaces.ISoliniaLivingEntity)4 ISoliniaSpell (com.solinia.solinia.Interfaces.ISoliniaSpell)4 DecimalFormat (java.text.DecimalFormat)4 SoliniaItemException (com.solinia.solinia.Exceptions.SoliniaItemException)3 SoliniaActiveSpell (com.solinia.solinia.Models.SoliniaActiveSpell)3 File (java.io.File)3 EventHandler (net.md_5.bungee.event.EventHandler)3