Advertisement
Guest User

Untitled

a guest
May 28th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. public void appendPlayerUpdateBlock(Stream str){
  2. if(str != null) {
  3. if(!updateRequired && !isChatTextUpdateRequired())
  4. return; // nothing required
  5. synchronized(this) {
  6. //TODO: Cache Update Block
  7. int updateMask = 0;
  8. if(mask100update) {
  9. updateMask |= 0x100;
  10. }
  11. if(animationRequest != -1) {
  12. updateMask |= 8;
  13. }
  14. if(forcedChatUpdateRequired) {
  15. updateMask |= 4;
  16. }
  17. if(isChatTextUpdateRequired()) {
  18. updateMask |= 0x80;
  19. }
  20. if(isAppearanceUpdateRequired()) {
  21. updateMask |= 0x10;
  22. }
  23. if(faceUpdateRequired) {
  24. updateMask |= 1;
  25. }
  26. if(FocusPointX != -1) {
  27. updateMask |= 2;
  28. }
  29. if (isHitUpdateRequired()) {
  30. updateMask |= 0x20;
  31. }
  32.  
  33. if(hitUpdateRequired2) {
  34. updateMask |= 0x200;
  35. }
  36.  
  37. if(updateMask >= 0x100) {
  38. updateMask |= 0x40;
  39. str.writeByte(updateMask & 0xFF);
  40. str.writeByte(updateMask >> 8);
  41. } else {
  42. str.writeByte(updateMask);
  43. }
  44.  
  45. // now writing the various update blocks itself - note that their order crucial
  46. if(mask100update) {
  47. appendMask100Update(str);
  48. }
  49. if(animationRequest != -1) {
  50. appendAnimationRequest(str);
  51. }
  52. if(forcedChatUpdateRequired) {
  53. appendForcedChat(str);
  54. }
  55. if(isChatTextUpdateRequired()) {
  56. appendPlayerChatText(str);
  57. }
  58. if(faceUpdateRequired) {
  59. appendFaceUpdate(str);
  60. }
  61. if(isAppearanceUpdateRequired()) {
  62. appendPlayerAppearance(str);
  63. }
  64. if(FocusPointX != -1) {
  65. appendSetFocusDestination(str);
  66. }
  67. if(isHitUpdateRequired()) {
  68. appendHitUpdate(str);
  69. }
  70. if(hitUpdateRequired2) {
  71. appendHitUpdate2(str);
  72. }
  73. }
  74. }
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement