Skip to content

Commit c75e8f9

Browse files
committed
Fix water blocks on chunk borders having the wrong height if there is a solid block above them.
1 parent 1bb1bcf commit c75e8f9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

chunky/src/java/se/llbit/chunky/renderer/scene/OctreeFinalizer.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,8 @@ private static void processBlock(Octree worldTree, Octree waterTree, BlockPalett
8585

8686
if (wmat instanceof Water) {
8787
Material above = waterTree.getMaterial(x, y + 1, z, palette);
88-
Material aboveBlock = worldTree.getMaterial(x, y + 1, z, palette);
8988
int level0 = 8 - ((Water) wmat).level;
90-
if (!above.isWaterFilled() && !aboveBlock.solid) {
89+
if (!above.isWaterFilled()) {
9190
int cornerSW = level0;
9291
int cornerSE = level0;
9392
int cornerNE = level0;
@@ -138,7 +137,7 @@ private static void processBlock(Octree worldTree, Octree waterTree, BlockPalett
138137
| (cornerSE << Water.CORNER_SE)
139138
| (cornerNE << Water.CORNER_NE)
140139
| (cornerNW << Water.CORNER_NW)), x, y, z);
141-
} else if (above.isWaterFilled()) {
140+
} else {
142141
waterTree.set(palette.getWaterId(0, 1 << Water.FULL_BLOCK), x, y, z);
143142
}
144143
} else if (mat instanceof Lava) {

0 commit comments

Comments
 (0)