User datapack gets forcefully reordered after mod datapacks
2929762171 opened this issue · 15 comments
modernfix-forge-5.7.2+mc1.16.5
(Poor English)
【JER】
Before:
I changed to false:
Then it became normal:
Maybe you should notice this.
【datapack】
You can see I had load a custom datapack, I change someting with vanilla data like loot tables, and set it to load after vanilla.
Datapack worked as expected, but I found that it will break mods'loot tables, just like it load at last and cover other mods' modification of vanilla.
As you can see, I tested a lot...
The problem is, I already set it to load after vanilla, not at last.
When I remove modernfix OR my datapack, problem can be solved.
I have no idea which mixin cause this problem...
In a fairly simple instance with ModernFix and a few other mods, I tried making a test datapack that overwrites a recipe from a mod, and moving it to be immediately after vanilla (as you did), and it still seems to work correctly. The datapack's changes are ignored since the mod comes after it in the list.
Can you send your latest.log
file, so I can compare the pack order it shows there with what the /datapack
command claims?
In a fairly simple instance with ModernFix and a few other mods, I tried making a test datapack that overwrites a recipe from a mod, and moving it to be immediately after vanilla (as you did), and it still seems to work correctly. The datapack's changes are ignored since the mod comes after it in the list.
Can you send your
latest.log
file, so I can compare the pack order it shows there with what the/datapack
command claims?
Did your datapack contain other parts of the vanilla? Especially chest loot table, and the most obvious problem is here.
Hmm, what happens if mixin.perf.resourcepacks
is disabled? (This will heavily impact launch time, but is worth checking.)
Hmm, what happens if
mixin.perf.resourcepacks
is disabled? (This will heavily impact launch time, but is worth checking.)
Still. I try yesterday.
Interesting. Only other option I can think of to try is mixin.perf.skip_first_datapack_reload
.
Aside from that, I have anecdotally seen issues with Forge changing mod datapack order by itself, at least on 1.16, so it's possible it ends up moving your datapack to the end internally.
有趣的。我能想到尝试的唯一其他选择是
mixin.perf.skip_first_datapack_reload
。除此之外,我还听说过 Forge 自行更改 mod 数据包顺序的问题,至少在 1.16 上是这样,所以它最终可能会在内部将您的数据包移动到末尾。
Still. I tried it yesterday, too.
And I think maybe it's not a Forge problem, because everything work correctly without modernfix, so I tested a lot before I pose this issue. Then the question finally points to modernfix.
No, I was trying to make the simplest datapack I could think of as I had limited time to test it. 😅
If you could give an example of one mod that adds to a vanilla loot table, and provide a corresponding datapack that overwrites the same loot table, I can look into this again. The simplest setup that can reproduce this is ideal for debugging.
vanilla+++.zip
Try this?
我应该将哪个模组与此数据包一起使用?
Any mod that modifies the chest loot table.
You can try : rings of ascension, artifacts...
By the way, this problem will not happen on FarmersDelight, its resources can always appear in the chest.
However, when I removed ModernFix the behavior was exactly the same.
It seems that you forgot to change the loading order.
I was able to reproduce the issue with Artifacts & the datapack added after vanilla. However, when I removed ModernFix the behavior was exactly the same. Artifacts loot was not added to the chest if the datapack was present.
I looked into the Forge/Artifacts code that's responsible for loading of loot tables, and it looks like modded loot is only supposed to be injected into loot tables added by the vanilla datapack. If a custom datapack is added that overwrites loot tables, mods' loot will not be added.
In other words, the code appears to intentionally be written for what you are doing not to work - if you want modded loot to be applied, you cannot be replacing the vanilla loot tables yourself using a datapack. A better option is probably to use KubeJS or CraftTweaker and write a simple script to modify the loot tables at runtime.
(For the interested reader with technical understanding of the game, here is where the datapack is checked for being vanilla, and here is where the loot table modification event is skipped if the original loot table is found to be custom, i.e. added by a datapack.)