Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void appendPlayerUpdateBlock(Stream str){
- if(str != null) {
- if(!updateRequired && !isChatTextUpdateRequired())
- return; // nothing required
- synchronized(this) {
- //TODO: Cache Update Block
- int updateMask = 0;
- if(mask100update) {
- updateMask |= 0x100;
- }
- if(animationRequest != -1) {
- updateMask |= 8;
- }
- if(forcedChatUpdateRequired) {
- updateMask |= 4;
- }
- if(isChatTextUpdateRequired()) {
- updateMask |= 0x80;
- }
- if(isAppearanceUpdateRequired()) {
- updateMask |= 0x10;
- }
- if(faceUpdateRequired) {
- updateMask |= 1;
- }
- if(FocusPointX != -1) {
- updateMask |= 2;
- }
- if (isHitUpdateRequired()) {
- updateMask |= 0x20;
- }
- if(hitUpdateRequired2) {
- updateMask |= 0x200;
- }
- if(updateMask >= 0x100) {
- updateMask |= 0x40;
- str.writeByte(updateMask & 0xFF);
- str.writeByte(updateMask >> 8);
- } else {
- str.writeByte(updateMask);
- }
- // now writing the various update blocks itself - note that their order crucial
- if(mask100update) {
- appendMask100Update(str);
- }
- if(animationRequest != -1) {
- appendAnimationRequest(str);
- }
- if(forcedChatUpdateRequired) {
- appendForcedChat(str);
- }
- if(isChatTextUpdateRequired()) {
- appendPlayerChatText(str);
- }
- if(faceUpdateRequired) {
- appendFaceUpdate(str);
- }
- if(isAppearanceUpdateRequired()) {
- appendPlayerAppearance(str);
- }
- if(FocusPointX != -1) {
- appendSetFocusDestination(str);
- }
- if(isHitUpdateRequired()) {
- appendHitUpdate(str);
- }
- if(hitUpdateRequired2) {
- appendHitUpdate2(str);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement