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);
}
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);
}
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 !"));
}
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("&", "§")));
}
}
}
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);
}
}
}
Aggregations