biome: test color map index

This commit is contained in:
Moritz Zwerger 2023-10-10 20:16:27 +02:00
parent f9d9325384
commit 4824fdda05
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
2 changed files with 31 additions and 4 deletions

View File

@ -28,11 +28,11 @@ data class Biome(
override val identifier: ResourceLocation, override val identifier: ResourceLocation,
val temperature: Float, val temperature: Float,
val downfall: Float, val downfall: Float,
val skyColor: RGBColor?, val skyColor: RGBColor? = null,
val fogColor: RGBColor? = null, val fogColor: RGBColor? = null,
val waterColor: RGBColor?, val waterColor: RGBColor? = null,
val waterFogColor: RGBColor?, val waterFogColor: RGBColor? = null,
val precipitation: BiomePrecipitation?, val precipitation: BiomePrecipitation? = null,
) : RegistryItem() { ) : RegistryItem() {
val grassColorModifier = GrassColorModifiers.BIOME_MAP[identifier] val grassColorModifier = GrassColorModifiers.BIOME_MAP[identifier]
val temperatureColorMapCoordinate = getColorMapCoordinate(temperature) val temperatureColorMapCoordinate = getColorMapCoordinate(temperature)

View File

@ -0,0 +1,27 @@
/*
* Minosoft
* Copyright (C) 2020-2023 Moritz Zwerger
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* This software is not affiliated with Mojang AB, the original developer of Minecraft.
*/
package de.bixilon.minosoft.data.registries.biomes
import de.bixilon.minosoft.data.registries.identified.Namespaces.minecraft
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
class BiomeTest {
@Test
fun `color map index`() {
val biome = Biome(minecraft("plains"), temperature = 0.8f, downfall = 0.4f)
assertEquals(biome.colorMapPixelIndex, 44338)
}
}