start working on error handling stuff

This commit is contained in:
dfsek
2025-12-29 22:18:44 -07:00
parent 9a16336f53
commit cb08401536
76 changed files with 212 additions and 165 deletions
@@ -24,6 +24,6 @@ public class AirMatchPatternTemplate implements ObjectTemplate<Pattern> {
@Override
public Pattern get() {
return new MatchPattern(offset, BlockState::isAir);
return new MatchPattern(offset, BlockState::air);
}
}
@@ -26,6 +26,6 @@ public class BlockSetMatchPatternTemplate implements ObjectTemplate<Pattern> {
@Override
public Pattern get() {
return new MatchPattern(offset, blockState -> blocks.contains(blockState.getBlockType()));
return new MatchPattern(offset, blockState -> blocks.contains(blockState.blockType()));
}
}
@@ -21,6 +21,6 @@ public class SolidMatchPatternTemplate implements ObjectTemplate<Pattern> {
@Override
public Pattern get() {
return new MatchPattern(offset, blockState -> blockState.getBlockType().isSolid());
return new MatchPattern(offset, blockState -> blockState.blockType().solid());
}
}
@@ -28,7 +28,7 @@ public class SurfaceLocator implements Locator {
int min = Math.max(search.getMin(), column.getMinY());
if(min >= max) return builder.build();
for(int y = min; y < max; y++) {
if(column.getBlock(y).isAir() && !column.getBlock(y - 1).isAir()) {
if(column.getBlock(y).air() && !column.getBlock(y - 1).air()) {
builder.set(y);
}
}
@@ -23,7 +23,7 @@ public class TopLocator implements Locator {
@Override
public BinaryColumn getSuitableCoordinates(Column<?> column) {
for(int y = search.getMax(); y >= search.getMin(); y--) {
if(column.getBlock(y).isAir() && !column.getBlock(y - 1).isAir()) {
if(column.getBlock(y).air() && !column.getBlock(y - 1).air()) {
return new BinaryColumn(y, y + 1, yi -> true);
}
}