Expand voxel gameplay, lighting, full-height streaming and world imports
MVP checks / mvp (push) Canceled after 0s

Add shared Rust/WASM physics, worker meshing and diagnostics, 64-chunk full-height streaming, atlas texture support, and baseline world import. Document the current implementation and include the supplied in-game lobby screenshot.
This commit is contained in:
Emil
2026-09-17 02:10:53 +03:00
parent 26748912c6
commit c7e86663d8
111 changed files with 24257 additions and 598 deletions
+33
View File
@@ -40,4 +40,37 @@ This is a limited, working extension API, with no claim of arbitrary Forge/Fabri
The base package provides a pixel texture; the trampoline provides its own texture, a GLSL color function, style settings, and a short synthesized sound. The custom WebGL2 renderer applies them. The core and server contain no graphics engine. Packages do not load arbitrary privileged JavaScript.
### Local block texture packs
A `client-style` resource may declare a `texture_pack` with a display `name`, a `pixel_size` from 1 to 128, and `textures: [{name, path}]`. Each image path must name a resource from the same package that has already passed size and SHA-256 verification, and every image must be square with the declared pixel size. The client decodes the PNGs into a WebGL2 texture array and uses nearest-neighbor sampling. The local study uses actual 32×32 images. Known block faces select images by Minecraft texture name; missing faces keep the core's procedural material. Grass-top and oak-leaf masks receive a green tint, and transparent pixels are cut out. This is a partial block-texture layer, not support for arbitrary resource-pack models, animations, entities, or shaders.
Prepare the local 24-texture study using the standard-library helper:
```sh
python3 scripts/prepare_texture_pack.py \
--source artifacts/pixel-pack-32/pack \
--output artifacts/pixel-pack-32/shacraft-packages
target/release/shacraft-server \
--data artifacts/mvp-demo \
--packages artifacts/pixel-pack-32/shacraft-packages \
--listen 127.0.0.1:4000
```
The helper copies the selected images verbatim and bundles the required base and trampoline packages. All 24 default images must exist and match the declared dimensions. The default is 32×32; `--pixel-size 64` packages real 64×64 inputs (16, 32, 64 and 128 are supported). It validates dimensions without resampling, writes the matching `pixel_size`, and updates resource sizes and hashes. Use `--textures stone dirt ...` to select a different subset, and `--name`, `--id`, `--version`, and `--license` to describe another pack. `--overwrite` rebuilds only a directory marked as a previous output of this helper. It never downloads source art. Preparing a pack does not grant distribution rights; the reference-derived study and its bundle remain under ignored `artifacts/` and are not included in the repository. Restart a running server with the generated `--packages` directory and reload the game to activate it. F3 shows the active pack name and texture count.
When modifying a package, recalculate the size and SHA-256 of each changed resource, increase the version, and update exact dependencies. `scripts/catalog_assets.py` reproducibly generates the bundled original resources and manifests. The format is designed for a future launcher: it can consume the same manifest and cache by `(id,version,sha256)`; integration with a specific launcher is outside this repository's scope.
### Local full-catalog atlas
For local compatibility testing, `scripts/prepare_vanilla_texture_pack.py` accepts an existing Java client JAR, its matching generated block-state report, and a new output directory. It does not download assets. Pillow is required.
```sh
python3 scripts/prepare_vanilla_texture_pack.py \
--jar artifacts/pixel-pack-32/source-cache/minecraft-26.2-client.jar \
--states artifacts/catalog-cache/generated/reports/blocks.json \
--output artifacts/vanilla-local/packages
```
The resulting package declares `atlas: {path, columns, rows}` alongside the texture names. All tiles have `pixel_size` dimensions; integer texel sampling prevents bleeding and avoids the GPU's array-layer limit. The atlas and style are verified package resources. Optional `block_faces: {sets, states, defaults}` maps canonical states to six-face sets in east/west/up/down/south/north order. Each face supplies a texture name, optional tint/cutout flag, and optional eight-number UV transform (two affine rows over local x/y/z/1). Validated mappings are transferred to terrain and edit workers with the texture map.
The importer resolves model inheritance, variants, rotations, and face materials onto the engine's existing geometry. It selects a representative face for multipart geometry and uses particle materials for entity-rendered blocks. It does not import full models, block-entity rendering, biome tint maps, or animation playback. Animated sprites use the first declared frame; native 16-pixel sprites are doubled without changing their colors in 32-pixel atlas cells. These are local testing assets with Mojang/Microsoft ownership, not open-source repository assets or a redistributable default pack. Keep the output under ignored `artifacts/`. Select its directory with the server's `--packages` option; selecting the previous package directory restores the previous textures.