Skip to content

Commit

Permalink
fix distinct recipe checking + misc
Browse files Browse the repository at this point in the history
  • Loading branch information
ghzdude committed Jul 19, 2024
1 parent fc38ac1 commit 026f494
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,10 @@ public void invalidateInputs() {
}

protected boolean checkPreviousRecipeDistinct(IItemHandlerModifiable previousBus) {
return previousRecipe != null && previousRecipe.matches(false, previousBus, getInputTank());
List<ItemStack> items = gatherItems(previousBus, getInputTank());
List<FluidStack> fluids = gatherFluids(previousBus, getInputTank());

return previousRecipe != null && previousRecipe.matches(false, items, fluids);
}

protected boolean prepareRecipeDistinct(Recipe recipe) {
Expand Down
10 changes: 2 additions & 8 deletions src/main/java/gregtech/api/util/GTUtility.java
Original file line number Diff line number Diff line change
Expand Up @@ -441,20 +441,14 @@ public int size() {
public static void addHandlerToCollection(Collection<ItemStack> collection, IItemHandler handler) {
for (int i = 0; i < handler.getSlots(); i++) {
var stack = handler.getStackInSlot(i);
if (stack.isEmpty())
continue;

collection.add(stack);
if (!stack.isEmpty()) collection.add(stack);
}
}

public static void addHandlerToCollection(Collection<FluidStack> collection, IMultipleTankHandler handler) {
for (var entry : handler.getFluidTanks()) {
var fluid = entry.getFluid();
if (fluid == null)
continue;

collection.add(fluid);
if (fluid != null) collection.add(fluid);
}
}

Expand Down

0 comments on commit 026f494

Please sign in to comment.