@EventHandler(priority=EventPriority.NORMAL)
public void lobbySign(PlayerInteractEvent e){
Player p = e.getPlayer();
Sign s = (Sign) e.getClickedBlock().getState();
String l1 = s.getLine(0);
String l2 = s.getLine(1);
if (e.getAction() == Action.RIGHT_CLICK_BLOCK) {
if (s instanceof Sign) {
if(l1.contains(ChatColor.stripColor("[EggWars]"))){
if(l2.contains(ChatColor.stripColor("Join"))){
if(!Joueurs.contains(p)){
if(Joueurs.size() < maxp){
s.setLine(2, ChatColor.GREEN + "[" + Joueurs.size() + "/" + maxp + "]");
Joueurs.add(p);
p.teleport(new Location(Bukkit.getWorld(this.plugin.getConfig().getString("Locations.world")),
this.plugin.getConfig().getDouble("Locations.lobby.x"),
this.plugin.getConfig().getDouble("Locations.lobby.y"),
this.plugin.getConfig().getDouble("Locations.lobby.z")));
p.sendMessage(ChatColor.GREEN + "Vous avez était téléporté dans le lobby [" + Joueurs.size() + "/" + maxp + "]");
s.setLine(2, ChatColor.GREEN + "[" + Joueurs.size() + "/" + maxp + "]");
s.update();
}else {
p.sendMessage(ChatColor.RED + "L'arène est pleine");
s.setLine(2, ChatColor.RED + "PLEIN");
s.update();
}
}else {
p.sendMessage(ChatColor.RED + "Vous êtes deja dans l'arène");
}
}
}
}
}
}
@EventHandler(priority=EventPriority.NORMAL)
public void startSign(PlayerInteractEvent e){
Player p = e.getPlayer();
Sign s = (Sign) e.getClickedBlock().getState();
String l1 = s.getLine(0);
String l2 = s.getLine(1);
if (e.getAction() == Action.RIGHT_CLICK_BLOCK) {
if (s instanceof Sign) {
if(l1.contains(ChatColor.stripColor("[EggWars]"))){
if(l2.contains(ChatColor.stripColor("Start"))){
if(p.isOp()){
}
}
}
}
}
}