Skip to content

Add reservation-aware machine processing and a playable companion mod - #90

Merged
dshadowwolf merged 73 commits into
master-2.0-1.21.1-neofrom
machine-processor
Nov 4, 2026
Merged

dshadowwolf merged 73 commits into
master-2.0-1.21.1-neofrom
machine-processor

Conversation

@faceofcat

@faceofcat faceofcat commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Machines can now run recipe cycles while reserving their inputs and output space, preserve progress across saves and interruptions, and synchronize processor state and reservations with their menus. A separately packaged companion mod demonstrates the API with four playable machines.

Changes

  • Add slot/tank reservation plans, transactional cycle completion and rollback, recipe processors, and a feature host for ticking, persistence, and synchronization.
  • Respect reservations in automation and menu interactions, including client prediction, partial transfers, interruption/resume, and multiple processors sharing storage. Preserve contents correctly when machines are broken or replaced.
  • Add the optional mmdlib_companion source set and jar: Crusher, one-slot Converter, Dual Crusher, and Creative Power Source. Keep companion and test content out of the library jar.
  • Add reusable energy gauges and bookmark-style information drawers; update recessed slots, shaded progress arrows, and fluid rendering. The Crusher's water/lava preview tank supports held and cursor fluid containers without mixing fluids.
  • Fix persistence after in-place shift-click merges and partial extraction: server-side machine slots now notify the block entity when vanilla changes a stack directly.
  • Document the processor, reservations, screen components, and companion setup.
  • Merge the latest base build/release changes, migrate companion runs to ModDevGradle, and consolidate CI into build_status.yml. Remove duplicate ci.yml while retaining library GUI smoke tests with/without JEI, adding the companion smoke, and preserving diagnostic artifacts.

Validation

  • ./gradlew check passed after integrating base commit 1a11cdc: 91 JUnit tests and 76 server game tests (65 library, 11 companion), plus asset, import, and packaging checks.
  • Both shift-click persistence regressions failed before the fix and pass afterward. They check the chunk save flag and saved item counts; a rejected transfer leaves the save flag unchanged.
  • runCompanionClientSmoke passed under ModDevGradle, opening all four networked menus and checking synchronized values and fluid-container transfers. Partial, full, and empty gauges were visually inspected during UI validation.
  • The library GUI smoke passed with and without JEI under the merged build setup. Consolidated workflow YAML parsed successfully.
  • build verifyReleaseClasses verifyCompanionPackaging passed after the GUI runs, confirming release artifacts exclude injected test content.

Integration note

The build/release-system changes from #89 are merged into this branch with a merge commit; existing feature history is preserved. The shared base workflow now owns build/check and GUI validation, without a second duplicate check job.

faceofcat and others added 30 commits November 3, 2026 03:29
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018zpP6ZrFjaGe477FvWAZKo
…fusal

place caps each slot and tank by what is physically there once the recipe's
own take has run, and keeps a different item or fluid out until then.
restore returns false instead of throwing or ignoring, and is documented as
the loading path. Skip and bypass tests now fail without the code they cover.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018zpP6ZrFjaGe477FvWAZKo
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018zpP6ZrFjaGe477FvWAZKo
A processor's state now carries paused, resume recipe and progress beside the cycle.
A cycle that won't decode, can't be put back, or needs an energy group that is gone
cancels; restore releases a running cycle first, since storages keep their plans.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018zpP6ZrFjaGe477FvWAZKo
interrupt() releases the cycle and remembers its recipe and progress; resume() lets the
next tick reserve that recipe again, keeping progress only if it still fits.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018zpP6ZrFjaGe477FvWAZKo
… time

A paused processor saves the time its recipe took; if the current definition takes
longer or shorter, resume restarts it from 0 rather than carrying the old ticks over.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018zpP6ZrFjaGe477FvWAZKo
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018zpP6ZrFjaGe477FvWAZKo
…it goes away

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018zpP6ZrFjaGe477FvWAZKo
…al connection

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018zpP6ZrFjaGe477FvWAZKo
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018zpP6ZrFjaGe477FvWAZKo
@dshadowwolf

Copy link
Copy Markdown
Collaborator

Must Fix:

  1. Clearing a machine can leave it paused for good
  2. Idle machines scan every recipe on every tick

Concerns:

  1. Reserved slots are protected by patching individual vanilla click types
  2. Only one storage type sends its reservation plans to the client

Duplicate Logic:

  1. The client's copy of the reservation rules is a near line-for-line duplicate of the server's
  2. Plan tracking and rollback are written twice
  3. The demo block's drop-on-remove logic is copied
  4. digits.png is still shipped and generated, but nothing uses it

@faceofcat

Copy link
Copy Markdown
Collaborator Author

@dshadowwolf Addressed in a4cc45c:

  • Clearing now resets each processor's pause, progress and reservations, so fresh inputs restart normally.
  • Failed recipe searches wait for item/fluid storage changes, with a 20-tick fallback for custom groups and recipe reloads; running cycles remain unthrottled.
  • Reservation-aware slots expose only the free portion during interactions, replacing the click-type guard and supporting safe hotbar/offhand swaps.
  • Reservation snapshots now use ReservedSlots.plan() instead of an ItemStorage type check, including custom wrappers.
  • Shared client/server item reservation enforcement and item/fluid plan tracking/rollback; centralized drop-on-remove handling; removed unused digits.png and its generator code.
  • Added regressions for clear/restart, idle searches, input/fluid changes, recipe reloads, wrapped-handler sync/release and swaps. Both must-fix regressions failed before the fixes and pass afterward.
  • Local validation passed: 93 JUnit tests, 80 server game tests, companion client smoke, library GUI smoke with/without JEI, and release/companion packaging checks.

@faceofcat

Copy link
Copy Markdown
Collaborator Author

Follow-up in ae540bc: keep the demo companion jar out of MMDLib release uploads.

  • companionJar now writes to build/companion/libs, outside the library upload directory.
  • GitHub/CurseForge uploads select only the exact MMDLib main, sources and Javadoc filenames for the release tag.
  • Packaging checks reject companion jars in the library release directory or Maven publication, including stale output from older builds.
  • Confirmed the stale-output guard fails as expected; a clean build passed with 93 unit tests, 80 server tests and packaging checks. Verified three library jars and one separately located companion jar.

@dshadowwolf
dshadowwolf merged commit cd46909 into master-2.0-1.21.1-neo Nov 4, 2026
5 checks passed
@faceofcat
faceofcat deleted the machine-processor branch November 4, 2026 16:30
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.

2 participants