// Befehl: Ändere seriösen Name public boolean onCommandCHGNM( CommandSender sender, Command command, String label, String[] args) { Gamer g = Main.i.mylib.getGamerFromSender(sender); if (g == null) return true; if (g.state != 0) { Main.i.mylib.sendError(g, "ingame"); return false; } g.sendMessage( ChatColor.BLUE.toString() + ChatColor.BOLD + Main.i.saves.config.getString("tr.lobby.change")); g.inputLongName = true; return true; }
// ChatManager! public void onAsyncPlayerChat(AsyncPlayerChatEvent e) { Gamer g = getGamer(e.getPlayer().getName()); if (g == null) return; e.setCancelled(true); // Check Flags if (g.inputLongName) { g.longName = e.getMessage(); g.inputLongName = false; Main.i.mylib.sendInfo(g, "chgnm"); return; } // In der Lobby if (g.state == 0) { sendLobbyMessage("<" + g.longName + "> " + e.getMessage()); } else if (g.state == 1) { if (g.joinedRoom == null) return; g.joinedRoom.sendMessage("<" + g.longName + "> " + e.getMessage(), ChatColor.WHITE); } }