Skip to content

2.0.07: choose a clear, level build plot when the survival campaign starts - #21

Merged
MrHakan merged 1 commit into
mainfrom
ccr-5681ba59-e5pne2
Oct 9, 2026
Merged

MrHakan merged 1 commit into
mainfrom
ccr-5681ba59-e5pne2

Conversation

@MrHakan

@MrHakan MrHakan commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Summary

Item D3 of the 2.1.00 major plan.

Problem. The survival campaign always put its base corner two blocks east of the start. On rough ground that meant building walls into a hill or a tree, and the campaign only paused at the first blocked placement, long after it started.

Behaviour

  • Where the search runs. In a new world, startSurvival asks GrindPlot (pure, unit tested) for the nearest plot within 16 blocks that fits every building the tier will put up.
  • What it must fit. SurvivalBlueprint.footprint(tier) covers the houses, the diamond walkway, the max portal frame, and the whole enchanting area including the gap between table and shelves.
  • When a plot fits. All of these must hold:
    • nothing a build cannot replace (blocks, leaves, fluids) stands at or above floor level in the scan window;
    • the ground is solid, not a fluid;
    • the ground is at most two blocks low anywhere;
    • the ground is level under at least 80% of the floor.
  • Default first. The old corner is tried first, so starting on open level ground builds exactly where it always did.
  • When nothing fits. The campaign starts paused with a "No clear, level spot …" reason.
    • .grind resume accepts the old corner.
    • A restart in the same world searches again and keeps any registered storage.
  • Cost. LoadedTerrain reads each column's top non-replaceable block once, from loaded chunks only. In the game tests a search took 1–10 ms; the worst case read 1,304 columns and found nothing.
  • Shared layout. Structure offsets (PORTAL_X, ENCHANTING_X/Z) and the enchanting layout moved into SurvivalBlueprint, so the footprint and the tasks share one definition.

Tests

  • GrindPlotTest (9 unit tests):
    • level ground keeps the default corner;
    • an obstruction moves the corner to the nearest plot that fits;
    • leaves, water and unloaded chunks are refused;
    • 1–2 block dips are bridged, deeper holes are not;
    • the 80% support rule;
    • terraces within the floor range are accepted, those beyond it are refused;
    • "none" is reported when nothing fits;
    • the result is deterministic;
    • each tier's footprint contains its own buildings.
  • SurvivalTasksGameTest: builds a stone arena with a two-high pillar on every third column. The campaign must first pause with the reason. Once a clean patch is opened east of the start, it must pick a corner on that patch at floor level.
  • Existing scenario changed: the pressure-storage scenario now calls resume() after starting. That covers the case where the MAX buildings don't fit its arena. The call is a no-op when a plot is found, which is what happens in the flat test world.

Validation (local, Java 25 + Xvfb)

  • ./gradlew build: 941 tests, 0 failures.
  • tools/smoke-client.sh passed, including every AutoGrind scenario.
  • tools/test-baritone.sh passed against real Baritone 26.2.

Release

mod_version=2.0.07, with a CHANGELOG.md section.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TGuJsde5s6BFqgC63uNGrh


Generated by Claude Code

The campaign always built with its corner two blocks east of the start, so starting on rough ground meant walls into a hill or a tree and a pause at the first blocked placement, long after the start (item D3 of the major plan).

In a new world, startSurvival now asks GrindPlot (pure, unit tested) for the nearest plot within 16 blocks that fits every building the tier will put up: SurvivalBlueprint.footprint covers the houses, the diamond walkway, the max portal frame and the whole enchanting area, gap included. A plot fits when nothing a build cannot replace stands at or above the floor in the scan window, the ground is solid rather than a fluid, at most two blocks low anywhere, and level under at least 80% of the floor. The old corner is tried first, so starting on open level ground builds exactly where it always did. Terrain comes from a LoadedTerrain that reads each column's top non-replaceable block once, from loaded chunks only; the game tests measured 1 to 10 ms per search, 1,304 columns at worst.

When nothing fits, the campaign starts paused with a "No clear, level spot" reason. .grind resume accepts the old corner; a restart in the same world searches again, without forgetting registered storage. Structure offsets and the enchanting layout moved into SurvivalBlueprint so the footprint and the tasks share one definition.

SurvivalTasksGameTest builds a stone arena with a two-high pillar on every third column: the campaign must pause with the reason, then pick a corner on a clean patch opened east of the start. The pressure-storage scenario resumes past the new pause, since the MAX buildings may not fit its cleared area.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TGuJsde5s6BFqgC63uNGrh
Copilot AI balanced review requested due to automatic review settings October 9, 2026 11:48

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.

@MrHakan
MrHakan merged commit 27186bf into main Oct 9, 2026
1 check passed
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.

3 participants