rendering: tint: color lily pad, sugar canes, plants

This commit is contained in:
Bixilon 2021-02-24 22:29:14 +01:00
parent d37b504288
commit e215afb42b
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
2 changed files with 5 additions and 4 deletions

View File

@ -24,5 +24,8 @@ object RenderConstants {
val GRASS_OUT_OF_BOUNDS_COLOR = RGBColor(-65281)
val LILY_PAD_INVENTORY_COLOR = RGBColor("#71C35C")
val LILY_PAD_BLOCK_COLOR = RGBColor("#208030")
const val COLORMAP_SIZE = 255
}

View File

@ -30,7 +30,7 @@ class TintColorCalculator {
fun calculateTint(tint: ResourceLocation, biome: Biome): RGBColor? {
return when (tint) {
ResourceLocation("water_tint") -> biome.waterColor
ResourceLocation("grass_tint") -> {
ResourceLocation("grass_tint"), ResourceLocation("sugar_cane_tint"), ResourceLocation("shearing_double_plant_tint") -> {
val colorMapPixelIndex = biome.downfallColorMapCoordinate shl 8 or biome.temperatureColorMapCoordinate
var color = if (colorMapPixelIndex > grassColorMap.size) {
RenderConstants.GRASS_OUT_OF_BOUNDS_COLOR
@ -42,12 +42,10 @@ class TintColorCalculator {
}
biome.grassColorModifier.modifier.invoke(color)
}
ResourceLocation("shearing_double_plant_tint") -> RGBColor("#456789")
ResourceLocation("foliage_tint") -> {
foliageColorMap[biome.downfallColorMapCoordinate shl 8 or biome.temperatureColorMapCoordinate]
}
ResourceLocation("sugar_cane_tint") -> RGBColor("#654321")
ResourceLocation("lily_pad_tint") -> RGBColor("#987654")
ResourceLocation("lily_pad_tint") -> RenderConstants.LILY_PAD_BLOCK_COLOR
else -> null
}
}