cap height at 255
This commit is contained in:
parent
9f0602f2ec
commit
a7cc08a882
@ -43,7 +43,7 @@ public class HeightBrush implements Brush {
|
|||||||
int xx = pos.getBlockX();
|
int xx = pos.getBlockX();
|
||||||
int zz = pos.getBlockZ();
|
int zz = pos.getBlockZ();
|
||||||
int worldPointHeight = session.getHighestTerrainBlock(xx, zz, minY, maxY);
|
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 x = xx - minX;
|
||||||
int z = zz - minZ;
|
int z = zz - minZ;
|
||||||
heightArray[x][z] = (byte) pointHeight;
|
heightArray[x][z] = (byte) pointHeight;
|
||||||
|
Loading…
Reference in New Issue
Block a user