From 5302aa07a5c0ddeaa37182a04f701db35a93b004 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Tue, 1 Feb 2022 11:19:23 +0000 Subject: [PATCH] Un-did thing? --- .../eco/internal/spigot/recipes/ShapedRecipeListener.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/recipes/ShapedRecipeListener.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/recipes/ShapedRecipeListener.kt index 5052fb55..79dfa72a 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/recipes/ShapedRecipeListener.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/recipes/ShapedRecipeListener.kt @@ -39,16 +39,16 @@ class ShapedRecipeListener : Listener { var isStackedRecipe = false var upperBound = 64 for (i in 0..8) { - val inMatrix = event.inventory.matrix[i] + val inMatrix = event.inventory.matrix.getOrNull(i) val inRecipe = matched.parts[i] if (inRecipe is TestableStack) { - val max = Math.floorDiv(inMatrix.amount, inRecipe.amount) + val max = Math.floorDiv(inMatrix!!.amount, inRecipe.amount) if (max < upperBound) { upperBound = max } isStackedRecipe = true - } else { + } else if (inMatrix != null) { val max = inMatrix.amount if (max < upperBound) { upperBound = max