From db7cacf445b11b38ee60f98bb144d5b795956fb8 Mon Sep 17 00:00:00 2001 From: Bixilon Date: Fri, 21 Oct 2022 10:29:15 +0200 Subject: [PATCH] debug hud: add more info if chunk is not fully loaded --- .../gui/hud/elements/other/DebugHUDElement.kt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/bixilon/minosoft/gui/rendering/gui/hud/elements/other/DebugHUDElement.kt b/src/main/java/de/bixilon/minosoft/gui/rendering/gui/hud/elements/other/DebugHUDElement.kt index 274312799..31fc33171 100644 --- a/src/main/java/de/bixilon/minosoft/gui/rendering/gui/hud/elements/other/DebugHUDElement.kt +++ b/src/main/java/de/bixilon/minosoft/gui/rendering/gui/hud/elements/other/DebugHUDElement.kt @@ -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 }