Skip to content

Commit

Permalink
fix issue with tests and recipe matching
Browse files Browse the repository at this point in the history
  • Loading branch information
ghzdude committed Jul 15, 2024
1 parent 36f6cc7 commit fc38ac1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ protected void trySearchNewRecipe() {
protected boolean checkPreviousRecipe() {
if (this.previousRecipe == null) return false;
if (this.previousRecipe.getEUt() > this.getMaxVoltage()) return false;
return recipeMatch(this.previousRecipe, getInputInventory(), getInputTank());
return recipeMatch(this.previousRecipe, false);
}

/**
Expand Down Expand Up @@ -686,15 +686,15 @@ protected boolean setupAndConsumeRecipeInputs(@NotNull Recipe recipe,
}

this.isOutputsFull = false;
if (recipeMatch(recipe, importInventory, importFluids)) {
if (recipeMatch(recipe, true)) {
this.metaTileEntity.addNotifiedInput(importInventory);
return true;
}
return false;
}

protected boolean recipeMatch(Recipe recipe, IItemHandlerModifiable inputItems, IMultipleTankHandler inputFluids) {
return recipe.matches(true, inputItems, inputFluids);
protected boolean recipeMatch(Recipe recipe, boolean shouldConsume) {
return recipe.matches(shouldConsume, getInputInventory(), getInputTank());
}

protected List<ItemStack> gatherItems(IItemHandlerModifiable inputInventory, IMultipleTankHandler inputFluids) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,11 @@ protected void trySearchNewRecipeDistinct() {
}

@Override
protected boolean recipeMatch(Recipe recipe, IItemHandlerModifiable inputItems, IMultipleTankHandler inputFluids) {
List<ItemStack> items = gatherItems(inputItems, inputFluids);
List<FluidStack> fluids = gatherFluids(inputItems, inputFluids);
protected boolean recipeMatch(Recipe recipe, boolean shouldConsume) {
List<ItemStack> items = gatherItems(getInputInventory(), getInputTank());
List<FluidStack> fluids = gatherFluids(getInputInventory(), getInputTank());

return recipe.matches(true, items, fluids);
return recipe.matches(shouldConsume, items, fluids);
}

@Override
Expand Down

0 comments on commit fc38ac1

Please sign in to comment.