From 03861f193bf71ca6b34532ba2a861cea6001c7d0 Mon Sep 17 00:00:00 2001 From: xtex Date: Wed, 26 Jul 2023 21:33:29 +0800 Subject: [PATCH] fix: crash on startup --- .../main/kotlin/quaedam/projection/misc/NoiseProjection.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/main/kotlin/quaedam/projection/misc/NoiseProjection.kt b/common/src/main/kotlin/quaedam/projection/misc/NoiseProjection.kt index e645963..3b6bb5d 100644 --- a/common/src/main/kotlin/quaedam/projection/misc/NoiseProjection.kt +++ b/common/src/main/kotlin/quaedam/projection/misc/NoiseProjection.kt @@ -49,8 +49,8 @@ object NoiseProjection { init { ClientTickEvent.CLIENT_POST.register { game -> - val player = game.player!! - val random = game.level!!.random + val player = game.player ?: return@register + val random = (game.level ?: return@register).random val projections = Projector.findNearbyProjections(player.level(), player.blockPosition(), effect.get()) if (projections.isNotEmpty()) { val rate = projections.maxOf { it.rate }