Closed TheIllusiveC4 closed 2 years ago
Hm, this is strange that recipes doesn't exist on server side. So, this is how the recipes are implemented:
The old code used injections to Recipe Manager, but some mods like KubeJS injected in same place too, so the modern incetions are done into MinecraftServer. So possible reasons can be:
I think there can be more reasons, these are first that I can imagine.
There seems to be several other bug reports about recipes, but they don't seem to be quite the same as this one. I apologize if this is considered a duplicate of those.
Other recipe bugs are related to missing "!" symbol before existence check, which made recipes fail to register, fix will be published soon
Ah, I have a suspicion then. Vanilla has two recipe collections, one is the map that's organized by recipe type and the other is the map that's organized by resource location. Does your logic merge only with the former and not the latter? That would account for why the recipes do seem to work, but not when called directly from RecipeManager#byKey
.
In this case fix should be simple - additional mixin into manager that will add recipes into another internal recipe storage
I uploaded new BCLib release, now recipes are added into both map. I added recipes into named map only if environment is not client side, otherwise REI tells that there are recipe duplicates with same keys (I don't know why - this is a hashmap). I hope that bug is fixed now
I just did a quick test and the issue seems to be resolved now, thank you!
Versions:
Observed Behavior:
Calling
RecipeManager#byKey(ResourceLocation)
will return an empty value for BetterEnd recipes on server-side. Client-side calls will return the appropriate recipe instance.Expected Behavior:
Calling
RecipeManager#byKey(ResourceLocation)
should return equivalent non-empty values both server-side and client-side.Comments:
I'm the developer for Polymorph and I started investigating a small issue (https://github.com/TheIllusiveC4/Polymorph/issues/136) involving a recipe conflict, one output of which involves a BetterEnd recipe. I discovered that the source of the issue is due to the observed behavior outlined above, which causes Polymorph to fail the recipe validation server-side and refuse to switch recipes.
I'm not exactly sure what causes this behavior, but this is reproducible with only BetterEnd installed. However, I don't have a full understanding of the code base and perhaps I have missed something crucial. This is as much an invitation for dialogue/clarification as it is a bug report.
There seems to be several other bug reports about recipes, but they don't seem to be quite the same as this one. I apologize if this is considered a duplicate of those.