fix: crash

This commit is contained in:
2023-08-10 11:45:21 +08:00
parent 296fe1efc2
commit d578db6fb2

View File

@ -62,7 +62,7 @@ class ExchangeItem<E> : Behavior<E>(
owner.brain.eraseMemory(MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE) owner.brain.eraseMemory(MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE)
if (closeAt != null) { if (closeAt != null) {
// opened // opened
val chest = level.getBlockEntity(target!!)!! val chest = level.getBlockEntity(target!!) ?: return
if (chest is ChestBlockEntity) { if (chest is ChestBlockEntity) {
ChestBlockEntity.playSound(level, target!!, level.getBlockState(target!!), SoundEvents.CHEST_CLOSE) ChestBlockEntity.playSound(level, target!!, level.getBlockState(target!!), SoundEvents.CHEST_CLOSE)
} }