debug hud: show weather

This commit is contained in:
Bixilon 2022-11-02 19:07:36 +01:00
parent bc1c1d1233
commit d6fcbb25bc
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
3 changed files with 8 additions and 1 deletions

View File

@ -72,7 +72,7 @@ class World(
var difficulty: WorldDifficulty? by watched(null)
var hashedSeed = 0L
var time by watched(WorldTime(this))
var weather = WorldWeather()
var weather by watched(WorldWeather())
val view = WorldView(connection)
val border = WorldBorder()
private val random = Random

View File

@ -181,6 +181,11 @@ class DebugHUDElement(guiRenderer: GUIRenderer) : Element(guiRenderer), Layouted
)
}
}
layout += TextElement(guiRenderer, "Weather TBA").apply {
connection.world::weather.observe(this) { // ToDo: Kutil 1.18: Allow instant fire
text = BaseComponent("Weather r=", it.rain, ", t=", it.thunder)
}
}
layout += AutoTextElement(guiRenderer, 1) { "Fun effect: " + renderWindow.framebufferManager.world.`fun`.effect?.resourceLocation.format() }

View File

@ -240,6 +240,8 @@ class SkyboxRenderer(
// no daylight cycle (e.g. nether)
return calculateBiomeAvg { it.fogColor }
}
// TODO: Check if wither is present
val weather = sky.renderWindow.connection.world.weather
if (weather.thunder > 0.0f) {