Skip to content

Make machine GUIs extensible with element-owned behavior - #103

Merged
dshadowwolf merged 9 commits into
master-2.0-1.21.1-neofrom
codex/extensible-machine-ui
Nov 10, 2026
Merged

dshadowwolf merged 9 commits into
master-2.0-1.21.1-neofrom
codex/extensible-machine-ui

Conversation

@faceofcat

@faceofcat faceofcat commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Machine screens previously centralized element drawing, input, storage assumptions and feature-specific synchronization in the screen/menu. This follow-up to #97 moves those responsibilities into extensible elements, inventory adapters and menu components, so mods can supply their own controls and storage behavior through public contracts.

Changes

  • Make Element an open common interface, with inheritable controls in gui.model.elements and layouts in gui.model.containers. Fluid tanks and energy gauges own their snapshots, presentation and interactions; sprite/progress and coloured-group elements compose reusable displays.
  • Keep machine and addon inventories separately backed. InventoryElement contains item/ghost slot elements, with dedicated player inventory/armour/offhand elements. Slot factories, bindings, roles, placement, native rendering, hit bounds, hints, reservations and shift-click routing are overridable while shared code enforces identity and acceptance rules.
  • Route XML construction, renderers, behaviors, drawers and menu contributions through extension APIs. Add ElementType common declarations and client-only ElementClient attachments that forward to the existing registries; migrate built-ins and preserve renderer/behavior inheritance and XML aliases.
  • Share input, focus/capture, navigation, tooltip composition and ingredient-drop handling across screens and embedded fragments. Elements and parents own their tooltip rows; replacing native item rows preserves parent context. Presentation contracts own group labels/highlights, display values, gauge fills and filter samples.
  • Move action-session bookkeeping and typed component synchronization out of the menu. Extend value types, statistics and timescales through public contracts. Keep server authorization, bounded codecs, cursor/session/revision checks, replay protection and pending inventory locks in the shared runtime.
  • Let container providers own page policy, descriptions and per-gesture instructions. Virtual container cells use ordinary element rendering/input, custom hit bounds and validated fallback transfers. Drawers own their feature behavior and participate in generic layout and dispatch.
  • Connect redstone dust to configured Read faces and Emit faces with a selected output source; Ignore faces stay disconnected. Keep zero-strength outputs connected, refresh existing dust when configuration changes, and synchronize connection configuration for Java and XML machines.
  • Fix review findings: defer collision-free default slot IDs, omit unused LegacySlot metadata, avoid observer pulses on machine load, use weak identity keys for component freshness, reject foreign element actions safely, and bound container pages by provider geometry.
  • Expand unit/server and focused client regression coverage, update the public API documentation, and add a complete custom fluid element walkthrough with storage persistence, server clicks, client drawing and XML registration.

Compatibility and review notes

  • Java callers must migrate nested element types/imports to the standalone model classes and account for named, separately backed inventories. Existing XML aliases and widget compatibility adapters remain supported.
  • Network schemas changed, including container protocol 19; clients and servers need matching library versions.
  • The changed Java files follow the base branch's new ratcheted Spotless formatter and explicit-import rules; unrelated files were not reformatted. Spotless downloads the same pinned Eclipse 4.35 distribution through the FAU mirror to avoid primary-host connection timeouts in CI.

Validation

  • Final merged tree: gradlew check build javadoc --offline, including Spotless/import fixtures, 374 unit tests, 81 companion + 93 library server GameTests, and packaging checks.
  • Redstone connection regression checks cover Java/XML machines, all horizontal orientations, saved dust geometry, zero/nonzero output, Read input gating, mode changes, missing sources, persistence and client update tags. The focused runCompanionClientSmoke -PredstoneConnectionSmokeOnly run passed for actual drawer requests and client-world Emit/Ignore/Read updates; the user also confirmed the Read-face fix in game.
  • Review-fix validation: gradlew spotlessApply check build javadoc --offline, plus focused -PredstoneConnectionSmokeOnly and -PdrawerSmokeOnly client runs. Added regressions for each review finding.
  • Final focused client run: runCompanionClientSmoke -PinheritanceSmokeOnly; inherited tank/energy/progress drawing and bucket interactions passed, with the resulting screenshot inspected.
  • Earlier targeted drawer checks cover real transfers, cell rendering/input, tooltip composition, pending locks and gesture cancellation. Additional focused runners cover the extension contracts introduced throughout the change; the full client suite remains enabled in CI.
  • All six Java files extracted from docs/custom-fluid-element.md compile against this checkout. XML namespace, translation keys, links and whitespace were checked.
  • CI follow-up: baseline GUI smoke checks now use drawer-owned exclusion geometry, registered gauge renderers, slot-element icons and typed side-mode fields. Library GUI runs also passed locally with and without JEI.
  • Final commit 06afa85: all checks passed in both PR CI and push CI, including the full companion GUI suite and library GUI suites with and without JEI. The latest master-2.0-1.21.1-neo is included.

@dshadowwolf
dshadowwolf merged commit 5380884 into master-2.0-1.21.1-neo Nov 10, 2026
5 checks passed
@faceofcat
faceofcat deleted the codex/extensible-machine-ui branch November 10, 2026 15: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