예제 #1
0
 @Override
 public PacketWriter write() throws IOException {
   PacketWriter packetWriter = new PacketWriter(this);
   packetWriter.writeUTF(name);
   packetWriter.writeUTF(alias);
   return packetWriter;
 }
  @Override
  public PacketWriter write() throws IOException {
    PacketWriter packetWriter = new PacketWriter(this);
    packetWriter.writeUTF(message);
    packetWriter.writeUTF(channel);

    StringBuilder sb = new StringBuilder();
    Iterator<String> stringIterator = to.iterator();
    while (stringIterator.hasNext()) {
      sb.append(stringIterator.next());

      if (stringIterator.hasNext()) {
        sb.append("§");
      }
    }

    packetWriter.writeUTF(sb.toString());
    return packetWriter;
  }
  @Override
  protected PacketWriter write() throws IOException {
    PacketWriter packetWriter = new PacketWriter(this);
    packetWriter.writeUTF(mode);
    packetWriter.writeUTF(message);

    if (players == null) {
      packetWriter.writeUTF("null");
    } else {
      packetWriter.writeUTF(StringUtils.join(players, "§"));
    }

    packetWriter.writeUTF(townName);
    packetWriter.writeUTF(nationName);

    return packetWriter;
  }
예제 #4
0
 @Override
 public PacketWriter write() throws IOException {
   PacketWriter packetWriter = new PacketWriter(this);
   packetWriter.writeBoolean(afk);
   return packetWriter;
 }