FarmersDelight icon indicating copy to clipboard operation
FarmersDelight copied to clipboard

Improved Integration support for custom recipes

Open ColonelPanic-Dev opened this issue 2 years ago • 1 comments

Hi Vectorwing, these changes are intended to allow a bit more integration support to your recipes. This is done by calling assemble() like vanilla recipes do, instead of getResultStack(). That way a custom recipe can have access to the state of the inventory at the time of crafting. Obviously this isn't appropriate for the cutting board, so instead I just added a RecipeWrapper to the rollResults method signature.

Due to these changes, Item checks have to be expanded a little bit to include comparing nbt tags, to prevent recipes that apply nbt tags having improperly stacking results.

All-in-all its a very small change that brings the recipes a little more in line with vanilla implementation as well as providing a lot more information to the recipe implementation for modders to have access to

ColonelPanic-Dev avatar Jun 04 '23 20:06 ColonelPanic-Dev

Hello! thank you for the PR, and sorry for the late reply; I usually reserve recipe spec changes for minor releases.

Yeah, everything here seems accurate enough. Using assemble() would let extenders of CookingPotRecipe do something with the inventory, and isSameItemSameTags allows NBT results to be correctly merged.

I'm pointing this PR to update/1.3, to organize those changes in one place before release. 👍

vectorwing avatar Jul 20 '23 02:07 vectorwing