rendering: fix NullPointerException in chunk preparing

This commit is contained in:
Bixilon 2021-04-04 22:15:24 +02:00
parent 6ab06cbdfd
commit 40d253ea84
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -117,14 +117,14 @@ class BlockRenderer : BlockRenderInterface {
return
}
for (direction in Directions.DIRECTIONS) {
val rotatedDirection = directionMapping[direction]!!
val rotatedDirection = directionMapping[direction] ?: direction
val invertedDirection = direction.inversed
var isNeighbourTransparent = false
var neighbourFaceSize: Array<FaceSize>? = null
val neighbourBlock = neighbourBlocks[direction.ordinal]
neighbourBlock?.getBlockRenderer(blockPosition + direction)?.let {
val itDirection = if (it is BlockRenderer) {
it.directionMapping[invertedDirection]!!
it.directionMapping[invertedDirection] ?: invertedDirection
} else {
invertedDirection
}