Nomifactory / ExtendedCrafting

Adds some new ways to craft items, as well as extra crafting items and utilities.
MIT License
2 stars 5 forks source link

Invalidate cache itemstack and state after failed recipe completion #14

Closed ALongStringOfNumbers closed 3 years ago

ALongStringOfNumbers commented 3 years ago

A couple changes related to #7

First, delay the recipe lookup until after there is confirmed to be a non-null item. Previously the recipe lookup would run before a guaranteed item was found, which means that recipe would always be null, even if the input check found an applicable item.

This change defers the recipe lookup to after finding an item, so that recipe will not be null (for an input item) after the new input item is set.

Secondly, if the input consumption failed due to null recipe or other factor, reset the cached itemstack and the mark state. This part is what addresses the issue in #7.

Fixes #7

ferreiraalex commented 3 years ago

i can? release?