debug hud: add more info if chunk is not fully loaded

This commit is contained in:
Bixilon 2022-10-21 10:29:15 +02:00
parent ba7d4b9988
commit db7cacf445
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -284,7 +284,18 @@ class DebugHUDElement(guiRenderer: GUIRenderer) : Element(guiRenderer), Layouted
this@DebugWorldInfo += AutoTextElement(guiRenderer, 1) { BaseComponent("Sky properties ", connection.world.dimension?.skyProperties) }
this@DebugWorldInfo += AutoTextElement(guiRenderer, 1) { BaseComponent("Biome ", biome) }
this@DebugWorldInfo += AutoTextElement(guiRenderer, 1) { with(connection.world.getLight(eyeBlockPosition)) { BaseComponent("Light block=", (this and SectionLight.BLOCK_LIGHT_MASK), ", sky=", ((this and SectionLight.SKY_LIGHT_MASK) shr 4)) } }
this@DebugWorldInfo += AutoTextElement(guiRenderer, 1) { BaseComponent("Fully loaded: ", world[chunkPosition]?.isFullyLoaded) }
this@DebugWorldInfo += AutoTextElement(guiRenderer, 1) {
var value: Any = chunk.isFullyLoaded
if (!chunk.isFullyLoaded) {
val builder = StringBuilder()
if (chunk.blocksInitialized) builder.append('s') // for block states
if (chunk.biomesInitialized) builder.append('b') // biomes
if (chunk.neighbours != null) builder.append('n') // neighbours
value = builder.toString()
}
BaseComponent("Fully loaded: ", value)
}
lastChunk = chunk
}