Advertisement
Tyluur

Untitled

Jan 8th, 2012
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. public void addNewNPC(NPC npc, Stream str, Stream updateBlock) {
  2. synchronized(this) {
  3. int id = npc.npcId;
  4. npcInListBitmap[id >> 3] |= 1 << (id&7);
  5. npcList[npcListSize++] = npc;
  6.  
  7. str.writeBits(14, id);
  8.  
  9. int z = npc.absY-absY;
  10. if(z < 0) z += 32;
  11. str.writeBits(5, z);
  12. z = npc.absX-absX;
  13. if(z < 0) z += 32;
  14. str.writeBits(5, z);
  15.  
  16. str.writeBits(1, 0);
  17. str.writeBits(18, npc.npcType);
  18.  
  19. boolean savedUpdateRequired = npc.updateRequired;
  20. npc.updateRequired = true;
  21. npc.appendNPCUpdateBlock(updateBlock);
  22. npc.updateRequired = savedUpdateRequired;
  23. str.writeBits(1, 1);
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement