From 5e8ab76f4943207086fbe8d04f4f7c432ce36e2b Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Fri, 28 Feb 2025 15:38:37 +0700 Subject: [PATCH] Update MatteryContainer to fix compilation error --- .../dbotthepony/mc/otm/container/MatteryContainer.kt | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/container/MatteryContainer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/container/MatteryContainer.kt index 53b155f8d..9f890e005 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/container/MatteryContainer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/container/MatteryContainer.kt @@ -426,10 +426,7 @@ open class MatteryContainer(var listener: ContainerListener, private val size: I } } - private inner class Slot(override val slot: Int) : IFilteredContainerSlot { - override val container: Container - get() = this@MatteryContainer - + inner class Slot(val slot: Int) : IFilteredContainerSlot { override var item: ItemStack get() = this@MatteryContainer[slot] set(value) { this@MatteryContainer[slot] = value } @@ -460,12 +457,12 @@ open class MatteryContainer(var listener: ContainerListener, private val size: I } } - final override fun slotIterator(): kotlin.collections.Iterator { + final override fun slotIterator(): kotlin.collections.Iterator { indicesReferenced = true return nonEmptyIndices.iterator().map { Slot(it) } } - final override fun slotIterator(nonEmpty: Boolean): kotlin.collections.Iterator { + final override fun slotIterator(nonEmpty: Boolean): kotlin.collections.Iterator { if (!nonEmpty) { return (0 until size).iterator().map { Slot(it) } } else if (isEmpty) { @@ -476,7 +473,7 @@ open class MatteryContainer(var listener: ContainerListener, private val size: I } } - final override fun containerSlot(slot: Int): IFilteredContainerSlot { + final override fun containerSlot(slot: Int): Slot { return Slot(slot) }