ModernFix

ModernFix

72M Downloads

User datapack gets forcefully reordered after mod datapacks

2929762171 opened this issue · 15 comments

commented

modernfix-forge-5.7.2+mc1.16.5
(Poor English)
【JER】
Before:
image

I can't see mods resource:
image

I changed to false:
image
Then it became normal:
image

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.
image
image

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.
image
image
image
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.
image

I have no idea which mixin cause this problem...

commented

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?

commented

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.
image
image

commented

Hmm, what happens if mixin.perf.resourcepacks is disabled? (This will heavily impact launch time, but is worth checking.)

commented

Hmm, what happens if mixin.perf.resourcepacks is disabled? (This will heavily impact launch time, but is worth checking.)

Still. I try yesterday.

commented

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.

commented

有趣的。我能想到尝试的唯一其他选择是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.

commented

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.

commented

vanilla+++.zip
Try this?

commented

Which mod should I use with this datapack?

commented

我应该将哪个模组与此数据包一起使用?

Any mod that modifies the chest loot table.
You can try : rings of ascension, artifacts...

commented

By the way, this problem will not happen on FarmersDelight, its resources can always appear in the chest.

commented

However, when I removed ModernFix the behavior was exactly the same.

It seems that you forgot to change the loading order.

commented

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.)

commented

No, I put the datapack right after vanilla, same as you.

commented

不,我把数据包放在原版之后,和你一样。

Fine, thanks for your work.