Add DataOverrides layer to keep corrected values stable across regenerations - #79
AnonymoDGH wants to merge 1 commit into
Conversation
|
Why is the data returned by the actual Minecraft code wrong ? |
|
Injecting a bunch of hard coded (likely wrong) things here when whole point is to get the proper data from the source doesn't seem to make sense |
There was a problem hiding this comment.
Pull request overview
Adds a shared post-processing override layer in common so a small set of community-verified corrections stay stable across regenerations for all supported Minecraft versions.
Changes:
- Thread
versionNameinto the shared generation pipeline so overrides can be version-gated. - Apply
DataOverridesto selected generated datasets (items,blocks,effects) immediately before writing JSON. - Introduce
DataOverrideswith targeted, version-scoped corrections for known minecraft-data inconsistencies.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| common/src/main/java/dev/u9g/minecraftdatagenerator/MinecraftDataGenerator.java | Passes versionName into the shared generator pipeline so post-processing can be version-aware. |
| common/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataGenerators.java | Invokes DataOverrides.apply(...) right before each generated JSON file is written. |
| common/src/main/java/dev/u9g/minecraftdatagenerator/generators/DataOverrides.java | New centralized override layer implementing the version-gated corrections. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| private static void applyEffects(JsonArray effects, String versionName) { | ||
| if (!atLeast(versionName, "1.14.4") || !before(versionName, "1.17")) { | ||
| return; | ||
| } |
|
Closing this in favor of a more targeted approach — @extremeheat's point is well taken. I compared the generator's actual output on
So 3 of the 4 overrides here were redundant — the generator already returns the right values and the committed minecraft-data files are simply stale (a regeneration would fix them). Hardcoding those was the wrong call. The one genuine bug is |
What
Adds a small override layer (
DataOverrides) applied by the sharedDataGeneratorspipeline right before each generated JSON file is written out. It guarantees that a handful of values the community-verified minecraft-data dataset expects stay correct no matter how often a version is regenerated — this fixes the situation where manual data fixes to generated versions silently revert to the previous state (see the note on PrismarineJS/minecraft-data#1234).Overrides included
warped_fungus_on_a_stickstackSize forced to 1 for 1.16–1.18 (fixes Wrong stack size for Warped Fungus on a Stick minecraft-data#569)copper_orehardness/resistance forced to 3 for 1.18 (fixes Hardness and Resistance 0 for copper_ore in 1.18 minecraft-data#538)water/lavamarked non-diggable for 1.17+ (fixes Why is water diggable? minecraft-data#926)Each override is version-gated and only writes the corrected value, so it is a no-op when the game already reports the expected value.
Notes
commonpost-processing, so everymc/<version>module picks them up automatically, including future versions.