mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-12 17:07:55 -04:00
assets documentation
This commit is contained in:
parent
d0307e9fb2
commit
dca9cf6a92
@ -1,36 +1,54 @@
|
||||
# Minecraft Assets
|
||||
|
||||
## General
|
||||
|
||||
Assets are [Game Files](https://wiki.vg/Game_files). For example:
|
||||
- Textures
|
||||
- Sounds
|
||||
- Language Files
|
||||
- (Icons)
|
||||
- (Block models)
|
||||
- ...
|
||||
|
||||
There are core assets (essential for the game), delivered in the `client.jar` (Textures, en_US language, models, etc)
|
||||
and there are "other assets", like sounds, all other languages, available on `https://resources.download.minecraft.net/`.
|
||||
|
||||
Minosoft downloads the current best available (hardcoded) client.jar and extracts the `minecraft` folder in it into a temporary one.
|
||||
Now the (sha1) hash is getting calculated and then the file will be gzipped and saved into `%Dir%/assets/objects/<first 2 digs of hash>/<full hash>.gz`.
|
||||
Next, a file called index.json will be created. It is a simple mapping: file name -> hash and looks like this:
|
||||
```json
|
||||
{
|
||||
"minecraft/lang/de_de.json": "a8f1b2babf63e3fa21d24728271eaef0d8d33041"
|
||||
}
|
||||
```
|
||||
Next, in the `version.json` ([Example 1.16.4-pre1](https://launchermeta.mojang.com/v1/packages/edcca0531de05c4b15007ca689b575a33b9d96a2/1.16.4-pre1.json)) there is a sub json object called `assetIndex`.
|
||||
The asset index will be downloaded and stored. The hash of the file is hardcoded into minosoft to ensure that the assets are compatible. Next we loop over all elements and check if the file exists.
|
||||
If not, we will download it and store it gzip compressed.
|
||||
|
||||
## Valid (Relevant) files
|
||||
Before downloading a file, the file is checked for relevance. Relevant files are prefixed with the following strings (or the file path):
|
||||
- Textures
|
||||
- Sounds
|
||||
- Language Files
|
||||
- Block/Item models
|
||||
- (Icons)
|
||||
- Maybe more, but not relevant at this time´```
|
||||
|
||||
- `minecraft/lang/` -> Language files
|
||||
- `minecraft/sounds.json` -> Sound meta data and index file
|
||||
- `minecraft/sounds/` -> Sounds
|
||||
- `minecraft/textures/` -> Textures
|
||||
- `minecraft/font/` -> Fonts
|
||||
## 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
|
||||
If you want to edit an existing file, you should disable `verify-all-assets` (in `debug`), otherwise your changes will be recognised as corruption and will be overwritten.
|
||||
|
||||
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 in `assets/objects`. 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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user