fix: crash on startup

This commit is contained in:
2023-07-26 21:33:29 +08:00
parent e60de5a03a
commit 03861f193b

View File

@ -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 }