Fix replay recipe sync registry mismatch - #67
Conversation
|
So if I'm understanding correctly, the problem is that Minecraft's registry loading code is prioritizing getting the tags from the old pendingTags map instead of getting the fresh tags from the registry that we just loaded? And the solution is to avoid adding it to pendingTags, to ensure that it can only load the fresh tags? |
|
Yes, sort of, with one nuance: both paths use the same recorded tags. The problem is which of the two registry instances resolves them. To keep the terms clear, I'll call them the Previously,
The fix defers resolving the tags until Flashback knows which registry will remain active. If the In short, tags must be resolved against whichever registry remains active; otherwise recipes can retain holders that recipe sync cannot encode. Sorry it was really complicated to figure out so I'm still struggling a bit to explain it clearly, I hope that makes sense! |
|
Gotcha, so the tags in the registries are fine it's just the reloadable resources. I'm confused on one thing though: you said
but the code doesn't seem to do that? You have |
|
There are two paths:
this.pendingRegistryMap.put(
resourceKey,
new RegistryDataLoader.NetworkedRegistryData(entry.elements(), networkPayload)
);
|
Right, I understand that the tags get put in the registry correctly, but you said the problem was with when the server's resources are reloaded. i.e. inside MinecraftServer#reloadResources, there's TagLoader#loadTagsForExistingRegistries which we override in As you say, RegistryDataLoader.load will install the payload, but it won't add to the pendingTags list, and it's the pendingTags list which we replace For additional context, the reason why we need to replace So, in summary, it seems to me that any custom tag that was recorded won't be used inside MinecraftServer#reloadResources because it never gets added to the pendingTags list. Consequently, I think this PR will make MinecraftServer#reloadResources use As long as I'm understanding everything correctly here, this should be solveable by removing |
|
When resource reload starts, the Previously, Flashback also added a |
|
Ah okay. If it's just an override list, can't we just make |
|
That... seems plausible huh. Give me a minute to try it out! |
|
Ok sorry that took a while to test each step, but that led me down a path where I could simplify this to just one line lol |
|
Now that I have a precise fix I'll see if I can clean up a little |
|
Ok I think this is in a good state now. |
|
Thank you very much for your help with this. I'll try to merge this and get a new release as soon as I can |
|
Thanks! |
This issue was reported to me:
It was also reported to your discord here, but without enough information:
I was able to reproduce it on Fabric with JEI installed:
pack.mcmeta:data/minecraft/trim_pattern/bolt.json:Server:
minecraft:bolt → literal description, decal=trueClient:
minecraft:bolt → vanilla translated description, decal=falseminecraft:boltholder.