public void newClanMessage(Clan c, ChatMessage chatMessage) { PacketBuilder pb = new PacketBuilder(); pb.setId(54).setSize(Packet.Size.VariableByte); pb.addLong(chatMessage.getPlayer().getLoginDetails().getLongName()); pb.addByte((byte)1); // dummy pb.addLong(misc.playerNameToLong(c.getClanName())); pb.addUShort(0); // some message counter bs string message = chatMessage.getChatText(); int messageCounter = player.getFriends().getNextUniqueId(); pb.addThreeBytes(messageCounter); pb.addByte((byte)chatMessage.getPlayer().getRights()); pb.addBytes(chatMessage.getPacked()); connection.SendPacket(pb.toPacket()); }