Repository navigation
Support legacy save migration for XML machines - #115
Merged
dshadowwolf merged 2 commits intoNov 18, 2026
Merged
Conversation
dshadowwolf
reviewed
Nov 18, 2026
dshadowwolf
left a comment
Collaborator
There was a problem hiding this comment.
Review findings (read from the diff only; I did not run tests or the game). Only one minor point came up.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Steam Advantage and Electric Advantage need a way to keep existing machines readable when they move to XML. MMDLib previously constructed the final
DefinedMachineEntityclass for every XML machine, including when Minecraft loaded a block entity from disk.Mods can now extend
DefinedMachineEntityand register a constructor for a concrete XML machine ID withMachineContent.registerEntityFactory. Placement and world loading both use the registered constructor. A subclass can overridemigrateMachineDatato translate legacy NBT before MMDLib restores storage and processor state. Client synchronization bypasses this hook.The XML machine guide includes an example. Each consuming mod supplies its own key mappings and handles any renamed registry IDs.
Verification
All 14 focused porting GameTests passed locally. The new companion test covers placement, loading a synthetic legacy energy field through Minecraft’s block-entity registry, saving and reloading the current format, and client update handling. The machine import boundary and staged whitespace checks passed. Real Steam Advantage and Electric Advantage saves still need downstream validation.