public void updatePlayer(Player plr, Stream str) {
    // synchronized(plr) {
    updateBlock.currentOffset = 0;
    if (updateRunning && !updateAnnounced) {
      str.createFrame(114);
      str.writeWordBigEndian(updateSeconds * 50 / 30);
    }
    plr.updateThisPlayerMovement(str);
    boolean saveChatTextUpdate = plr.isChatTextUpdateRequired();
    plr.setChatTextUpdateRequired(false);
    plr.appendPlayerUpdateBlock(updateBlock);
    plr.setChatTextUpdateRequired(saveChatTextUpdate);
    str.writeBits(8, plr.playerListSize);
    int size = plr.playerListSize;
    plr.playerListSize = 0;
    for (int i = 0; i < size; i++) {
      if (!plr.didTeleport
          && !plr.playerList[i].didTeleport
          && plr.withinDistance(plr.playerList[i])) {
        plr.playerList[i].updatePlayerMovement(str);
        plr.playerList[i].appendPlayerUpdateBlock(updateBlock);
        plr.playerList[plr.playerListSize++] = plr.playerList[i];
      } else {
        int id = plr.playerList[i].playerId;
        plr.playerInListBitmap[id >> 3] &= ~(1 << (id & 7));
        str.writeBits(1, 1);
        str.writeBits(2, 3);
      }
    }
    int j = 0;
    for (int i = 0; i < Config.MAX_PLAYERS; i++) {
      // if(updateBlock.currentOffset >= 4000)
      // break;
      if (plr.playerListSize >= 254) break;
      if (updateBlock.currentOffset + str.currentOffset >= 4900) break;
      if (players[i] == null || !players[i].isActive || players[i] == plr) continue;
      int id = players[i].playerId;
      if ((plr.playerInListBitmap[id >> 3] & (1 << (id & 7))) != 0) continue;
      if (j >= 10) break;
      if (!plr.withinDistance(players[i])) continue;
      plr.addNewPlayer(players[i], str, updateBlock); // open player .java for me
      j++;
    }

    if (updateBlock.currentOffset > 0) {
      str.writeBits(11, 2047);
      str.finishBitAccess();

      str.writeBytes(updateBlock.buffer, updateBlock.currentOffset, 0);
    } else str.finishBitAccess();

    str.endFrameVarSizeWord();
  }