Make Upgrade container inherit EnhancedContainer instead
This commit is contained in:
parent
9806e1ec52
commit
c376a99da0
@ -1,5 +1,6 @@
|
|||||||
package ru.dbotthepony.mc.otm.container
|
package ru.dbotthepony.mc.otm.container
|
||||||
|
|
||||||
|
import net.minecraft.world.item.ItemStack
|
||||||
import ru.dbotthepony.mc.otm.capability.IMatteryUpgrade
|
import ru.dbotthepony.mc.otm.capability.IMatteryUpgrade
|
||||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||||
import ru.dbotthepony.mc.otm.capability.UpgradeType
|
import ru.dbotthepony.mc.otm.capability.UpgradeType
|
||||||
@ -15,8 +16,13 @@ class UpgradeContainer(
|
|||||||
slotCount: Int,
|
slotCount: Int,
|
||||||
val allowedUpgrades: Set<UpgradeType> = UpgradeType.ALL,
|
val allowedUpgrades: Set<UpgradeType> = UpgradeType.ALL,
|
||||||
val shouldLockUpgradeSlots: BooleanSupplier = BooleanSupplier { false },
|
val shouldLockUpgradeSlots: BooleanSupplier = BooleanSupplier { false },
|
||||||
listener: Runnable = Runnable {}
|
private val listener: Runnable = Runnable {}
|
||||||
) : MatteryContainer(listener, slotCount), IMatteryUpgrade {
|
) : EnhancedContainer(slotCount), IMatteryUpgrade {
|
||||||
|
override fun notifySlotChanged(slot: Int, old: ItemStack) {
|
||||||
|
super.notifySlotChanged(slot, old)
|
||||||
|
listener.run()
|
||||||
|
}
|
||||||
|
|
||||||
override val upgradeTypes: Set<UpgradeType>
|
override val upgradeTypes: Set<UpgradeType>
|
||||||
get() = setOf()
|
get() = setOf()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user