Make Upgrade container inherit EnhancedContainer instead

This commit is contained in:
DBotThePony 2025-03-06 16:11:37 +07:00
parent 9806e1ec52
commit c376a99da0
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -1,5 +1,6 @@
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.MatteryCapability
import ru.dbotthepony.mc.otm.capability.UpgradeType
@ -15,8 +16,13 @@ class UpgradeContainer(
slotCount: Int,
val allowedUpgrades: Set<UpgradeType> = UpgradeType.ALL,
val shouldLockUpgradeSlots: BooleanSupplier = BooleanSupplier { false },
listener: Runnable = Runnable {}
) : MatteryContainer(listener, slotCount), IMatteryUpgrade {
private val listener: Runnable = Runnable {}
) : EnhancedContainer(slotCount), IMatteryUpgrade {
override fun notifySlotChanged(slot: Int, old: ItemStack) {
super.notifySlotChanged(slot, old)
listener.run()
}
override val upgradeTypes: Set<UpgradeType>
get() = setOf()