This commit is contained in:
Jesse Boyd 2018-04-27 09:00:19 +10:00
parent 8e3e5b0d14
commit eaa8fbfc9d
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -73,14 +73,14 @@ public class HeightMap {
int bz = min.getBlockZ(); int bz = min.getBlockZ();
Iterable<Vector2D> flat = Regions.asFlatRegion(region).asFlatRegion(); Iterable<Vector2D> flat = Regions.asFlatRegion(region).asFlatRegion();
Iterator<Vector2D> iter = new Fast2DIterator(flat, session).iterator(); Iterator<Vector2D> iter = new Fast2DIterator(flat, session).iterator();
int y = 0; int layer = 0;
MutableBlockVector mutable = new MutableBlockVector(); MutableBlockVector mutable = new MutableBlockVector();
while (iter.hasNext()) { while (iter.hasNext()) {
Vector2D pos = iter.next(); Vector2D pos = iter.next();
int x = pos.getBlockX(); int x = pos.getBlockX();
int z = pos.getBlockZ(); int z = pos.getBlockZ();
y = session.getNearestSurfaceLayer(x, z, y, 0, maxY); layer = session.getNearestSurfaceLayer(x, z, (layer + 7) >> 3, 0, maxY);
data[(z - bz) * width + (x - bx)] = y; data[(z - bz) * width + (x - bx)] = layer;
} }
} else { } else {
// Store current heightmap data // Store current heightmap data