Switch to NeoForge data map feature for bulk compression overrides #165
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.
While serviceable to a point, the conventional
#megacells:compression_overrides
tag suffers from the inability to specify a clear desired variant for items to override. This inherent imprecision leads to odd cases such as AllTheMods/ATM-10#1864, where the compression system may generate multiple (often nonsensical) chains for the same overridden item which have to be covered for one-by-one by blacklisting odd items such as these, potentially every time a new override is added. In fact, MEGA itself already had to provide default cover for a dumb case like this by blacklisting the tag for wrenches of all things.The solution to this problem is to switch to NeoForge's data map feature introduced in MC 1.20.4 by neoforged/NeoForge#519. With the new data map in place of the tag, it is now possible to specify the exact next variant expected for a given override, with any recipes which may involve the overridden item but not provide the appropriate variant as the output being rejected to prevent further situations like the above. This should also hopefully ease the burden on modpack developers when it comes to the amount of items to blacklist just to prevent such scenarios as above.
The old tag will still be present and also remain in use for the time being as a fallback, but has been deprecated and is subject to removal for when pack developers have fully switched away from the tag.