Skip to content

Implement legacy data fixing via DataFixerUpper#4875

Open
screret wants to merge 23 commits into
GregTechCEu:1.20.1from
screret:sc/datafixerupper-1.20
Open

Implement legacy data fixing via DataFixerUpper#4875
screret wants to merge 23 commits into
GregTechCEu:1.20.1from
screret:sc/datafixerupper-1.20

Conversation

@screret
Copy link
Copy Markdown
Contributor

@screret screret commented May 27, 2026

What

Add DFU-based data fixers as a replacement to manual legacy data conversion

Implementation Details

The implementation primarily lives in GTDataFixers and the gtceu.common.datafixer package, though some utilities are also in gtceu.api.datafixer.
CommonEventListener.remapIds was removed in favor of handling the same logic with data fixers, as was TagCompatibilityFixer.fixMachineAutoOutputTag.

AI Usage

  • No, AI driven tools were not used for this pull request.
  • Yes, AI driven tools were used for this pull request.

Outcome

Though initial setup may be more annoying, this PR provides considerably more stable legacy data conversion for the future.

How Was This Tested

loaded a bunch of year+ old worlds and checked the logs if any missing IDs were reported. none were (except the ones I expected to appear).

Additional Information

The GT data version field should be bumped with EVERY save data change, no matter how minor. Same goes for adding fixers. All machines should be registered into new schemas. Do NOT put all of them into V0.

Register new datafixers in GTDataFixers#addFixers. Remember to bump GTCEu.GT_DATA_VERSION in every PR that changes existing save data and add a schema & fixer for it here.

For changes that do not change named types or add new (block) entities, use SAME_NAMESPACED for the schema. Register machines (and other block entities) in a schema overriding Schema#registerBlockEntities.

Reference vanilla schemas for more information on that, examples named below. Also check how they're used in vanilla's DataFixers class.
net.minecraft.util.datafix.schemas.V1460, net.minecraft.util.datafix.schemas.V1906
Note how only fields that use other registered types (such as item/fluid stacks) are defined. The same should be done for all types.

Potential Compatibility Issues

The auto output trait fix might? be wrong, not sure. I couldn't really test it because I managed to corrupt my freshest testing world before I figured out how to fix the forge registry ID map.

@screret screret requested a review from a team as a code owner May 27, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant