# Minecraft Assets

## General

Assets are [Game Files](https://wiki.vg/Game_files). For example:

- Textures
- Sounds
- Language Files
- Block/Item models
- (Icons)
- Maybe more, but not relevant at this time

## Index assets

Those are downloaded from `https://resources.download.minecraft.net/`. They are separated in "types". You can specify what types to download in the `resources.json`. Available types are:

- `LANGUAGE` Languages minecraft is translated to (except `en_US`)
- `SOUNDS` All .ogg files with all sounds from the game (like music or block break sounds)
- `TEXTURES` Pretty mich none available, but this might get a thing in th future

## client.jar assets

Those are core assets (kind of essential for the game), delivered in the `client.jar` (textures, en_US language, models, etc)

When connecting to a server (and not specified in the `resources.json`) it downloads the `client.jar` for the minecraft version that you requested. The client.jar is shaded and only relevant assets will be saved in the applications' folder. Pretty much the same happens for

## assets sources

There is a file called [assets_properties.json](/src/main/resources/assets/minosoft/mapping/assets_properties.json). In that file are all hashes for assets (e.g. pixlyzer, index, client.jar, ...). It is automatically generated by a script called
[/util/assets_properties_generator.py]().

## Modifications

Those assets are not modifiable and checked everytime they get loaded (to disable this, set `verify` in the `resources.json` to false).

## Resource packs

They are pretty bugged, expect that things break. They are still supported. To add a resource pack, add this to `resource_packs` in the `resources.json`:

```json
{
  "type": "ZIP",
  "path": "/home/moritz/PureBDcraft 128x MC118.zip"
}
```

The `type` can either be `ZIP` or `DIRECTORY` (self explaining). The `path` the is path to the file/directory  
Resource packs override everything that is provided by the original sources (so you can change block models, everything. Can also be minosoft related to change language files, mappings, shaders or themes)

## Storing

All assets are stored sub folders of `assets/`. There are (probably 256) folders with the first 2 digits of the hash. All files are saved without extension and are (unless specified in code, currently only pixlyzer data (that is in mbf and mbf is probably already zstd compressed))
compressed with facebooks zstd algorithm.
