Closed Akjosch closed 1 year ago
FWIW, I tested this in 1.16 with Pam's and it worked fine (at least until the assistant ran into ldtteam/minecolonies#8103, but that might just have been me not waiting long enough afterward) -- only one cutting board was requested when making 16x the base recipe, and they did make the final items just fine.
I haven't checked 1.18 yet since Pam's isn't out for that, but perhaps it's something specific to that, or specific to some implementation quirk of another mod's recipes?
In case of Croptopia, they implement the functionality by overriding getContainerItem(ItemStack)
and gasContainerItem(ItemStack)
in their "catalyst" items, and have the former return a copy of themselves. I think that's roughly the same functions water bottles use (they return empty bottles), but I didn't check Minecraft code.
This honestly is something needed
Fixed
Prerequisites
Context
Is your feature request related to a problem?
There are some mods which use tools to craft their recipes. In particular, Harvestcraft and Croptopia have all those pans, cutting boards and whatnot. Those tools don't have durability, nor are they used up in crafting. I like to call them "catalyst tools".
When telling the assistant cook (as an example) to craft a stack of those, they don't recognise them as tools, instead filing them as "secondary outputs", on account of them not having any durability. The comparison then checks for the amount of those catalysts there is compared to the amount of crafts to be done, and requests (one) more each time the comparison turns out to be "fewer catalyst tools". This means that they'd eventually request 64 of those tools for each stack of items they need to craft, instead of reusing the one they already have.
For reference, the check is done here: https://github.com/ldtteam/minecolonies/blob/version/main/src/api/java/com/minecolonies/api/crafting/RecipeStorage.java#L251
Feature description
Suggested changes:
minecolonies:tool
for example) which would mark those tools as such. This can then be configured via a datapack. The Croptopia presets would put those tag oncroptopia:food_press
,croptopa:frying_pan
,croptopia:cooking_pot
andcroptopia:mortat_and_pestle
, for example.fullfillRecipeAndCopy()
doesn't damage such tools around https://github.com/ldtteam/minecolonies/blob/version/main/src/api/java/com/minecolonies/api/crafting/RecipeStorage.java#L537-L571Alternatively:
Notes or related things
Relevant past PR: https://github.com/ldtteam/minecolonies/pull/6587
Viewers