fix: crash on startup

This commit is contained in:
xtex 2023-07-26 21:33:29 +08:00
parent e60de5a03a
commit 03861f193b
Signed by: xtex
GPG Key ID: B918086ED8045B91

View File

@ -49,8 +49,8 @@ object NoiseProjection {
init { init {
ClientTickEvent.CLIENT_POST.register { game -> ClientTickEvent.CLIENT_POST.register { game ->
val player = game.player!! val player = game.player ?: return@register
val random = game.level!!.random val random = (game.level ?: return@register).random
val projections = Projector.findNearbyProjections(player.level(), player.blockPosition(), effect.get()) val projections = Projector.findNearbyProjections(player.level(), player.blockPosition(), effect.get())
if (projections.isNotEmpty()) { if (projections.isNotEmpty()) {
val rate = projections.maxOf { it.rate } val rate = projections.maxOf { it.rate }