mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2025-01-28 11:11:25 +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
@ -81,8 +81,6 @@ public HiresModel render(WorldTile tile, AABB region) {
|
|||||||
for (int y = min.getY(); y <= max.getY(); y++){
|
for (int y = min.getY(); y <= max.getY(); y++){
|
||||||
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 {
|
||||||
@ -98,8 +96,13 @@ 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