mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2025-02-05 15:11:21 +01:00
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:
parent
fea7d9a1cd
commit
5d82c40884
@ -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)){
|
||||||
|
Loading…
Reference in New Issue
Block a user