@@ -51,6 +51,7 @@ public abstract class AbstractRecipeLogic extends MTETrait implements IWorkable
5151 protected boolean workingEnabled = true ;
5252 protected boolean hasNotEnoughEnergy ;
5353 protected boolean wasActiveAndNeedsUpdate ;
54+ protected boolean isInputsEmpty ;
5455
5556 public AbstractRecipeLogic (MetaTileEntity tileEntity , RecipeMap <?> recipeMap ) {
5657 super (tileEntity );
@@ -111,10 +112,11 @@ public void update() {
111112 if (progressTime == 0 ) {
112113 trySearchNewRecipe ();
113114 if (currentRecipe == null ) {
114- metaTileEntity .setSituation (NO_MATCHING_RECIPE );
115- }
116- if (metaTileEntity .isInputEmpty ()) {
117- metaTileEntity .setSituation (IDLE );
115+ if (isInputsEmpty ) {
116+ metaTileEntity .setSituation (IDLE );
117+ } else {
118+ metaTileEntity .setSituation (NO_MATCHING_RECIPE );
119+ }
118120 }
119121 }
120122 } else {
@@ -195,6 +197,7 @@ protected Recipe findRecipe(long maxVoltage, IItemHandlerModifiable inputs, IMul
195197
196198 protected boolean checkRecipeInputsDirty (IItemHandler inputs , IMultipleTankHandler fluidInputs ) {
197199 boolean shouldRecheckRecipe = false ;
200+ this .isInputsEmpty = true ;
198201 if (lastItemInputs == null || lastItemInputs .length != inputs .getSlots ()) {
199202 this .lastItemInputs = new ItemStack [inputs .getSlots ()];
200203 Arrays .fill (lastItemInputs , ItemStack .EMPTY );
@@ -211,6 +214,8 @@ protected boolean checkRecipeInputsDirty(IItemHandler inputs, IMultipleTankHandl
211214 } else if (currentStack .getCount () != lastStack .getCount ()) {
212215 lastStack .setCount (currentStack .getCount ());
213216 shouldRecheckRecipe = true ;
217+ } else if (!currentStack .isEmpty ()) {
218+ this .isInputsEmpty = false ;
214219 }
215220 }
216221 for (int i = 0 ; i < lastFluidInputs .length ; i ++) {
@@ -224,6 +229,8 @@ protected boolean checkRecipeInputsDirty(IItemHandler inputs, IMultipleTankHandl
224229 currentStack .amount != lastStack .amount ) {
225230 lastStack .amount = currentStack .amount ;
226231 shouldRecheckRecipe = true ;
232+ } else if (currentStack != null ) {
233+ this .isInputsEmpty = false ;
227234 }
228235 }
229236 return shouldRecheckRecipe ;
0 commit comments