Skip to content

Give the map back its mouse, and render the dimensions it never could (#135) - #138

Merged
CaYatur merged 2 commits into
mainfrom
fix/map-interaction-and-dimensions
Jul 29, 2026
Merged

Give the map back its mouse, and render the dimensions it never could (#135)#138
CaYatur merged 2 commits into
mainfrom
fix/map-interaction-and-dimensions

Conversation

@CaYatur

@CaYatur CaYatur commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Give the map back its mouse, and render the dimensions it never could (#135)

An invisible box was eating every mouse event. .mp-empty is
position:absolute; inset:0 — it covers the whole canvas — and #103 removed its
pointer-events:none so the bridge install button inside it could be clicked.
That handed mousedown, mousemove and the wheel listener to the overlay, so
neither web map could be dragged or zoomed and the wheel fell through to the
page. It is transparent to the mouse again, with only its children clickable,
which is what the button needed in the first place.

The desktop scrolled the page for a different reason: React registers wheel
listeners as passive, so preventDefault inside onWheel does nothing. It
binds its own listener with passive: false.

The terrain vanished when zoomed out because one function answered two
questions. mapVisibleChunks is capped at 4096 so a zoomed-out view does not
ask for a million chunks — and it was also the list of what to draw, so the
cap blanked the map. Drawing now iterates what is HELD and clips to the
viewport, which costs the size of the cache rather than the size of the view and
stays cheap however far out you go.

The nether and the end have never rendered. Paper splits dimensions into
sibling world folders — world_nether/DIM-1/region, world_the_end/DIM1/region
— and MSMS only ever built vanilla's world/DIM-1/region, which does not exist
there. Both layouts are tried now, plus a custom world's own folder, and the
resolved directory is remembered because peekChunkTile runs once per requested
chunk.

And the nether needed a different technique. It has a bedrock roof at y=127,
so a top-down scan finds bedrock in every column and paints the dimension one
flat grey slab. The scan starts below the roof and skips solid blocks until it
has seen an air gap — the floor a player stands on rather than the ceiling above
them. Verified by rendering the real world to an image and looking at it:
netherrack, lava and warped forest where there was a grey slab, and the end's
island in end stone with its obsidian pillars where there was nothing at all.

Asserted with a synthetic nether-shaped chunk — bedrock roof, air gap,
netherrack floor — read under both rules: the overworld rule stops at the roof
(which is the bug), the nether rule reaches the floor below it.

The terrain toggle now defaults on. A grid with dots on it was not a map.

…#135)

**An invisible box was eating every mouse event.** `.mp-empty` is
`position:absolute; inset:0` — it covers the whole canvas — and #103 removed its
`pointer-events:none` so the bridge install button inside it could be clicked.
That handed `mousedown`, `mousemove` and the `wheel` listener to the overlay, so
neither web map could be dragged or zoomed and the wheel fell through to the
page. It is transparent to the mouse again, with only its children clickable,
which is what the button needed in the first place.

The desktop scrolled the page for a different reason: React registers wheel
listeners as **passive**, so `preventDefault` inside `onWheel` does nothing. It
binds its own listener with `passive: false`.

**The terrain vanished when zoomed out** because one function answered two
questions. `mapVisibleChunks` is capped at 4096 so a zoomed-out view does not
ask for a million chunks — and it was also the list of what to *draw*, so the
cap blanked the map. Drawing now iterates what is HELD and clips to the
viewport, which costs the size of the cache rather than the size of the view and
stays cheap however far out you go.

**The nether and the end have never rendered.** Paper splits dimensions into
sibling world folders — `world_nether/DIM-1/region`, `world_the_end/DIM1/region`
— and MSMS only ever built vanilla's `world/DIM-1/region`, which does not exist
there. Both layouts are tried now, plus a custom world's own folder, and the
resolved directory is remembered because `peekChunkTile` runs once per requested
chunk.

**And the nether needed a different technique.** It has a bedrock roof at y=127,
so a top-down scan finds bedrock in every column and paints the dimension one
flat grey slab. The scan starts below the roof and skips solid blocks until it
has seen an air gap — the floor a player stands on rather than the ceiling above
them. Verified by rendering the real world to an image and looking at it:
netherrack, lava and warped forest where there was a grey slab, and the end's
island in end stone with its obsidian pillars where there was nothing at all.

Asserted with a synthetic nether-shaped chunk — bedrock roof, air gap,
netherrack floor — read under both rules: the overworld rule stops at the roof
(which is the bug), the nether rule reaches the floor below it.

The terrain toggle now defaults on. A grid with dots on it was not a map.
Copilot AI review requested due to automatic review settings July 29, 2026 11:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

The under-roof rule skips solid blocks until it has seen an air gap. A column
that is solid from the ceiling all the way down — a netherrack pillar joining
floor to roof — never shows one, so every block in it was skipped and the column
came out transparent: holes punched through the nether map exactly where the
terrain is thickest. The highest solid block seen while skipping is kept and used
if the column ends up empty.

And the web map's tile cache was never trimmed. The desktop got that in #129 and
the shared engine did not, so panning a big world grew it for as long as the page
stayed open. It matters more now than it did: since drawing iterates what is
HELD rather than what is visible — which is the fix for the map vanishing when
zoomed out — an unbounded cache is a per-frame cost as well as a memory one.
@CaYatur

CaYatur commented Jul 29, 2026

Copy link
Copy Markdown
Owner Author

Self-review: holes in the nether, and a web tile cache that never shrank

The under-roof rule skips solid blocks until it has seen an air gap. A column
that is solid from the ceiling all the way down — a netherrack pillar joining
floor to roof — never shows one, so every block in it was skipped and the column
came out transparent: holes punched through the nether map exactly where the
terrain is thickest. The highest solid block seen while skipping is kept and used
if the column ends up empty.

And the web map's tile cache was never trimmed. The desktop got that in #129 and
the shared engine did not, so panning a big world grew it for as long as the page
stayed open. It matters more now than it did: since drawing iterates what is
HELD rather than what is visible — which is the fix for the map vanishing when
zoomed out — an unbounded cache is a per-frame cost as well as a memory one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants