Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void addNewNPC(NPC npc, Stream str, Stream updateBlock) {
- synchronized(this) {
- int id = npc.npcId;
- npcInListBitmap[id >> 3] |= 1 << (id&7);
- npcList[npcListSize++] = npc;
- str.writeBits(14, id);
- int z = npc.absY-absY;
- if(z < 0) z += 32;
- str.writeBits(5, z);
- z = npc.absX-absX;
- if(z < 0) z += 32;
- str.writeBits(5, z);
- str.writeBits(1, 0);
- str.writeBits(18, npc.npcType);
- boolean savedUpdateRequired = npc.updateRequired;
- npc.updateRequired = true;
- npc.appendNPCUpdateBlock(updateBlock);
- npc.updateRequired = savedUpdateRequired;
- str.writeBits(1, 1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement