Closed sisby-folk closed 9 months ago
Here's a screenshot of a wooden pickaxe being non repairable when this mod is installed.
huh? thats weird, reading a tag does brick it? well anyways guess ill just delay truly modulars reload logic until after the tags are setup
You can look at the logic of Ingredient.getMatchingStacks()
yourself - here's a screenshot
it's a pretty silly hazard in vanilla.
cool, ig i should just mixin into minecrafts reload logic and trigger after the initial loading is through to start miapis logic
in fabric you have IdentifiableResourceReloadListener
that handles this:
not sure what you have access to for forge.
actually the architectury implementation supports dependencies, so ig ill use that
So, hey, i tried architecturies implementation and while it seems to work ( i checked with mixins to verify the tag logic was executed prior to my logic) the issue perssisted. any ideas why that could be? otherwise im just gonna experiment arround until i find a fix
try installing Tinkerer's Smithing 2.6 - it'll log if you're causing the issue
it'll also workaround the issue, so trust the log not the behaviour.
i can check that im breaking it in local dev, if i comment my code out it stops breaking, i was just asking if you knew another reason that might be causing it other than beeing called prior to the tagloader
nvmd, figured it out, we accessed stuff from the worker thread
fixed in latest release
Ingredient
caches the result ofgetMatchingStacks()
when it's called, and it's possible to call the method before tags are actually loaded - this causesIngredient
to permanently contain the incorrect list of stacks from before the tag was actually loaded, breaking its usage in recipes.miapi does this in MaterialProperty.java#L98-L108 with several calls to getMatchingStacks(), and truly modular armory calls
test()
GenerateArmorModularConverter.java#L43 in the same place viaassignStats
.This is presumably because
MiapiReloadListener
is running beforeTagManagerLoader
- when it needs to run after. If architectury allows you to set a dependency on the tag reloader, go ahead and do so.The result is that the repair ingredient for wooden and stone tools becomes completely empty, preventing them from being repaired at an anvil.
We caught this because our own mod (Tinkerer's Smithing) has a mixin designed to prevent it from happening - here's a nice log of that happening for more detail and a stack trace: https://mclo.gs/NRksw99