Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
dc8e116
Implement DataFixerUpper
screret May 21, 2026
7c1cc76
start adding GT fixers
screret May 21, 2026
44f0e4f
Move `GT_DATA_VERSION` field to GTCEu.java
screret May 23, 2026
b445014
Formatting changes
screret May 23, 2026
9b20cd0
Add the remaining 150 or so GT machines to V0 schema
screret May 23, 2026
b8a26d7
Convert (almost) all existing "fixers" into proper data fixers
screret May 23, 2026
7c41454
Add TODO
screret May 23, 2026
0886cd9
Exclude OPTIONS fixer type from being processed by us
screret May 23, 2026
827cb71
saner GT data version & explanatory comment
screret May 23, 2026
2eadd02
Lazy
screret May 23, 2026
ba1ed0e
Fix namespaced IDs
screret May 23, 2026
f8f8982
Rename `getModDataVersion` to `getGTDataVersion` and `addModDataVersi…
screret May 27, 2026
fd60466
Delete DataFixerEntry
screret May 27, 2026
05bdc3d
Make vanilla schema initialization lazy
screret May 27, 2026
1f9615a
Add extra utility functions for updating from specific source data ve…
screret May 27, 2026
d09c87f
Inject fixers to Forge registry ID maps
screret May 27, 2026
c2a3319
Simplify datafixer handling; we don't need handling for multiple mods…
screret May 27, 2026
194ae3d
Remove `TagPrefix.invertedName`; that code was for updating to **1.0.…
screret May 27, 2026
6610614
change schema variable names and some strings
screret May 27, 2026
a6ad070
remove unnecessary hook() from fluid stack type
screret May 27, 2026
d8db52f
Merge branch '1.20.1' into sc/datafixerupper-1.20
screret May 27, 2026
1e77cbb
Remove defined fields that don't use named types (like items/fluids)
screret May 27, 2026
3b232e3
add javadoc describing what, why & how
screret May 27, 2026
549a1e8
Merge branch '1.20.1' into sc/datafixerupper-1.20
screret Aug 18, 2026
8fc7b86
Add "automatic" namespaced schema util thing
screret Aug 18, 2026
0e2b935
Create LDLib payload wrapper remover fix
screret Aug 18, 2026
7a8e40e
Convert trait holder fix to a DFU fixer
screret Aug 18, 2026
d28822b
Use types in trait holder-ification fix (I think this is required?)
screret Aug 18, 2026
d00add3
delete stuff that didnt work
screret Aug 18, 2026
b39e9dc
Upwards facing property fixer
screret Aug 18, 2026
f4f524e
Reorder fixes so we can insert UpwardsFacingPropertyFix into the corr…
screret Aug 18, 2026
03b2528
touch up the commented-out "future" rename fixes
screret Aug 18, 2026
a6b4654
Merge branch '1.20.1' into sc/datafixerupper-1.20
screret Aug 18, 2026
f0c19c8
"pattern cases in switch statements is a preview feature."
screret Aug 18, 2026
1f478a5
spotless + datagen
screret Aug 18, 2026
880b589
Kill logging.
screret Aug 18, 2026
fd47b36
Add a material rename fixer
screret Aug 18, 2026
864072f
Fix the forge registry data schema
screret Aug 18, 2026
ab4519b
pre-emptively add GT materials to forge registry data schema (Is this…
screret Aug 18, 2026
e6ab16e
Fix tungsten steel fluid cell renamer not renaming the correct thing
screret Aug 18, 2026
b263738
ACTUALLY RENAME THE PALLADIUM SUBSTATION CASING BLOCK/ITEM SO THE FIX…
screret Aug 18, 2026
2d86979
spotless
screret Aug 23, 2026
1fde663
Undo palladium substation casing rename (to be done in a separate PR)
screret Aug 23, 2026
9dd535d
nicer names for yet-to-exist material rename fixers
screret Aug 23, 2026
6c9de3a
Merge branch '1.20.1' into sc/datafixerupper-1.20
screret Aug 23, 2026
67c3872
Merge branch '1.20.1' into sc/datafixerupper-1.20
gustovafing Aug 25, 2026
ca3acd4
Merge branch '1.20.1' into sc/datafixerupper-1.20
screret Aug 30, 2026
74c642a
Merge branch '1.20.1' into sc/datafixerupper/1.20.1
screret Oct 9, 2026
0664f2d
Change schema version numbering
screret Oct 9, 2026
4efa1d7
Add schema for new machines and translate the molten fluid rename fix…
screret Oct 9, 2026
b7ed3d0
Fix the IDs of some casings and materials that were either backwards …
screret Oct 9, 2026
fac59cf
you dont need to create an itemstack just to get the item!!!!
screret Oct 9, 2026
f55839d
Add this line back to the gitignore (I deleted it accidentally)
screret Oct 9, 2026
0bd9bd1
Revert "Add this line back to the gitignore (I deleted it accidentally)"
screret Oct 9, 2026
ce4d3a1
Revert "you dont need to create an itemstack just to get the item!!!!"
screret Oct 9, 2026
b021127
Merge branch '1.20.1' into sc/datafixerupper/1.20.1
screret Oct 10, 2026
28b85d4
oops!
screret Oct 10, 2026
3c5a5d5
datagen + spotless
screret Oct 10, 2026
45d3c1f
??????
screret Oct 10, 2026
4dbaff5
Fix Raw Palladium's name
screret Oct 11, 2026
6e8c169
Move clear glass lens lang change to the correct place
screret Oct 11, 2026
70c6226
Replace the single turbine rotor item with per-material items
screret Oct 11, 2026
6363dd5
Remove unused lang keys
screret Oct 11, 2026
63910cf
Extract the common part of arc furnace/macerator recycling recipe logic
screret Oct 11, 2026
567fe54
Make ItemStackTurbineRotorFix also move the "Damage" NBT tag to the r…
screret Oct 11, 2026
6ae7156
oops! cyclic dependency!
screret Oct 11, 2026
acf6b2f
ope, can't pass the namespace as an argument because the types are cr…
screret Oct 11, 2026
dc4d1b3
THE RED GRANITE RENAME FIX RENAMED THINGS IT SHOULDN'T'VE
screret Oct 11, 2026
878dd1a
make ForgeHooksMixin smaller
screret Oct 11, 2026
ca952a7
Make sure the fixes actually only rename the things they're supposed to
screret Oct 11, 2026
e3e6ea3
Fall back to iron rotor if the nbt is invalid in ItemStackTurbineRoto…
screret Oct 11, 2026
e88a4c5
Merge branch '1.20.1' into sc/datafixerupper/1.20.1
screret Oct 11, 2026
c637d98
WHOOPS
screret Oct 11, 2026
8509671
the way I renamed the old turbine_rotor item didn't work, let's try this
screret Oct 11, 2026
b5516b9
Add fixer for remapping the (ancient) (duplicate) GT milk fluid
screret Oct 11, 2026
6103fdf
I forgot buckets. and non-default fluid states.
screret Oct 11, 2026
13663af
Remap the removed extruder molds to blanks
screret Oct 11, 2026
80956ce
spotless
screret Oct 12, 2026
de8432d
Patch the modernfix structure cache to include us in the data version…
screret Oct 12, 2026
c265559
oops!
screret Oct 12, 2026
9cf1ed1
Automatic namespace addition is a bust, removing
screret Oct 12, 2026
9cc674e
Add fixer for fixing the Rotary Hearth Furnace's and Bulk Blast Chill…
screret Oct 13, 2026
0b2c12d
Backport a fix from (a newer version of DFU)[https://github.com/Mojan…
screret Oct 13, 2026
0dee4a3
IT WORKSSS
screret Oct 13, 2026
6be3b51
datagen + spotless
screret Oct 13, 2026
01b55bc
Change the config option's wording
screret Oct 15, 2026
7c87849
Add developer doc on datafixers
screret Oct 15, 2026
316aa8d
requested changes
screret Oct 15, 2026
de0b24d
Merge branch '1.20.1' into sc/datafixerupper/1.20.1
screret Oct 24, 2026
5a36746
Add comment on the ModernFix structure cache mixin
screret Oct 24, 2026
5573026
Revert "Replace the single turbine rotor item with per-material items"
screret Oct 24, 2026
d9f23f7
Fix language keys
screret Oct 24, 2026
4820e7c
oops
screret Oct 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/.gradle/
/output/
/bin/
/libs/

.classpath
*/.factorypath
Expand Down
47 changes: 47 additions & 0 deletions docs/content/Development/General-Topics/Datafixers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
title: Datafixers
---

# What are datafixers?
Datafixers are Mojang's solution to resolving save data layout changes, such as items being renamed or entities' NBT fields moving.<br>
> From [Documented DataFixerUpper's overview summary](https://kvverti.github.io/Documented-DataFixerUpper/snapshot/overview-summary.html):<br>
Data Fixer Upper (or DFU for short) is a library for creating transformations between structures, regardless of the specific schemas or storage formats the structures use. Users of DFU will generally use two sets of types: the serialization types and the data fix types. An overview of the relevant packages is given below, but see the documentation of those packages and types for more details.

TL;DR: DataFixerUpper is a full typed functional programming language written entirely in Java. It's overengineered, but can accomplish every change Mojang could ever want to do.<br>


# How to add datafixers

Register new datafixers in [`GTDataFixers.addFixers`](https://github.com/GregTechCEu/GregTech-Modern/blob/1.20.1/src/main/java/com/gregtechceu/gtceu/common/data/datafixer/GTDataFixers.java#L108). Remember to bump [`GTCEu.GT_DATA_VERSION`](https://github.com/GregTechCEu/GregTech-Modern/blob/1.20.1/src/main/java/com/gregtechceu/gtceu/GTCEu.java#L50)
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`](https://github.com/GregTechCEu/GregTech-Modern/blob/1.20.1/src/main/java/com/gregtechceu/gtceu/common/data/datafixer/GTDataFixers.java#L71) for the schema.
Register machines (and other block entities) in a schema overriding `Schema#registerBlockEntities`, like [`V2_3` does](https://github.com/GregTechCEu/GregTech-Modern/blob/1.20.1/src/main/java/com/gregtechceu/gtceu/common/datafixer/schemas/V2_3.java#L21).

!!! danger
Do **NOT** add new machines to [`V0`](https://github.com/GregTechCEu/GregTech-Modern/blob/1.20.1/src/main/java/com/gregtechceu/gtceu/common/datafixer/schemas/V0.java)! They should be in new, correctly versioned schemas!

!!! note "References"
Reference vanilla schemas for more information on them (examples below). Also check how they're used in vanilla's `net.minecraft.util.datafix.DataFixers` class.
`net.minecraft.util.datafix.schemas.V1460`, `net.minecraft.util.datafix.schemas.V1906`


## Adding new (block) entity types

Note how only fields that use other registered (named) types (such as item/fluid stacks) are defined. The same should be done for all types.
If the type doesn't depend on any named types, register it with `schema.register()` like this:
??? example "registerBlockEntities"
```java
public Map<String, Supplier<TypeTemplate>> registerBlockEntities(Schema schema) {
Map<String, Supplier<TypeTemplate>> map = super.registerBlockEntities(schema);
// ...
schema.register(map, "gtceu:your_id_here", () -> traitHolder(schema)); // (1)
// ...
return map;
}
```

1. Do not use `schema.registerSimple()`! All machines must have the trait holder fields.

!!! tip
When adding new (block) entity types in a schema, always also add a {@link AddNewChoices} fixer of the appropriate type(s).
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "gtceu:block/assembly_control_casing"
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"variants": {
"active=false": {
"model": "gtceu:block/variant/assembly_line"
"model": "gtceu:block/variant/assembly_line_unit"
},
"active=true": {
"model": "gtceu:block/variant/assembly_line_active"
"model": "gtceu:block/variant/assembly_line_unit_active"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "gtceu:block/bricked_bronze_casing"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "gtceu:block/bricked_wrought_iron_casing"
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,150 +1,150 @@
{
"variants": {
"facing=down,upwards_facing=down": {
"model": "gtceu:block/machine/mega_blast_furnace"
"model": "gtceu:block/machine/bulk_blast_chiller"
},
"facing=down,upwards_facing=east": {
"gtceu:z": 90,
"model": "gtceu:block/machine/mega_blast_furnace",
"model": "gtceu:block/machine/bulk_blast_chiller",
"x": 90
},
"facing=down,upwards_facing=north": {
"model": "gtceu:block/machine/mega_blast_furnace",
"model": "gtceu:block/machine/bulk_blast_chiller",
"x": 90
},
"facing=down,upwards_facing=south": {
"gtceu:z": 180,
"model": "gtceu:block/machine/mega_blast_furnace",
"model": "gtceu:block/machine/bulk_blast_chiller",
"x": 90
},
"facing=down,upwards_facing=up": {
"model": "gtceu:block/machine/mega_blast_furnace"
"model": "gtceu:block/machine/bulk_blast_chiller"
},
"facing=down,upwards_facing=west": {
"gtceu:z": 270,
"model": "gtceu:block/machine/mega_blast_furnace",
"model": "gtceu:block/machine/bulk_blast_chiller",
"x": 90
},
"facing=east,upwards_facing=down": {
"gtceu:z": 180,
"model": "gtceu:block/machine/mega_blast_furnace",
"model": "gtceu:block/machine/bulk_blast_chiller",
"y": 90
},
"facing=east,upwards_facing=east": {
"model": "gtceu:block/machine/mega_blast_furnace"
"model": "gtceu:block/machine/bulk_blast_chiller"
},
"facing=east,upwards_facing=north": {
"gtceu:z": 270,
"model": "gtceu:block/machine/mega_blast_furnace",
"model": "gtceu:block/machine/bulk_blast_chiller",
"y": 90
},
"facing=east,upwards_facing=south": {
"gtceu:z": 90,
"model": "gtceu:block/machine/mega_blast_furnace",
"model": "gtceu:block/machine/bulk_blast_chiller",
"y": 90
},
"facing=east,upwards_facing=up": {
"model": "gtceu:block/machine/mega_blast_furnace",
"model": "gtceu:block/machine/bulk_blast_chiller",
"y": 90
},
"facing=east,upwards_facing=west": {
"model": "gtceu:block/machine/mega_blast_furnace"
"model": "gtceu:block/machine/bulk_blast_chiller"
},
"facing=north,upwards_facing=down": {
"gtceu:z": 180,
"model": "gtceu:block/machine/mega_blast_furnace"
"model": "gtceu:block/machine/bulk_blast_chiller"
},
"facing=north,upwards_facing=east": {
"gtceu:z": 90,
"model": "gtceu:block/machine/mega_blast_furnace"
"model": "gtceu:block/machine/bulk_blast_chiller"
},
"facing=north,upwards_facing=north": {
"model": "gtceu:block/machine/mega_blast_furnace"
"model": "gtceu:block/machine/bulk_blast_chiller"
},
"facing=north,upwards_facing=south": {
"model": "gtceu:block/machine/mega_blast_furnace"
"model": "gtceu:block/machine/bulk_blast_chiller"
},
"facing=north,upwards_facing=up": {
"model": "gtceu:block/machine/mega_blast_furnace"
"model": "gtceu:block/machine/bulk_blast_chiller"
},
"facing=north,upwards_facing=west": {
"gtceu:z": 270,
"model": "gtceu:block/machine/mega_blast_furnace"
"model": "gtceu:block/machine/bulk_blast_chiller"
},
"facing=south,upwards_facing=down": {
"gtceu:z": 180,
"model": "gtceu:block/machine/mega_blast_furnace",
"model": "gtceu:block/machine/bulk_blast_chiller",
"y": 180
},
"facing=south,upwards_facing=east": {
"gtceu:z": 270,
"model": "gtceu:block/machine/mega_blast_furnace",
"model": "gtceu:block/machine/bulk_blast_chiller",
"y": 180
},
"facing=south,upwards_facing=north": {
"model": "gtceu:block/machine/mega_blast_furnace"
"model": "gtceu:block/machine/bulk_blast_chiller"
},
"facing=south,upwards_facing=south": {
"model": "gtceu:block/machine/mega_blast_furnace"
"model": "gtceu:block/machine/bulk_blast_chiller"
},
"facing=south,upwards_facing=up": {
"model": "gtceu:block/machine/mega_blast_furnace",
"model": "gtceu:block/machine/bulk_blast_chiller",
"y": 180
},
"facing=south,upwards_facing=west": {
"gtceu:z": 90,
"model": "gtceu:block/machine/mega_blast_furnace",
"model": "gtceu:block/machine/bulk_blast_chiller",
"y": 180
},
"facing=up,upwards_facing=down": {
"model": "gtceu:block/machine/mega_blast_furnace"
"model": "gtceu:block/machine/bulk_blast_chiller"
},
"facing=up,upwards_facing=east": {
"gtceu:z": 90,
"model": "gtceu:block/machine/mega_blast_furnace",
"model": "gtceu:block/machine/bulk_blast_chiller",
"x": 270
},
"facing=up,upwards_facing=north": {
"gtceu:z": 180,
"model": "gtceu:block/machine/mega_blast_furnace",
"model": "gtceu:block/machine/bulk_blast_chiller",
"x": 270
},
"facing=up,upwards_facing=south": {
"model": "gtceu:block/machine/mega_blast_furnace",
"model": "gtceu:block/machine/bulk_blast_chiller",
"x": 270
},
"facing=up,upwards_facing=up": {
"model": "gtceu:block/machine/mega_blast_furnace"
"model": "gtceu:block/machine/bulk_blast_chiller"
},
"facing=up,upwards_facing=west": {
"gtceu:z": 270,
"model": "gtceu:block/machine/mega_blast_furnace",
"model": "gtceu:block/machine/bulk_blast_chiller",
"x": 270
},
"facing=west,upwards_facing=down": {
"gtceu:z": 180,
"model": "gtceu:block/machine/mega_blast_furnace",
"model": "gtceu:block/machine/bulk_blast_chiller",
"y": 270
},
"facing=west,upwards_facing=east": {
"model": "gtceu:block/machine/mega_blast_furnace"
"model": "gtceu:block/machine/bulk_blast_chiller"
},
"facing=west,upwards_facing=north": {
"gtceu:z": 90,
"model": "gtceu:block/machine/mega_blast_furnace",
"model": "gtceu:block/machine/bulk_blast_chiller",
"y": 270
},
"facing=west,upwards_facing=south": {
"gtceu:z": 270,
"model": "gtceu:block/machine/mega_blast_furnace",
"model": "gtceu:block/machine/bulk_blast_chiller",
"y": 270
},
"facing=west,upwards_facing=up": {
"model": "gtceu:block/machine/mega_blast_furnace",
"model": "gtceu:block/machine/bulk_blast_chiller",
"y": 270
},
"facing=west,upwards_facing=west": {
"model": "gtceu:block/machine/mega_blast_furnace"
"model": "gtceu:block/machine/bulk_blast_chiller"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"variants": {
"": {
"model": "gtceu:block/oil_heavy"
"model": "gtceu:block/heavy_oil"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"variants": {
"": {
"model": "gtceu:block/oil_light"
"model": "gtceu:block/light_oil"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "gtceu:block/magnalium_turbine_casing"
}
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "gtceu:block/palladium_substation_casing"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "gtceu:block/raw_oil"
}
}
}
Loading
Loading