Skip to content

Commit 813c952

Browse files
committed
fix: fix lava rendering
1 parent ec142c0 commit 813c952

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

renderer/viewer/lib/mesher/models.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ function tintToGl (tint) {
103103
return [r / 255, g / 255, b / 255]
104104
}
105105

106-
function getLiquidRenderHeight (world: World, block: WorldBlock | null, type: number, pos: Vec3, isRealWater: boolean) {
107-
if (!isRealWater || (block && isBlockWaterlogged(block))) return 8 / 9
106+
function getLiquidRenderHeight (world: World, block: WorldBlock | null, type: number, pos: Vec3, isWater: boolean, isRealWater: boolean) {
107+
if ((isWater && !isRealWater) || (block && isBlockWaterlogged(block))) return 8 / 9
108108
if (!block || block.type !== type) return 1 / 9
109109
if (block.metadata === 0) { // source block
110110
const blockAbove = world.getBlock(pos.offset(0, 1, 0))
@@ -130,7 +130,7 @@ function renderLiquid (world: World, cursor: Vec3, texture: any | undefined, typ
130130
for (let z = -1; z <= 1; z++) {
131131
for (let x = -1; x <= 1; x++) {
132132
const pos = cursor.offset(x, 0, z)
133-
heights.push(getLiquidRenderHeight(world, world.getBlock(pos), type, pos, isRealWater))
133+
heights.push(getLiquidRenderHeight(world, world.getBlock(pos), type, pos, water, isRealWater))
134134
}
135135
}
136136
const cornerHeights = [

0 commit comments

Comments
 (0)