From 7eaab24f9daea84bf2c99e85b3e6e7b897051e3d Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sun, 25 Jun 2023 20:55:13 +0700 Subject: [PATCH] =?UTF-8?q?YuRaNnNzZZ=20=E2=80=94=20=D0=A1=D0=B5=D0=B3?= =?UTF-8?q?=D0=BE=D0=B4=D0=BD=D1=8F,=20=D0=B2=2018:27=20thanks=20direwolf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt | 9 +++++++-- 1 file changed, 7 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 77822466f..59cd19849 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt @@ -552,8 +552,8 @@ object MatterManager { if (resultItem.isEmpty) { null } else { - val width: Int - val height: Int + var width: Int + var height: Int if (it is IShapedRecipe<*>) { width = it.recipeWidth @@ -563,6 +563,11 @@ object MatterManager { height = 3 } + if (width * height < it.ingredients.size) { + width = it.ingredients.size.coerceAtLeast(width) + height = it.ingredients.size.coerceAtLeast(height) + } + val container = TransientCraftingContainer(object : AbstractContainerMenu(null, 0) { override fun quickMoveStack(pPlayer: Player, pIndex: Int): ItemStack { return ItemStack.EMPTY