Shadows-of-Fire / FastWorkbench

Caching recipes in the crafting table
MIT License
23 stars 17 forks source link

Fairy Lights crafting recipe output does not update #72

Closed copygirl closed 2 years ago

copygirl commented 3 years ago

Versions

Description

When changing ingredients of a Fairy Lights recipe, the recipe output does not update.

How to Reproduce

Screenshots

After placing the second ingredient (red paper lantern) into the crafting grid: image

Expected: image

Related Issue

pau101/Fairy-Lights#114

Shadows-of-Fire commented 3 years ago

as per the fix for #58 c2a1a642f28618314fc18016d5a5690d8e5edfbd, FB now always pushes a stack update every time the input changes if either the recipe changes, or the recipe is dynamic. Given that this recipe does this, it sounds like it's not properly returning true to IRecipe#isDynamic?

copygirl commented 3 years ago

That could be it. I will mention your response in the linked issue.

pau101 commented 3 years ago

It is not correct to assume a recipe output will not vary for a recipe which isDynamic() (isSpecial) returns false. The base game supports this behavior without issue. My mods utilize to get my recipes in the recipe book with ease.

I recommend extending the condition to also update if the current output stack (per getCraftingResult(CraftingInventory)) is not equal to its getRecipeOutput(), with a dash of vanilla recipe class checks to avoid superfluous stack comparisons.

Shadows-of-Fire commented 2 years ago

Fixed in 4.6.0 - non-vanilla recipes will now update the client if the resultant stack changes.