Phase 11: real block textures for 2D tiles
Layers texture-averaged colors on top of palette.rs's hand-picked table as a fallback (color_for_textured), not a hard replacement — biome-tinted/animated blocks (grass top, leaves, water, lava) deliberately keep the hand-picked color since averaging their raw jar textures would be wrong, not just imprecise. Vanilla: worker/src/textures.rs downloads Mojang's official client jar directly from launchermeta/piston-meta/piston-data (same endpoints the real launcher uses, gated behind ACCEPT_MINECRAFT_EULA=true, off by default, mirrors BlueMap's accept-download) and averages every block texture, cached to disk so it's not re-downloaded every restart. Modded: ingests block_registry/block_textures messages from the mod (new Postgres tables + MinIO storage in api/src/textures.ts) — sent once per connection over the existing WS gateway. texturepacks/<name>/ (Dynmap-style flat PNGs) lets an operator override the vanilla defaults worker-wide via TEXTURE_PACK. A per-server texturePack admin column/API exists for the same purpose, but render-time per-server resolution (of both the admin selection and the ingested modded textures) is explicitly deferred — the worker still applies one process-wide palette; true per-server resolution needs the render pipeline to thread a server-scoped palette through the batch/GPU-dispatch path, judged too big a change for this phase. Documented in README. Docker was unavailable in this dev environment for the usual integration-test verification; bunx tsc --noEmit was used as a fallback static check instead (clean except 2 pre-existing unrelated errors in markers.test.ts).
This commit is contained in:
@@ -53,6 +53,11 @@ html(lang="en")
|
||||
label.flex.items-center.gap-1.text-xs.text-neutral-300
|
||||
input(type="checkbox" x-model="server.playerPositionsVisible" data-testid="admin-server-playerpositions")
|
||||
| player positions
|
||||
div.flex.items-center.gap-2
|
||||
label.text-xs.text-neutral-400 texture pack
|
||||
input.flex-1.bg-neutral-900.text-xs.px-2.py-1.rounded.border.border-neutral-700(
|
||||
type="text" placeholder="(default — downloaded vanilla textures)"
|
||||
x-model="server.texturePack" data-testid="admin-server-texturepack")
|
||||
div.flex.gap-2
|
||||
button.px-2.py-1.bg-emerald-700.rounded.text-xs(x-on:click="saveServer(server)" data-testid="admin-server-save") Save
|
||||
button.px-2.py-1.bg-red-800.rounded.text-xs(x-on:click="removeServer(server)" data-testid="admin-server-delete") Delete
|
||||
|
||||
Reference in New Issue
Block a user