From e56f27ee6b28604f3a9be5db32c315d5b3fa6781 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Wed, 9 Nov 2022 18:25:07 +0700 Subject: [PATCH] Log "to determine" matter values --- .../mc/otm/matter/RecipeResolverManager.kt | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/matter/RecipeResolverManager.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/matter/RecipeResolverManager.kt index 6a91ea437..86ca7c886 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/matter/RecipeResolverManager.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/matter/RecipeResolverManager.kt @@ -264,14 +264,14 @@ object RecipeResolverManager : SimpleJsonResourceReloadListener(GsonBuilder().se val recipes = output2Recipes[item] if (recipes == null) { - commentary[item] = TextComponent("Item ${item.registryName} has no recipes") + commentary[item] = TextComponent("Item '${item.registryName}' has no recipes") return Result.MISSING } recipesLoop@ for (recipe in recipes) { if (recipe.inputs.isEmpty()) { // TODO: should we ignore empty recipes? - commentary[item] = TextComponent("Recipe ${recipe.formattedName} is empty") + commentary[item] = TextComponent("${recipe.formattedName} is empty") continue } @@ -425,6 +425,33 @@ object RecipeResolverManager : SimpleJsonResourceReloadListener(GsonBuilder().se toDetermine.addAll(input2Recipes.keys) toDetermine.addAll(output2Recipes.keys) + if (LOGGER.isDebugEnabled) { + LOGGER.debug("Gonna try to search for matter values for next items:") + + val names = ArrayList() + var length = 0 + + for (value in toDetermine) { + val name = value.registryName!!.toString() + + if (length != 0 && length + name.length < 100) { + names.add(name) + length += name.length + } else if (length == 0) { + names.add(name) + length = name.length + } else { + LOGGER.debug(names.joinToString(", ")) + names.clear() + length = 0 + } + } + + if (names.isNotEmpty()) { + LOGGER.debug(names.joinToString(", ")) + } + } + while (changes) { ops += cachedIterationResults.size cachedIterationResults = Reference2ObjectOpenHashMap()