grass is actually using texture now

This commit is contained in:
cola98765
2021-09-17 12:55:14 +02:00
parent 83571951be
commit fa1d950ff9
2 changed files with 16 additions and 9 deletions
@@ -618,9 +618,9 @@ public class LodBuilder
{
if (texture.isTransparent(k, i, j))
{
if (blockState.getBlock() instanceof LeavesBlock)
/*if (blockState.getBlock() instanceof LeavesBlock)
color = 0;
else
else*/
continue;
} else
{
@@ -706,21 +706,24 @@ public class LodBuilder
else if (blockState.getBlock() instanceof LeavesBlock || blockState.getBlock() == Blocks.VINE)
{
brightness = getColorTextureForBlock(blockState, blockPos, false);
colorInt = ColorUtil.changeBrightnessValue(biome.getFoliageColor(), brightness);
//colorInt = ColorUtil.changeBrightnessValue(biome.getFoliageColor(), brightness);
colorInt = ColorUtil.multiplyRGBcolors(biome.getFoliageColor(), brightness);
} else if ((blockState.getBlock() instanceof GrassBlock || blockState.getBlock() instanceof AbstractPlantBlock
|| blockState.getBlock() instanceof BushBlock || blockState.getBlock() instanceof IGrowable)
&& !(blockState.getBlock() == Blocks.BROWN_MUSHROOM || blockState.getBlock() == Blocks.RED_MUSHROOM))
{
/*brightness = getColorTextureForBlock(blockState, blockPos, true);
colorInt = ColorUtil.changeBrightnessValue(biome.getGrassColor(x, z), brightness);*/
colorInt = ColorUtil.applySaturationAndBrightnessMultipliers(biome.getGrassColor(x, z), 1f, 0.65f);
brightness = ColorUtil.applySaturationAndBrightnessMultipliers(getColorTextureForBlock(blockState, blockPos, true),1f, 1.2f);
//colorInt = ColorUtil.changeBrightnessValue(biome.getGrassColor(x, z), brightness);
//colorInt = ColorUtil.applySaturationAndBrightnessMultipliers(biome.getGrassColor(x, z), 1f, 0.65f);
colorInt = ColorUtil.multiplyRGBcolors(biome.getGrassColor(x, z), brightness);
}
// water
else if (blockState.getBlock() == Blocks.WATER)
{
/*brightness = getColorTextureForBlock(blockState, blockPos, true);
colorInt = ColorUtil.changeBrightnessValue(biome.getWaterColor(), brightness);*/
colorInt = ColorUtil.applySaturationAndBrightnessMultipliers(biome.getWaterColor(), 1f, 0.75f);
brightness = getColorTextureForBlock(blockState, blockPos, true);
//colorInt = ColorUtil.changeBrightnessValue(biome.getWaterColor(), brightness);
//colorInt = ColorUtil.applySaturationAndBrightnessMultipliers(biome.getWaterColor(), 1f, 0.75f);
colorInt = ColorUtil.multiplyRGBcolors(biome.getWaterColor(), brightness);
}
// everything else
@@ -92,4 +92,8 @@ public class ColorUtil
hsv[1],
brightness).getRGB();
}
public static int multiplyRGBcolors(int color1, int color2)
{
return (((getAlpha(color1) * getAlpha(color2)) << 16) & 0xFF000000) | (((getRed(color1) * getRed(color2)) << 8) & 0xFF0000) | ((getGreen(color1) * getGreen(color2)) & 0xFF00) | (((getBlue(color1) * getBlue(color2)) >> 8) & 0xFF);
}
}