From c376a99da057f7b6750192a08b8c6c9327723095 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Thu, 6 Mar 2025 16:11:37 +0700 Subject: [PATCH] Make Upgrade container inherit EnhancedContainer instead --- .../dbotthepony/mc/otm/container/UpgradeContainer.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/container/UpgradeContainer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/container/UpgradeContainer.kt index 0c0070806..78464971c 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/container/UpgradeContainer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/container/UpgradeContainer.kt @@ -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.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 get() = setOf()