From 51c9df52fca0332d34706d06f09847ddb1ac2dd5 Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Wed, 27 Dec 2023 13:16:52 +0100 Subject: Fix sentinel items being displayed in recipes somtimes --- .../moe/nea/firmament/rei/recipes/SBRecipe.kt | 23 +++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/main/kotlin/moe/nea/firmament/rei/recipes/SBRecipe.kt b/src/main/kotlin/moe/nea/firmament/rei/recipes/SBRecipe.kt index 9a64857..50dd722 100644 --- a/src/main/kotlin/moe/nea/firmament/rei/recipes/SBRecipe.kt +++ b/src/main/kotlin/moe/nea/firmament/rei/recipes/SBRecipe.kt @@ -6,25 +6,30 @@ package moe.nea.firmament.rei.recipes +import io.github.moulberry.repo.data.NEUIngredient import io.github.moulberry.repo.data.NEURecipe import me.shedaniel.rei.api.common.display.Display import me.shedaniel.rei.api.common.entry.EntryIngredient import moe.nea.firmament.rei.SBItemEntryDefinition import moe.nea.firmament.util.SkyblockId -abstract class SBRecipe() : Display { +abstract class SBRecipe : Display { abstract val neuRecipe: NEURecipe override fun getInputEntries(): List { - return neuRecipe.allInputs.map { - val entryStack = SBItemEntryDefinition.getEntry(SkyblockId(it.itemId)) - EntryIngredient.of(entryStack) - } + return neuRecipe.allInputs + .filter { it.itemId != NEUIngredient.NEU_SENTINEL_EMPTY } + .map { + val entryStack = SBItemEntryDefinition.getEntry(SkyblockId(it.itemId)) + EntryIngredient.of(entryStack) + } } override fun getOutputEntries(): List { - return neuRecipe.allOutputs.map { - val entryStack = SBItemEntryDefinition.getEntry(SkyblockId(it.itemId)) - EntryIngredient.of(entryStack) - } + return neuRecipe.allOutputs + .filter { it.itemId != NEUIngredient.NEU_SENTINEL_EMPTY } + .map { + val entryStack = SBItemEntryDefinition.getEntry(SkyblockId(it.itemId)) + EntryIngredient.of(entryStack) + } } } -- cgit