From 9e320dea6bf48cd0481717d38d077ca5270f2356 Mon Sep 17 00:00:00 2001 From: sk89q Date: Fri, 26 Nov 2010 22:46:44 -0800 Subject: [PATCH] //smooth should now no longer pull water upwards. --- src/HeightMap.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/HeightMap.java b/src/HeightMap.java index c9739c500..1442916d1 100755 --- a/src/HeightMap.java +++ b/src/HeightMap.java @@ -123,14 +123,19 @@ public class HeightMap { // Depending on growing or shrinking we need to start at the bottom or top if (newHeight > curHeight) { // Set the top block of the column to be the same type (this might go wrong with rounding) - session.setBlock(new Vector(X, newHeight, Z), session.getBlock(new Vector(X, curHeight, Z))); - blocksChanged++; + BaseBlock existing = session.getBlock(new Vector(X, curHeight, Z)); - // Grow -- start from 1 below top replacing airblocks - for (int y = newHeight - 1 - originY; y >= 0; y--) { - int copyFrom = (int) (y * scale); - session.setBlock(new Vector(X, originY + y, Z), session.getBlock(new Vector(X, originY + copyFrom, Z))); + // Skip water/lava + if (existing.getID() < 8 || existing.getID() > 11) { + session.setBlock(new Vector(X, newHeight, Z), existing); blocksChanged++; + + // Grow -- start from 1 below top replacing airblocks + for (int y = newHeight - 1 - originY; y >= 0; y--) { + int copyFrom = (int) (y * scale); + session.setBlock(new Vector(X, originY + y, Z), session.getBlock(new Vector(X, originY + copyFrom, Z))); + blocksChanged++; + } } } else if (curHeight > newHeight) { // Shrink -- start from bottom