From 96d902bc98240cc47e1e8304c58828bfadc9be0c Mon Sep 17 00:00:00 2001 From: DBotThePony <dbotthepony@yandex.ru> Date: Mon, 24 Feb 2025 16:29:11 +0700 Subject: [PATCH] Type specific setChanged override in MatterySlot --- src/main/kotlin/ru/dbotthepony/mc/otm/menu/Slots.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/Slots.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/Slots.kt index 640b6156a..c5482b474 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/Slots.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/Slots.kt @@ -51,6 +51,14 @@ inline fun <S : Slot> makeSlots(containers: List<Container>?, size: Int, initial open class MatterySlot(container: Container, index: Int, x: Int = 0, y: Int = 0) : Slot(container, index, x, y) { var ignoreSpectators = true + override fun setChanged() { + if (container is IMatteryContainer) { + (container as IMatteryContainer).setChanged(index) + } else { + super.setChanged() + } + } + override fun mayPickup(player: Player): Boolean { return super.mayPickup(player) && (!ignoreSpectators || !player.isSpectator) }