Skip to content

2.0.04: move AutoGrind's step classes out of GrindExecutor - #18

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

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

Conversation

@MrHakan

@MrHakan MrHakan commented Oct 8, 2026

Copy link
Copy Markdown
Owner

Summary

This is the first step of item D1 in the 2.1.00 major plan. It is an architecture-only change, and AutoGrind behaves exactly as before.

GrindExecutor was 1,650 lines. Half of that was six inner task classes that reached into the executor implicitly. Each is now a top-level class in services:

Step Class
Gathering a raw resource GrindGatherTask
Moving an offhand ingredient GrindOffhandTask
Placing a station GrindPlaceStationTask
Opening a station GrindOpenStationTask
Crafting GrindCraftTask
Smelting GrindSmeltTask

Each class holds the executor as g and reaches shared state through g.x. SurvivalTasks already uses this pattern. The members the classes need are now package-private. The executor is down to 814 lines.

Why behaviour is unchanged

  • The compiler drove the move:
    1. The classes were cut out unchanged.
    2. Every unresolved outer reference was prefixed from javac's own errors (g. for instance members, GrindExecutor. for static ones).
    3. Every member javac reported as inaccessible was opened.
  • Because of that, no name can bind to anything new.
  • The 788 moved lines match the originals apart from those prefixes and the line breaks in the constructors.

Validation (local, Java 25 + Xvfb)

  • ./gradlew build: 917 tests, 0 failures.
  • tools/smoke-client.sh passed on this tree, including every AutoGrind scenario.
  • tools/test-baritone.sh passed against real Baritone 26.2. It covered 384-block travel, remote mining, rebuilding a tool mid-goal, returning to an unloaded base, door and chest access, and replacement-goal ownership.

Release

mod_version=2.0.04, with a CHANGELOG.md section.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TGuJsde5s6BFqgC63uNGrh


Generated by Claude Code

GrindExecutor was 1,650 lines, half of it six inner task classes reaching into the executor implicitly. Gathering, moving an offhand ingredient, placing and opening a station, crafting and smelting are now top-level classes (GrindGatherTask, GrindOffhandTask, GrindPlaceStationTask, GrindOpenStationTask, GrindCraftTask, GrindSmeltTask). Each holds the executor as g and reaches shared state as g.x, the pattern SurvivalTasks already uses; the members they need are package-private. The executor is down to 814 lines.

The move was driven by the compiler: classes were cut out unchanged, then every unresolved outer reference was prefixed and every inaccessible member opened from javac's own errors, so no name could bind to anything new. The 788 moved lines match the originals apart from those prefixes and constructor line breaks. Release as 2.0.04.

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 8, 2026 10:38

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 3ecbf30 into main Oct 8, 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