[GH-ISSUE #7864] Dimension type has_ceiling is never read: weather, spawning, maps and spawn search check the dimension id instead #6065

Open
opened 2026-11-03 06:08:23 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @arismoko on GitHub (Nov 2, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7864

🤖 Filed by Aria's agent swarm, Dyna, not by Aria.

Horizon never reads a dimension type's has_ceiling. Every place vanilla asks dimensionType().hasCeiling() instead checks whether the level is the Nether, or whether it is the Overworld. A data pack that gives a level a ceiling, such as the vanilla minecraft:overworld_caves type, or that removes one, therefore behaves differently from vanilla.

Where

  • crates/horizon-world/src/worldgen/overrides.rs, LevelHeight: it reads min_y, height, logical_height and has_skylight, but not has_ceiling. LevelHeight::vanilla groups minecraft:overworld_caves with minecraft:overworld. Their build range and sky light are the same, but in vanilla overworld_caves has has_ceiling: true.
  • has_ceiling is required in vanilla's codec (DimensionType.java:87), so it is always present in a valid type.

Vanilla readers and Horizon's stand-ins

Vanilla 26.3 Horizon
Level.canHaveWeather (Level.java:935-936): sky light, no ceiling, not the End game/lightning.rs tick_thunder and game.rs loot_place_at check dim == Overworld
NaturalSpawner (NaturalSpawner.java:431): the spawn position search under a ceiling game/natural_spawning.rs:249 has_ceiling is dim == Nether
MapItem.update (MapItem.java:96, :122): map colours under a ceiling game/maps.rs checks dim == Nether
PlayerSpawnFinder (PlayerSpawnFinder.java:149): caveWorld spawn search world_spawn.rs assumes no ceiling

Effect

In a world whose Overworld uses overworld_caves, or any pack type with a ceiling, the following still behave as in the plain Overworld:

  • thunder and lightning still happen, and loot conditions see rain;
  • mobs spawn as if there were open sky;
  • maps draw the surface rather than the cave noise;
  • the spawn search ignores the ceiling.

The reverse holds for a pack Nether without a ceiling. A skyless Overworld also keeps its weather in the dim == Overworld checks.

Suggested fix

Read has_ceiling with the other dimension-type fields, store it beside has_skylight in the level's shape, and replace the dimension-id checks above with it. Split overworld_caves out of LevelHeight::vanilla with has_ceiling: true.

Check

Found by reading the code against the decompiled 26.3 sources while working on a fork change. It hasn't been reproduced in game yet. A data pack whose dimension/overworld.json uses "type": "minecraft:overworld_caves" shows each item above.

Originally created by @arismoko on GitHub (Nov 2, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7864 > 🤖 Filed by Aria's agent swarm, Dyna, not by Aria. Horizon never reads a dimension type's `has_ceiling`. Every place vanilla asks `dimensionType().hasCeiling()` instead checks whether the level is the Nether, or whether it is the Overworld. A data pack that gives a level a ceiling, such as the vanilla `minecraft:overworld_caves` type, or that removes one, therefore behaves differently from vanilla. ## Where - `crates/horizon-world/src/worldgen/overrides.rs`, `LevelHeight`: it reads `min_y`, `height`, `logical_height` and `has_skylight`, but not `has_ceiling`. `LevelHeight::vanilla` groups `minecraft:overworld_caves` with `minecraft:overworld`. Their build range and sky light are the same, but in vanilla `overworld_caves` has `has_ceiling: true`. - `has_ceiling` is required in vanilla's codec (`DimensionType.java:87`), so it is always present in a valid type. ## Vanilla readers and Horizon's stand-ins | Vanilla 26.3 | Horizon | |---|---| | `Level.canHaveWeather` (`Level.java:935-936`): sky light, no ceiling, not the End | `game/lightning.rs` `tick_thunder` and `game.rs` `loot_place_at` check `dim == Overworld` | | `NaturalSpawner` (`NaturalSpawner.java:431`): the spawn position search under a ceiling | `game/natural_spawning.rs:249` `has_ceiling` is `dim == Nether` | | `MapItem.update` (`MapItem.java:96`, `:122`): map colours under a ceiling | `game/maps.rs` checks `dim == Nether` | | `PlayerSpawnFinder` (`PlayerSpawnFinder.java:149`): `caveWorld` spawn search | `world_spawn.rs` assumes no ceiling | ## Effect In a world whose Overworld uses `overworld_caves`, or any pack type with a ceiling, the following still behave as in the plain Overworld: - thunder and lightning still happen, and loot conditions see rain; - mobs spawn as if there were open sky; - maps draw the surface rather than the cave noise; - the spawn search ignores the ceiling. The reverse holds for a pack Nether without a ceiling. A skyless Overworld also keeps its weather in the `dim == Overworld` checks. ## Suggested fix Read `has_ceiling` with the other dimension-type fields, store it beside `has_skylight` in the level's shape, and replace the dimension-id checks above with it. Split `overworld_caves` out of `LevelHeight::vanilla` with `has_ceiling: true`. ## Check Found by reading the code against the decompiled 26.3 sources while working on a fork change. It hasn't been reproduced in game yet. A data pack whose `dimension/overworld.json` uses `"type": "minecraft:overworld_caves"` shows each item above.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#6065
No description provided.