From 4db52b83c4d567ed3fea86cbe8099d30ccd77414 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sat, 29 Mar 2025 13:34:43 +0700 Subject: [PATCH] Since /reload reloads everything, we can cache isIncomplete --- .../ru/dbotthepony/mc/otm/recipe/MatterEntanglerRecipe.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/recipe/MatterEntanglerRecipe.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/recipe/MatterEntanglerRecipe.kt index b5999ed44..bbb540040 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/recipe/MatterEntanglerRecipe.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/recipe/MatterEntanglerRecipe.kt @@ -89,8 +89,12 @@ open class MatterEntanglerRecipe( return ingredients.ingredients() } + private val isIncomplete by lazy(LazyThreadSafetyMode.PUBLICATION) { + result.isEmpty || ingredients.isIncomplete + } + override fun isIncomplete(): Boolean { - return result.isEmpty || ingredients.isIncomplete + return isIncomplete } override fun isSpecial(): Boolean {