From 37bb00d73e48b62b8d53c782fa850945f4e1f746 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sat, 19 Aug 2023 14:52:06 +0700 Subject: [PATCH] Mmm! mmm. Custom Ingredients with getItems() returning literally minecraft:air --- .../kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 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 1a7101c93..b4b884750 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt @@ -82,6 +82,7 @@ import ru.dbotthepony.mc.otm.core.util.formatSiComponent import ru.dbotthepony.mc.otm.core.util.formatTickDuration import ru.dbotthepony.mc.otm.core.ifPresentK import ru.dbotthepony.mc.otm.core.isActuallyEmpty +import ru.dbotthepony.mc.otm.core.isNotEmpty import ru.dbotthepony.mc.otm.core.math.isZero import ru.dbotthepony.mc.otm.core.orNull import ru.dbotthepony.mc.otm.core.readItemType @@ -453,7 +454,7 @@ object MatterManager { ResolvedRecipe( it.ingredients.stream() .filter { !it.isActuallyEmpty } - .map { it.items.stream().map(::RecipeEntry) }, + .map { it.items.stream().filter { it.isNotEmpty }.map(::RecipeEntry) }, ImmutableStack(it.getResultItem(server.registryAccess())), isCritical = isCritical, name = it.id, @@ -553,8 +554,10 @@ object MatterManager { if (thisResidue.isEmpty) { result.add(RecipeEntry(item)) - } else { + } else if (item.isNotEmpty) { result.add(RecipeEntry(ImmutableStack(item), ImmutableStack(thisResidue))) + } else { + LOGGER.warn("Crafting table recipe ${it.id} has literally minecraft:air as item at $c") } } }