From d578db6fb2d9056faa1fe094b2fd55e9a40975a0 Mon Sep 17 00:00:00 2001 From: xtex Date: Thu, 10 Aug 2023 11:45:21 +0800 Subject: [PATCH] fix: crash --- .../src/main/kotlin/quaedam/projection/swarm/ai/ExchangeItem.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/main/kotlin/quaedam/projection/swarm/ai/ExchangeItem.kt b/common/src/main/kotlin/quaedam/projection/swarm/ai/ExchangeItem.kt index c614e5d..a9a03f7 100644 --- a/common/src/main/kotlin/quaedam/projection/swarm/ai/ExchangeItem.kt +++ b/common/src/main/kotlin/quaedam/projection/swarm/ai/ExchangeItem.kt @@ -62,7 +62,7 @@ class ExchangeItem : Behavior( owner.brain.eraseMemory(MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE) if (closeAt != null) { // opened - val chest = level.getBlockEntity(target!!)!! + val chest = level.getBlockEntity(target!!) ?: return if (chest is ChestBlockEntity) { ChestBlockEntity.playSound(level, target!!, level.getBlockState(target!!), SoundEvents.CHEST_CLOSE) }