Skip to content

Sulfur Caves phase (MC 26.2), version-gated phase index, and phase order GUI#539

Merged
tastybento merged 3 commits into
developfrom
feat/sulfur-caves-phase-index
Jul 20, 2026
Merged

Sulfur Caves phase (MC 26.2), version-gated phase index, and phase order GUI#539
tastybento merged 3 commits into
developfrom
feat/sulfur-caves-phase-index

Conversation

@tastybento

Copy link
Copy Markdown
Member

What this does

Three features building on each other, in three commits:

1. Sulfur Caves phase + version gating (5a987cf)

  • New Sulfur Caves phase at the 15000 spot with wiki-accurate mob weights (Sulfur Cube 100, Creeper/Skeleton/Zombie 50 each, Slime 25, Cave Spider 20, Enderman 10, Witch/Zombie Villager 5, ambient Bat 10 — the 315-weight monster table), ~1750 total block weight mixing sulfur/cinnabar with typical underground blocks, and themed chests including the Bounce music disc. The goto loop moves from 15000 to 15500.
  • New phases_index.yml: read before any phase file, listing every phase with file, section, name, length, optional enabled and requiredMinecraftVersion. Start blocks are the running sum of lengths, so a skipped phase collapses out of the progression.
  • Phases declaring requiredMinecraftVersion: '26.2' are skipped with one info log on older servers without their files ever being parsed — this matters because YamlConfiguration eagerly deserializes ItemStacks during parsing, which threw stack traces for unknown items on older servers.
  • Legacy installs get an index generated automatically from their existing files; a malformed index falls back to the old direct folder scan.
  • Chest files are read with plain SnakeYAML and each item is built individually — items unknown to the server version (e.g. pink_harness on 1.21.5) are skipped with a log line instead of a stack trace.
  • Block/mob entries accept an object form with weight + requiredMinecraftVersion, used for DRIED_GHAST (1.21.6) in The Nether.

2. Length-based phase model (4f7a319)

  • New PhaseIndexEntry class; OneBlocksManager keeps the live index (including disabled/version-skipped entries) plus gotoAtEnd, exposing getPhaseIndex()/saveIndex() so tools can reorder entries, save, and reload.
  • Loaded phases reference their index entry; saving a phase (e.g. /oba setchest) writes back to its stable file name and section key instead of deriving them from the computed start block.

3. Phase order GUI (a9b71ad)

  • New /oba phases admin command (permission aoneblock.admin.phases) opens a panel showing every phase in order with computed start, length, and state.
  • Click a phase to pick it up — the rest shrink left. Click a phase to shove it and everything after it right and drop there, or use the drop-at-end slot. Click anywhere else or close the panel to put it back without saving. Right-click toggles a phase on/off. Drops and toggles save the index and reload phases immediately.
  • Disabled phases render as gray glass, version-locked ones as barriers; both can still be reordered.

Testing

  • 542 tests pass (34 added): version comparison, index generation/migration, gated-phase skipping (proved by planting an invalid-YAML chest file that would error if parsed), disabled-phase collapse, malformed-index fallback, unknown-chest-item skipping, versioned block/mob entries, index reorder round-trip, stable save naming, and the GUI pick-up/drop/toggle logic.
  • Manually verified on Paper 26.2 (sulfur phase loads and plays) and Paper 1.21.5 (phase skipped with one info line, no stack traces, island creation works).

🤖 Generated with Claude Code

https://claude.ai/code/session_01VahJUVuDRo5kRSDZKJHHjC

tastybento and others added 3 commits July 19, 2026 17:25
Adds a Sulfur Caves phase at the 15000 spot with wiki-accurate mob
spawn weights (Sulfur Cube 100, Creeper/Skeleton/Zombie 50 each,
Slime 25, Cave Spider 20, Enderman 10, Witch/Zombie Villager 5,
ambient Bat 10), sulfur and cinnabar blocks mixed with typical
underground blocks, and themed chests. The goto loop moves from
15000 to 15500.

Because the biome, blocks, mobs, and chest items only exist from
Minecraft 26.2, phases can now declare requiredMinecraftVersion and
are skipped with an info log on older servers:

- New phases_index.yml is read before any phase file, so gated
  phases are skipped without their files ever being parsed. This
  matters because YamlConfiguration eagerly deserializes ItemStacks
  during parsing, which threw errors for unknown items. The index
  also carries per-phase order, length, and enabled state (start
  blocks are the running sum of lengths), preparing for admin phase
  reordering. Legacy installs get an index generated automatically;
  a malformed index falls back to direct file loading.
- Chest files are now read with plain SnakeYAML and each item is
  built individually, so an item unknown to the server version is
  skipped with a log line instead of a stack trace.
- Block and mob entries accept an object form with a weight and
  requiredMinecraftVersion, used for DRIED_GHAST (1.21.6) in The
  Nether phase.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VahJUVuDRo5kRSDZKJHHjC
Turns the phase index into a first-class in-memory model to prepare
for admin phase reordering:

- New PhaseIndexEntry holds file, section, name, length, enabled,
  and requiredMinecraftVersion. OneBlocksManager keeps the live list
  (including disabled/version-skipped entries) plus gotoAtEnd, and
  exposes getPhaseIndex()/saveIndex() so tools can reorder entries,
  save, and reload. Start blocks are recomputed from the new order's
  lengths on reload.
- Loaded phases keep a reference to their index entry. Saving a
  phase now writes back to its stable file name and section key
  instead of deriving them from the computed start block, so
  /oba setchest keeps working after phases move.
- saveOneBlockConfig writes the index too and no longer writes a
  file for the synthetic end-goto phase, which gotoAtEnd covers.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VahJUVuDRo5kRSDZKJHHjC
New admin panel (permission aoneblock.admin.phases) showing every
phase index entry in order with its computed start block, length,
and state. Click a phase to pick it up - the rest shrink left to
fill the gap. Click a phase to shove it and everything after it
right and drop the held phase there, or use the drop-at-end slot.
Clicking anywhere else or closing the panel puts the phase back
without saving. Right-click toggles a phase on or off.

Drops and toggles save the phase index and reload the phases, so
the new order takes effect immediately. Disabled phases show as
gray glass and version-locked phases as barriers; both can still
be reordered.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VahJUVuDRo5kRSDZKJHHjC
@tastybento
tastybento merged commit e003d4d into develop Jul 20, 2026
2 checks passed
@tastybento
tastybento deleted the feat/sulfur-caves-phase-index branch July 20, 2026 01:07
@tastybento tastybento mentioned this pull request Jul 20, 2026
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.

1 participant