Minecraftforge: CompoundDataFixer iterates mod-specific and vanilla fixes in a random order

Created on 3 Jun 2018  路  5Comments  路  Source: MinecraftForge/MinecraftForge

Instead of processing all of the vanilla fixes first (notably the item id conversion), and then processing the mod-added fixes, the fixes are iterated in the order the HashMap decides. This means mod data fixers have an unreliable state when running on data from older minecraft versions.

There is additionally the problem that mod items' int ids are not being converted to strings, the same as vanilla items are in the DataFixer logic

Stale

Most helpful comment

If mods are altering data that is not their own, then they need to handle the problems of doing so themselves; an alternative to using a LinkedHashMap would be to run vanilla before the ModFixs loop, and skip its instance inside the loop.

Most fixers are going to have little to no interest in other mods' fixer states, but definitely care about the state of the vanilla fixes: Mojang has a List of fixes for a given type for a reason.

All 5 comments

Using a LinkedHashMap here
https://github.com/MinecraftForge/MinecraftForge/blob/9cda586ebd402df2e0543444329cfc1dd08172ea/src/main/java/net/minecraftforge/common/util/CompoundDataFixer.java#L39
should mean that the vanilla fixes always run first, as they're added in the constructor.

That would be useless as there needs to be a intertwined state. So that mod fixes can pick between what versions of whatever other fixer so that things can be in a state they expect.
I decided not to do that, and instead build a system that is explicitly designed not to make inter-mod versioning easy. Because there is no easy/simple way to both define it API wise and code wise.

If mods are altering data that is not their own, then they need to handle the problems of doing so themselves; an alternative to using a LinkedHashMap would be to run vanilla before the ModFixs loop, and skip its instance inside the loop.

Most fixers are going to have little to no interest in other mods' fixer states, but definitely care about the state of the vanilla fixes: Mojang has a List of fixes for a given type for a reason.

This issue has been automatically marked as stale because it has not had activity in a long time. If this issue is still relevant and should remain open, please reply with a short explanation (e.g. "I have checked the code and this issue is still relevant because ___." or "Here's a screenshot of this issue on the latest version"). Thank you for your contributions!

This issue has been automatically closed because it has not had activity in a long time. Please feel free to reopen it or create a new issue.

Was this page helpful?
0 / 5 - 0 ratings