From 621661c9fed695012ec8a48ac3d7c37fef0bab8a Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Fri, 14 Mar 2025 18:33:44 +0700 Subject: [PATCH] Remove MatteryCraftingContainer usage --- .../entity/storage/ItemMonitorBlockEntity.kt | 1 - .../otm/container/MatteryCraftingContainer.kt | 21 ------------------- .../mc/otm/matter/MatterManager.kt | 5 +++-- 3 files changed, 3 insertions(+), 24 deletions(-) delete mode 100644 src/main/kotlin/ru/dbotthepony/mc/otm/container/MatteryCraftingContainer.kt diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/ItemMonitorBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/ItemMonitorBlockEntity.kt index 3c44eabd5..3098460df 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/ItemMonitorBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/ItemMonitorBlockEntity.kt @@ -31,7 +31,6 @@ import ru.dbotthepony.mc.otm.config.MachinesConfig import ru.dbotthepony.mc.otm.container.CombinedContainer import ru.dbotthepony.mc.otm.container.EnhancedContainer import ru.dbotthepony.mc.otm.container.IEnhancedCraftingContainer -import ru.dbotthepony.mc.otm.container.MatteryCraftingContainer import ru.dbotthepony.mc.otm.container.util.slotIterator import ru.dbotthepony.mc.otm.core.TranslatableComponent import ru.dbotthepony.mc.otm.core.collect.map diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/container/MatteryCraftingContainer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/container/MatteryCraftingContainer.kt deleted file mode 100644 index 036e7bc27..000000000 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/container/MatteryCraftingContainer.kt +++ /dev/null @@ -1,21 +0,0 @@ -package ru.dbotthepony.mc.otm.container - -import net.minecraft.world.inventory.CraftingContainer -import net.minecraft.world.item.ItemStack - -open class MatteryCraftingContainer(listener: ContainerListener, private val width: Int, private val height: Int) : MatteryContainer(listener, width * height), CraftingContainer { - constructor(listener: () -> Unit, width: Int, height: Int) : this({ _, _, _ -> listener.invoke() }, width, height) - constructor(width: Int, height: Int) : this(EmptyListener, width, height) - - final override fun getWidth(): Int { - return width - } - - final override fun getHeight(): Int { - return height - } - - final override fun getItems(): MutableList { - return toList() - } -} 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 176860e2c..1c732a29e 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt @@ -77,7 +77,8 @@ import ru.dbotthepony.mc.otm.capability.drive.IMatteryDrive import ru.dbotthepony.mc.otm.client.isShiftDown import ru.dbotthepony.mc.otm.client.minecraft import ru.dbotthepony.mc.otm.config.ClientConfig -import ru.dbotthepony.mc.otm.container.MatteryCraftingContainer +import ru.dbotthepony.mc.otm.container.EnhancedContainer +import ru.dbotthepony.mc.otm.container.IEnhancedCraftingContainer import ru.dbotthepony.mc.otm.container.util.stream import ru.dbotthepony.mc.otm.core.ResourceLocation import ru.dbotthepony.mc.otm.core.TextComponent @@ -500,7 +501,7 @@ object MatterManager { height = it.value.ingredients.size.coerceAtLeast(height) } - val container = MatteryCraftingContainer(width, height) + val container = IEnhancedCraftingContainer.Wrapper(EnhancedContainer.Simple(width * height), width, height) val realIngredients = ArrayList>() for (c in it.value.ingredients.indices) {