Update MatteryContainer to fix compilation error

This commit is contained in:
DBotThePony 2025-02-28 15:38:37 +07:00
parent 9f6b9ad85b
commit 5e8ab76f49
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -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<IFilteredContainerSlot> {
final override fun slotIterator(): kotlin.collections.Iterator<Slot> {
indicesReferenced = true
return nonEmptyIndices.iterator().map { Slot(it) }
}
final override fun slotIterator(nonEmpty: Boolean): kotlin.collections.Iterator<IFilteredContainerSlot> {
final override fun slotIterator(nonEmpty: Boolean): kotlin.collections.Iterator<Slot> {
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)
}