fix crash when calculating world brightness

* Happens when you go under water
This commit is contained in:
Bixilon 2022-09-18 20:53:45 +02:00
parent 05a0e335b0
commit 0e2df28bd3
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -403,7 +403,7 @@ class World(
fun getBrightness(position: BlockPosition): Float {
val light = getLight(position)
val level = maxOf(light and 0x0F, light and 0xF0)
val level = maxOf(light and 0x0F, light and 0xF0 shr 4)
return dimension?.lightLevels?.get(level) ?: 0.0f
}