From a7cc08a8821d0b5629e56eebc890f823699457d5 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Mon, 2 May 2016 12:09:21 +1000 Subject: [PATCH] cap height at 255 --- .../src/main/java/com/boydti/fawe/object/brush/HeightBrush.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/com/boydti/fawe/object/brush/HeightBrush.java b/core/src/main/java/com/boydti/fawe/object/brush/HeightBrush.java index e24ddba5..d2a18dae 100644 --- a/core/src/main/java/com/boydti/fawe/object/brush/HeightBrush.java +++ b/core/src/main/java/com/boydti/fawe/object/brush/HeightBrush.java @@ -43,7 +43,7 @@ public class HeightBrush implements Brush { int xx = pos.getBlockX(); int zz = pos.getBlockZ(); int worldPointHeight = session.getHighestTerrainBlock(xx, zz, minY, maxY); - int pointHeight = (256 * (worldPointHeight - minY)) / selHeight; + int pointHeight = Math.min(255, (256 * (worldPointHeight - minY)) / selHeight); int x = xx - minX; int z = zz - minZ; heightArray[x][z] = (byte) pointHeight;