Handle vanilla-like trim cloning recipes

This commit is contained in:
DBotThePony 2023-11-16 21:44:20 +07:00
parent 280a8f3431
commit 940d8333de
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -731,7 +731,7 @@ object MatterManager {
private fun doTryToBacktrack(item: Item, makeCommentary: Boolean): Result {
val recipes = input2Recipes[item]
if (recipes == null || recipes.isEmpty() || !recipes.all { it.allowBacktrack } || !recipes.all { it.inputs.all { it.all { it.input.item == item } } }) {
if (recipes.isNullOrEmpty() || !recipes.all { it.allowBacktrack } || !recipes.all { it.inputs.all { it.all { it.input.item == item } } }) {
if (makeCommentary)
comment(item, TextComponent("Item '${item.registryName}' has no recipes"))
@ -859,14 +859,20 @@ object MatterManager {
}
}
} else if (ivalue.isSkipped) {
comment(item, TextComponent("Input $entry at input slot $i in ${recipe.formattedName} is recursive"))
recursiveSkips.add(entry)
if (inputs.size == 1) {
hadSkips = true
continue@recipesLoop
} else {
if (recipes.size == 1 && entry.input.item == recipe.output.item) {
// assume cloning and/or catalyst?
comment(item, TextComponent("Input $entry at input slot $i is assumed to be cloning/catalyst"))
continue@innerInputsLoop
} else {
comment(item, TextComponent("Input $entry at input slot $i in ${recipe.formattedName} is recursive"))
recursiveSkips.add(entry)
if (inputs.size == 1) {
hadSkips = true
continue@recipesLoop
} else {
continue@innerInputsLoop
}
}
}