binary column SurfaceLocator

This commit is contained in:
dfsek
2021-07-28 08:40:48 -07:00
parent fda44b8e99
commit 19861ec27b
@@ -21,11 +21,13 @@ public class SurfaceLocator implements Locator {
@Override @Override
public BinaryColumn getSuitableCoordinates(Column column) { public BinaryColumn getSuitableCoordinates(Column column) {
BinaryColumn location = new BinaryColumn(column.getMinY(), column.getMaxY());
for(int y : search) { for(int y : search) {
if(column.getBlock(y).matches(air) && !column.getBlock(y-1).matches(air)) { if(column.getBlock(y).matches(air) && !column.getBlock(y-1).matches(air)) {
return Collections.singletonList(y); location.set(y);
return location;
} }
} }
return Collections.emptyList(); return location;
} }
} }