sun, moon: check if renderable in dimension

This commit is contained in:
Bixilon 2022-11-03 19:57:36 +01:00
parent 2b1d89811a
commit c669a1dafe
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
2 changed files with 14 additions and 0 deletions

View File

@ -73,6 +73,13 @@ class MoonRenderer(
return Random((day / MoonPhases.VALUES.size).murmur64()).nextFloat(0.0f, 0.2f)
}
override fun draw() {
if (!sky.properties.moon) {
return
}
super.draw()
}
companion object {
private val MOON_PHASES = minecraft("environment/moon_phases").texture()

View File

@ -53,6 +53,13 @@ class SunRenderer(
return Random(day.murmur64()).nextFloat(0.0f, 0.2f)
}
override fun draw() {
if (!sky.properties.sun) {
return
}
super.draw()
}
companion object {
private val SUN = minecraft("environment/sun").texture()
}