Skip to content

Commit

Permalink
Rename Parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
IntegerLimit committed Jul 14, 2024
1 parent 601fac7 commit 9aea330
Showing 1 changed file with 22 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,43 +99,50 @@ private boolean removeByInput(Predicate<Recipe> condition, List<ItemStack> items

@Unique
@Nullable
public List<Recipe> findByOutput(long voltage, List<ItemStack> inputs, List<FluidStack> fluidInputs,
public List<Recipe> findByOutput(long voltage, List<ItemStack> items, List<FluidStack> fluids,
List<ChancedItemOutput> chancedItems, List<ChancedFluidOutput> chancedFluids) {
inputs = validateList(inputs);
fluidInputs = validateList(fluidInputs);
items = validateList(items);
fluids = validateList(fluids);
chancedItems = validateList(chancedItems);
chancedFluids = validateList(chancedFluids);
return getAccessibleRecipeMap().findRecipeByOutput(voltage, inputs, fluidInputs, chancedItems, chancedFluids);

List<ItemStack> filteredItems = items.stream().filter((s) -> !s.isEmpty()).collect(Collectors.toList());
List<FluidStack> filteredFluids = fluids.stream().filter((f) -> f != null && f.amount != 0)
.collect(Collectors.toList());
return getAccessibleRecipeMap().findRecipeByOutput(voltage, filteredItems, filteredFluids, chancedItems,
chancedFluids);
}

@Unique
@Nullable
public List<Recipe> findByOutput(List<ItemStack> inputs, List<FluidStack> fluidInputs,
public List<Recipe> findByOutput(List<ItemStack> items, List<FluidStack> fluids,
List<ChancedItemOutput> chancedItems, List<ChancedFluidOutput> chancedFluids) {
return findByOutput((r) -> true, inputs, fluidInputs, chancedItems, chancedFluids);
return findByOutput((r) -> true, items, fluids, chancedItems, chancedFluids);
}

@Unique
@Nullable
public List<Recipe> findRecipeByOutput(GTRecipeCategory category, List<ItemStack> inputs,
List<FluidStack> fluidInputs,
public List<Recipe> findRecipeByOutput(GTRecipeCategory category, List<ItemStack> items,
List<FluidStack> fluids,
List<ChancedItemOutput> chancedItems,
List<ChancedFluidOutput> chancedFluids) {
return findByOutput((r) -> Objects.equals(r.getRecipeCategory(), category), inputs, fluidInputs, chancedItems,
return findByOutput((r) -> Objects.equals(r.getRecipeCategory(), category), items, fluids, chancedItems,
chancedFluids);
}

@Unique
public List<Recipe> findByOutput(Predicate<Recipe> condition, List<ItemStack> inputs, List<FluidStack> fluidInputs,
public List<Recipe> findByOutput(Predicate<Recipe> condition, List<ItemStack> items, List<FluidStack> fluids,
List<ChancedItemOutput> chancedItems, List<ChancedFluidOutput> chancedFluids) {
inputs = validateList(inputs);
fluidInputs = validateList(fluidInputs);
items = validateList(items);
fluids = validateList(fluids);
chancedItems = validateList(chancedItems);
chancedFluids = validateList(chancedFluids);
List<ItemStack> items = inputs.stream().filter((s) -> !s.isEmpty()).collect(Collectors.toList());
List<FluidStack> fluids = fluidInputs.stream().filter((f) -> f != null && f.amount != 0)

List<ItemStack> filteredItems = items.stream().filter((s) -> !s.isEmpty()).collect(Collectors.toList());
List<FluidStack> filteredFluids = fluids.stream().filter((f) -> f != null && f.amount != 0)
.collect(Collectors.toList());
return getAccessibleRecipeMap().findByOutput(items, fluids, chancedItems, chancedFluids, condition);
return getAccessibleRecipeMap().findByOutput(filteredItems, filteredFluids, chancedItems, chancedFluids,
condition);
}

@Unique
Expand Down

0 comments on commit 9aea330

Please sign in to comment.