From 59ea00dabceeddf01fec7bf87ec548d7beedd7cc Mon Sep 17 00:00:00 2001 From: nea Date: Fri, 26 May 2023 23:23:03 +0200 Subject: Fix bug in WFixedPanel and use WScrollPanel + WBox for config --- src/main/kotlin/moe/nea/firmament/events/IsSlotProtectedEvent.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main/kotlin/moe/nea/firmament/events') diff --git a/src/main/kotlin/moe/nea/firmament/events/IsSlotProtectedEvent.kt b/src/main/kotlin/moe/nea/firmament/events/IsSlotProtectedEvent.kt index 30fc0d8..d7cf467 100644 --- a/src/main/kotlin/moe/nea/firmament/events/IsSlotProtectedEvent.kt +++ b/src/main/kotlin/moe/nea/firmament/events/IsSlotProtectedEvent.kt @@ -28,7 +28,8 @@ data class IsSlotProtectedEvent( ) : FirmamentEvent() { companion object : FirmamentEventBus() { @JvmStatic - fun shouldBlockInteraction(slot: Slot): Boolean { + fun shouldBlockInteraction(slot: Slot?): Boolean { + if (slot == null) return false return publish(IsSlotProtectedEvent(slot)).isProtected.also { if (it) { MC.player?.sendMessage(Text.translatable("firmament.protectitem").append(slot.stack.name)) -- cgit