mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-22 02:19:44 +00:00
update doc/*/assets-preload.md
This commit is contained in:
parent
07568e6ae8
commit
65b40d7f5f
2 changed files with 85 additions and 0 deletions
|
|
@ -38,6 +38,48 @@ Additional load settings example:
|
|||
]
|
||||
}
|
||||
```
|
||||
## Patterns
|
||||
|
||||
An asset name may contain `*` to include multiple assets at once. The `*` matches any sequence of characters within a single path segment.
|
||||
|
||||
Pattern matching is performed within the pack containing `preload.json`, specifically within the folder corresponding to the asset type (e.g., `textures/`, `sounds/`, etc.).
|
||||
The resulting asset names are the same as if each discovered asset had been specified explicitly.
|
||||
|
||||
```json
|
||||
{
|
||||
"textures": [
|
||||
"gui/*",
|
||||
"mobs/*/skin-*"
|
||||
],
|
||||
"sounds": [
|
||||
"steps/*"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> Sound variations (such as `grass_0.ogg`, `grass_1.ogg`, etc.) are added as a single sound entry (e.g., `steps/grass`).
|
||||
|
||||
A pattern ending in `/` matches directories rather than individual files. This is used for atlases:
|
||||
```json
|
||||
{
|
||||
"atlases": [
|
||||
"smth/*/other-*/*/"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Entry parameters apply to all matched assets. The `path` parameter cannot be used in conjunction with a pattern:
|
||||
```json
|
||||
{
|
||||
"sounds": [
|
||||
{
|
||||
"name": "ambient/*",
|
||||
"keep-pcm": true
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
*preload.json* example from `core:` package (`res/preload.json`):
|
||||
```json
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue