public static void updateState(Player player, StreamBuffer.OutBuffer block, boolean forceAppearance, boolean noChat) {

		// First we must prepare the mask.
		int mask = 0x0;
		if (player.isChatUpdateRequired() && !noChat) {
			mask |= 0x80;
		}
		if (player.isAppearanceUpdateRequired() || forceAppearance) {
			mask |= 0x10;
		}

		// Now, we write the actual mask.
		if (mask >= 0x100) {
			mask |= 0x40;
			block.writeShort(mask, StreamBuffer.ByteOrder.LITTLE);
		} else {
			block.writeByte(mask);
		}

		// Finally, we append the attributes blocks.
		// Graphics
		// Animation
		// Forced chat
		if (player.isChatUpdateRequired() && !noChat) {
			appendChat(player, block);
		}
		// Face entity
		// Appearance
		if (player.isAppearanceUpdateRequired() || forceAppearance) {
			appendAppearance(player, block);
		}
		// Face coordinates
		// Primary hit
		// Secondary hit
	}