fix crash when trying to place block above dimensions max height

This commit is contained in:
Bixilon 2022-05-10 22:49:36 +02:00
parent 38e5f54319
commit 68a74b0fb3
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -174,7 +174,7 @@ class Chunk(
private fun getOrPut(sectionHeight: Int): ChunkSection? {
val sections = sections ?: return null
val sectionIndex = sectionHeight - lowestSection
if (sectionIndex < 0 || sectionIndex > sections.size) {
if (sectionIndex < 0 || sectionIndex >= sections.size) {
return null
}