Skip to content

Add composable machine features and XML multiblocks - #116

Open
faceofcat wants to merge 4 commits into
master-2.0-1.21.1-neofrom
codex/xml-machine-features
Open

faceofcat wants to merge 4 commits into
master-2.0-1.21.1-neofrom
codex/xml-machine-features

Conversation

@faceofcat

Copy link
Copy Markdown
Collaborator

Changes

  • Add inheritable XML machine features, drawer controls, and compact declarations that define storage and its screen layout together.
  • Preserve redstone controls on machines that inherit the common base. New faces default to ignoring input, and saved settings take precedence. Configurable side drawers on unpowered XML machines can be enabled with the side-configuration feature.
  • Add fixed-layout XML multiblocks for Java-registered controllers, including member blocks, clearance rules, and capability ports.
  • Show fluid reservations and blocked outputs in machine screens and add manual tank drain valves. Chance-based item outputs now use available space after reserved outputs, so a full bonus inventory does not block a recipe such as the Sewage Filter.
  • Add coverage for XML inheritance, multiblock loading, reservation sync, and output handling.

Validation

Spotless formatting, Git diff checks, and machine XML parsing passed locally. Runtime tests are deferred to PR CI.

Industrial Overkill will update its MMDLib dependency after an artifact containing these changes is published.

@dshadowwolf dshadowwolf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at medium depth. Only one finding held up after I checked it against the head commit; it's below.

return definition.behavior().feature(type)
.map(MachineFeatureDefinition::drawerSettings)
.orElse(DECLARED_DRAWERS.contains(type)
? DrawerSettings.HIDDEN

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Existing XML machines silently lose drawers.

If the definition doesn't declare a matching feature, side config, stats, curios and backpack now default to HIDDEN, and BuiltinMenuComponents no longer creates AutomationMenu unless the layout has a side-config drawer. base_machine.xml declares stats, curios and backpack but not mmdlib:side_config, so any unpowered machine that extends it loses its side-configuration drawer when it updates. This PR had to add <feature id="automation" type="mmdlib:side_config"/> to admission_demo, porting_workshop and simple_lava_furnace for that reason. A version-1 machine that doesn't extend base_machine loses stats, curios and backpack as well.

Making side config opt-in for unpowered machines is fine (the PR description says so). The problem is that downstream XML (Industrial Overkill, and the Advantage 3 mods once they move to XML machines) changes with no error and no note. There's a version-1 shorthand that keeps <redstone enabled="true"/> working, but nothing like it for side config.

Suggestion: add a CHANGELOG entry under 2.0.3 that names the feature line unpowered machines now need, and add a note to the XML machines docs. Alternatively, log a warning at load when a machine has configurable resources but no side_config feature.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching the migration gap. 4b9c203 adds the Side Configuration feature declaration to the 2.0.3 changelog and links to the XML guide, which also lists the Statistics, Curios, and Backpack declarations for standalone machines. I checked all four examples against the shipped base definitions.

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