Ignore fully translucent blocks in the terrain-height calculation

This makes sure that, e.g. barrier-blocks are not visible on the lowres map. Fixes #83
This commit is contained in:
Blue (Lukas Rieger) 2020-09-07 12:28:14 +02:00
parent fea7d9a1cd
commit 5d82c40884

View File

@ -82,8 +82,6 @@ public HiresModel render(WorldTile tile, AABB region) {
Block block = world.getBlock(x, y, z); Block block = world.getBlock(x, y, z);
if (block.getBlockState().equals(BlockState.AIR)) continue; if (block.getBlockState().equals(BlockState.AIR)) continue;
maxHeight = y;
BlockStateModel blockModel; BlockStateModel blockModel;
try { try {
blockModel = modelFactory.createFrom(block); blockModel = modelFactory.createFrom(block);
@ -99,7 +97,12 @@ public HiresModel render(WorldTile tile, AABB region) {
blockModel.translate(new Vector3f(x, y, z).sub(modelMin.toFloat())); blockModel.translate(new Vector3f(x, y, z).sub(modelMin.toFloat()));
color = MathUtils.overlayColors(blockModel.getMapColor(), color); //update color and height (only if not 100% translucent)
Vector4f blockColor = blockModel.getMapColor();
if (blockColor.getW() > 0) {
maxHeight = y;
color = MathUtils.overlayColors(blockModel.getMapColor(), color);
}
//TODO: quick hack to random offset grass //TODO: quick hack to random offset grass
if (block.getBlockState().getFullId().equals(grassId)){ if (block.getBlockState().getFullId().equals(grassId)){