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) }