Skip to content

Commit 575b38f

Browse files
committed
fix incorrect recipe ID
1 parent 4eef524 commit 575b38f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/main/kotlin/com/possible_triangle/sliceanddice/compat/FarmersDelightCompat.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ class FarmersDelightCompat private constructor() : IRecipeInjector {
9797
}
9898

9999
val mixingRecipes = generator.resolveAll(initialIngredients, result, recipe.cookTime, id)
100-
mixingRecipes.forEachIndexed { i, recipe ->
101-
add.accept(id.withSuffix("_$i"), recipe)
100+
mixingRecipes.forEach { recipe ->
101+
add.accept(recipe.id, recipe)
102102
}
103103
}
104104
}

src/main/kotlin/com/possible_triangle/sliceanddice/compat/MixingRecipeGenerator.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ class MixingRecipeGenerator(private val emptyingRecipes: Collection<EmptyingReci
7474
}
7575

7676
return try {
77-
variations.map {
78-
val recipe = it.createRecipe(id, cookTime, output)
77+
variations.mapIndexed { i, it ->
78+
val recipe = it.createRecipe(id.withSuffix("_$i"), cookTime, output)
7979
if (recipe.fluidIngredients.size > 2) throw IllegalArgumentException("too many fluid ingredients")
8080
recipe
8181
}
@@ -96,7 +96,7 @@ data class Ingredients(val items: List<Ingredient>, val fluids: List<FluidStack>
9696
fun replaceItemsWithFluid(original: Ingredient, fluid: FluidStack): Ingredients {
9797
val filteredItems = items.filter { it != original }
9898

99-
val fluidMatch = fluids.indexOfFirst { FluidStack.areFluidStackTagsEqual(it, fluid) }
99+
val fluidMatch = fluids.indexOfFirst { it.isFluidEqual(fluid) }
100100
val modifiedFluids =
101101
if (fluidMatch < 0)
102102
fluids + fluid

0 commit comments

Comments
 (0)