Feature World Disintegration - bh679/dungeon-train-mc GitHub Wiki

World disintegration — repeating Void & End bands

Since: v0.347.0 — PR #533 — initial repeating Overworld → Void → End-islands → Void cycle: real End terrain + chorus plants, End sky / fog / clouds, enderman-only spawns

Updated: v0.352.0 — PR #541 — the void + End sections now stay day-lit (a constant "End daylight" lightmap retint) instead of darkening at night

As the train travels, the world periodically breaks apart into a repeating cycle — Overworld → Void → End islands → Void → (repeat forever) — anchored to a fixed block distance from spawn. The train rides level through the whole thing; only its bed and rails survive the void.

The cycle

The phases tile forever along +X from disintegrationStartBlocks, and every cycle starts in the overworld (so the player spawns in normal terrain):

Phase What you see
Overworld normal terrain
fade the world erodes — terrain and the track's support pillars break apart, lower blocks first
Void empty space; the floating track suspended in it, the sky / fog turned to the End
fade floating End-stone islands fade in
End islands real End world-gen — islands + chorus plants
fade → Void → fade the islands dissolve back to void, then the overworld reforms and the cycle repeats

Phase lengths are config-driven (default 500 blocks each).

Real End terrain

The islands aren't an approximation — they are generated from the actual End noise router (final_density: the 2D end_islands function + the 3D BASE_3D_NOISE_END + the End vertical slide), trilinearly interpolated per block exactly like the End's NoiseChunk (sampled at the End's 8 × 4 noise-cell grid), then translated onto track level so they keep their real shapes and gaps. Chorus plants are grown by vanilla's Feature.CHORUS_PLANT, and only where the End biome at the sampled column is end_highlands — vanilla's own chorus distribution, so they cluster in patches instead of blanketing every island.

Atmosphere & mobs

  • Sky, fog and clouds crossfade to the End over the void + End stretches and back (client-side, repeating with the cycle).
  • Lighting crossfades to constant End daylight alongside the sky, so the End sections no longer darken at night — surfaces stay lit and shaded faces / undersides glow flatly like the real End. Cosmetic and per-player (a lightmap retint), so it doesn't change actual light levels or spawning.
  • Only endermen spawn inside the broken bands; ambient non-enderman spawns are cancelled (the train's own scripted spawns are untouched).
  • The bed + rails are preserved so the train stays rideable; the support pillars erode and break apart into the void below.

Configuration

config/dungeontrain-common.toml → [worldgen]:

Key Default Meaning
disintegrationEnabled true master toggle
disintegrationStartBlocks 0 blocks from spawn (world X=0) where the pattern is anchored
disintegrationFadeBlocks 120 length of each transition fade
disintegrationVoidHoldBlocks 500 length of each pure-void phase
disintegrationEndHoldBlocks 500 length of the End-island phase
disintegrationOverworldHoldBlocks 500 length of the overworld phase between repeats

One cycle = overworldHold + 4 × fade + 2 × voidHold + endHold. The anchor is measured in blocks from spawn, independent of carriage size or train position. Changing any value only affects chunks generated afterwards.

Implementation

  • Disintegration — pure, unit-tested band math: the periodic middleRamp (erosion + End sky/fog intensity) and endRamp (End-island fill), the deterministic erosion noise, and the island density thresholds.
  • DisintegrationFeature — worldgen feature (top_layer_modification): stamps the interpolated real-End islands and grows chorus.
  • WorldDisintegrationEvents — ChunkEvent.Load erosion that runs after all decoration (so trees that spill in from neighbouring chunks are cleaned up too), preserving End stone / chorus / bed / rails and removing orphaned block entities.
  • DisintegrationBand — resolves the band anchor + per-X ramps from config; BandMobSpawnEvents — the enderman-only rule; BedrockFloorEvents — drops the bedrock floor per column in void phases.
  • Client: ClientVoidBand + VoidSkyRenderer / VoidSkyEvents + a LevelRenderer mixin (End-sky overlay, fog darkening, cloud suppression) + LightTextureEndBandMixin (the constant-daylight lightmap retint — pins getSkyDarken toward noon and lifts each lightmap cell toward the End tint, both scaled by the band intensity).

Sable compatibility

The train's carriages are Sable sub-levels and are untouched by the erosion — only the surrounding overworld terrain and the level bed/rails are affected — so the train rides through the void and End stretches normally. Erosion writes go through raw chunk-section stamps (the same Sable-safe path as the bedrock floor), not Level.setBlock.

Known limitations

  • Lighting is a client-side approximation. The End sections are pinned to constant "End daylight" by retinting the rendered lightmap per-player (so they no longer darken at night), but it's cosmetic — the stored block/sky light is unchanged, so it doesn't affect mob spawning, and dedicated shader packs that replace the vanilla lightmap bypass it. True dimension-level End lighting (real skylight-free flat ambient) would still mean routing the train through an End-lit dimension segment — a separate, larger change.
  • No End cities or gateways. Only End terrain + chorus plants are generated; multi-chunk structures aren't grafted in.
  • Generated chunks are fixed. Changing the config only affects newly-generated chunks; already-generated terrain keeps whatever state it had.