network: mark blocks as initialized if server sends empty chunk

* This fixes a bug, that empty chunks (in custom worlds) are marked as not fully received
This commit is contained in:
Bixilon 2022-10-23 17:30:14 +02:00
parent afcc0a4b2f
commit b7a84f9dfa
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
2 changed files with 2 additions and 5 deletions

View File

@ -87,7 +87,7 @@ class ConnectionUtil(
sendSignedMessage(privateKey, message)
}
fun sendSignedMessage(privateKey: PrivateKey = connection.player.privateKey?.private!!, message: String) {
fun sendSignedMessage(privateKey: PrivateKey = connection.player.privateKey!!.private, message: String) {
val salt = random.nextLong()
val time = Instant.now()
val uuid = connection.player.uuid

View File

@ -14,7 +14,6 @@
package de.bixilon.minosoft.util.chunk
import de.bixilon.kotlinglm.vec2.Vec2i
import de.bixilon.kutil.array.ArrayUtil.isEmptyOrOnlyNull
import de.bixilon.kutil.cast.CastUtil.unsafeCast
import de.bixilon.minosoft.config.StaticConfiguration
import de.bixilon.minosoft.data.registries.biomes.Biome
@ -204,9 +203,7 @@ object ChunkUtil {
}
}
if (!sectionBlocks.isEmptyOrOnlyNull()) {
chunkData.blocks = sectionBlocks
}
if (lightReceived > 0) {
chunkData.light = light
}