From 1ae3be64993a0a7e9443534fad7b11af70812ba9 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sun, 29 Sep 2024 11:22:56 +0700 Subject: [PATCH] Since bad recipes are usually outside of user's control, don't choke and die on them, just log problematic recipes and move on --- .../ru/dbotthepony/mc/otm/matter/MatterManager.kt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt index 083cf8fda..97ab02b6f 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt @@ -438,9 +438,12 @@ object MatterManager { allowBacktrack = allowBacktrack ) } catch(err: Throwable) { - throw RuntimeException("Processing simple recipe ${it.id}", err) + // throw RuntimeException("Processing simple recipe ${it.id}", err) + LOGGER.error("Processing simple recipe ${it.id}", err) + null } } + .filterNotNull() .filter { if (it.inputs.isEmpty()) { LOGGER.warn("${it.formattedName} with output '${it.output.item.registryName}' ended up with no inputs!") @@ -547,7 +550,8 @@ object MatterManager { ) } } catch(err: Throwable) { - throw RuntimeException("Processing crafting table recipe ${it.id}", err) + LOGGER.error("Processing crafting table recipe ${it.id}", err) + null } }.filterNotNull().filter { if (it.inputs.isEmpty()) { @@ -596,7 +600,8 @@ object MatterManager { allowBacktrack = allowBacktrack ) } catch(err: Throwable) { - throw RuntimeException("Processing smithing recipe ${it.id}", err) + LOGGER.error("Processing smithing recipe ${it.id}", err) + null } }.filterNotNull().filter { if (it.inputs.isEmpty()) {