rendering: light accessor: fix potential NullPointerException

This commit is contained in:
Bixilon 2021-04-05 15:04:45 +02:00
parent f132d960a9
commit b3ee5ca849
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -70,7 +70,7 @@ class ElementRenderer(parent: BlockModelElement, val rotation: Vec3, uvLock: Boo
val texture = textureMapping[face.textureName] ?: TODO("Unknown texture used ${face.textureName}")
val lightLevel = lightAccessor.getLightLevel(blockPosition + directionMapping[face.cullFace]) // ToDo: rotate cullface
val lightLevel = lightAccessor.getLightLevel(blockPosition + face.cullFace?.let { directionMapping[it] }) // ToDo: rotate cullface
val drawPositions = arrayOf(transformedPositions[positionTemplate[0]], transformedPositions[positionTemplate[1]], transformedPositions[positionTemplate[2]], transformedPositions[positionTemplate[3]])