fix MatchPattern

This commit is contained in:
dfsek
2022-06-18 00:56:58 -07:00
parent 522d4e4d3a
commit 1d8c012ae5
@@ -43,10 +43,10 @@ public class MatchPattern implements Pattern {
@Override @Override
public boolean matches(WritableWorld world, int x, int y, int z) { public boolean matches(WritableWorld world, int x, int y, int z) {
int min = FastMath.max(world.getMinHeight(), range.getMin() + y); int min = FastMath.max(world.getMinHeight(), range.getMin() + y);
int max = FastMath.min(world.getMinHeight(), range.getMax() + y); int max = FastMath.min(world.getMaxHeight(), range.getMax() + y);
if(max <= min) return false; if(max <= min) return false;
for(int i = min; i < max; i++) { for(int i = min; i < max; i++) {
if(!matches.test(world.getBlockState(x, y, z))) return false; if(!matches.test(world.getBlockState(x, i, z))) return false;
} }
return true; return true;
} }