Compare commits

...

8 Commits

Author SHA1 Message Date
James Seibel 75193d76a3 Update the version number to 1.6.2a 2022-02-17 20:11:13 -06:00
James Seibel aa24fd341e Update the version number to 1.6.2a 2022-02-17 20:10:02 -06:00
tom lee d669b2a1fe Update and merge the render_test core 2022-02-17 22:26:48 +08:00
cola98765 2bd8dab240 #159 multiply color by color... not by alpha 2022-02-15 11:50:14 +01:00
cola98765 2b423c2edd squared colour averaging as in #159
please check if it works looks better.
2022-02-15 11:37:54 +01:00
cola98765 1a4faf4bdd close #188; fix lang parts in #189 2022-02-15 11:21:23 +01:00
cola98765 b70829aceb RotatedPillarBlock colors are taken form sides, resolving #191 2022-02-15 11:06:37 +01:00
cola98765 bba771d376 Potentially fix water texture packs. 2022-02-14 17:31:36 +01:00
4 changed files with 18 additions and 24 deletions
@@ -14,13 +14,7 @@ import com.seibel.lod.core.wrapperInterfaces.block.IBlockColorWrapper;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.core.Direction;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.BushBlock;
import net.minecraft.world.level.block.FlowerBlock;
import net.minecraft.world.level.block.GrassBlock;
import net.minecraft.world.level.block.LeavesBlock;
import net.minecraft.world.level.block.TallGrassBlock;
import net.minecraft.world.level.block.*;
import net.minecraft.world.level.block.state.BlockState;
@@ -125,7 +119,7 @@ public class BlockColorWrapper implements IBlockColorWrapper
for (Direction direction : directions)
{
quads = mc.getModelManager().getBlockModelShaper().getBlockModel(block.defaultBlockState()).getQuads(blockState, direction, random);
if (!quads.isEmpty())
if (!quads.isEmpty() && !(block instanceof RotatedPillarBlock && direction == Direction.UP))
break;
}
@@ -152,7 +146,7 @@ public class BlockColorWrapper implements IBlockColorWrapper
// generate the block's color
// for (int frameIndex = 0; frameIndex < texture.getFrameCount(); frameIndex++)
boolean lookForTint = grassInstance() || leavesInstance() || waterIstance();
boolean lookForTint = grassInstance() || leavesInstance() || waterInstance();
int frameIndex = 0; // TODO
{
@@ -170,7 +164,7 @@ public class BlockColorWrapper implements IBlockColorWrapper
{
// determine if this pixel is gray
int colorMax = Math.max(Math.max(ColorUtil.getBlue(tempColor), ColorUtil.getGreen(tempColor)), ColorUtil.getRed(tempColor));
int colorMin = 4 + Math.min(Math.min(ColorUtil.getBlue(tempColor), ColorUtil.getGreen(tempColor)), ColorUtil.getRed(tempColor));
int colorMin = 16 + Math.min(Math.min(ColorUtil.getBlue(tempColor), ColorUtil.getGreen(tempColor)), ColorUtil.getRed(tempColor));
boolean isGray = colorMax < colorMin;
if (isGray)
numberOfGreyPixel++;
@@ -186,10 +180,10 @@ public class BlockColorWrapper implements IBlockColorWrapper
// add to the running averages
count += colorMultiplier;
alpha += ColorUtil.getAlpha(tempColor) * colorMultiplier;
red += ColorUtil.getBlue(tempColor) * colorMultiplier;
green += ColorUtil.getGreen(tempColor) * colorMultiplier;
blue += ColorUtil.getRed(tempColor) * colorMultiplier;
alpha += ColorUtil.getAlpha(tempColor) * ColorUtil.getAlpha(tempColor) * colorMultiplier;
red += ColorUtil.getBlue(tempColor) * ColorUtil.getBlue(tempColor) * colorMultiplier;
green += ColorUtil.getGreen(tempColor) * ColorUtil.getGreen(tempColor) * colorMultiplier;
blue += ColorUtil.getRed(tempColor) * ColorUtil.getRed(tempColor) * colorMultiplier;
}
}
}
@@ -201,11 +195,11 @@ public class BlockColorWrapper implements IBlockColorWrapper
else
{
// determine the average color
alpha /= count;
red /= count;
green /= count;
blue /= count;
tempColor = ColorUtil.rgbToInt(alpha, red, green, blue);
tempColor = ColorUtil.rgbToInt(
(int) Math.sqrt(alpha / count),
(int) Math.sqrt(red / count),
(int) Math.sqrt(green / count),
(int) Math.sqrt(blue / count));
}
// determine if this block should use the biome color tint
@@ -217,7 +211,7 @@ public class BlockColorWrapper implements IBlockColorWrapper
this.foliageTint = leavesInstance() && toTint;
this.waterTint = waterIstance() && toTint;
this.waterTint = waterInstance();
//hardcoded leaves
if (block == Blocks.SPRUCE_LEAVES)
@@ -248,7 +242,7 @@ public class BlockColorWrapper implements IBlockColorWrapper
}
/** determine if the given block should use the biome's foliage color */
private boolean waterIstance()
private boolean waterInstance()
{
return block == Blocks.WATER;
}
@@ -178,7 +178,7 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
} catch (LinkageError e) {
try {
MinecraftWrapper.INSTANCE.sendChatMessage(
"\u00A7e\u00A7l\u00A7uWRANING: Distant Horizons: getVanillaRenderedChunks method failed."
"\u00A7e\u00A7l\u00A7uWARNING: Distant Horizons: getVanillaRenderedChunks method failed."
+ " Using Backup Method.");
MinecraftWrapper.INSTANCE.sendChatMessage(
"\u00A7eOverdraw prevention will be worse than normal.");
+1 -1
Submodule core updated: 2ba7c6be6e...fd81a8e067
+1 -1
View File
@@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx2048M
minecraft_version=1.18.1
archives_base_name=DistantHorizons
mod_version=1.6.1a
mod_version=1.6.2a
maven_group=com.seibel.lod
toml_version=3.6.4