here, try this runVerifier

This commit is contained in:
ForestOfLight
2025-04-15 09:46:15 -07:00
Unverified
parent 891eb67bbd
commit 962154feec
@@ -17,21 +17,45 @@ export class StructureVerifier {
async runVerifier() {
return new Promise((resolve) => {
this.verifyBlocks();
resolve();
system.runJob(this.verifyBlocks);
const checker = system.runInterval(() => {
if (this.isComplete) {
system.clearRun(checker);
resolve();
}
}, 1);
});
}
verifyBlocks() {
*verifyBlocks() {
for (const block of this.instance.getBlocks()) {
const verificationLevel = this.verifyBlock(block.location);
if (verificationLevel !== BlockVerificationLevel.isAir)
this.blockVerificationLevels[JSON.stringify(block.location)] = verificationLevel;
else
this.statistics.correctlyAir++;
yield;
}
this.isComplete = true;
}
// async runVerifier() {
// return new Promise((resolve) => {
// this.verifyBlocks();
// resolve();
// });
// }
// verifyBlocks() {
// for (const block of this.instance.getBlocks()) {
// const verificationLevel = this.verifyBlock(block.location);
// if (verificationLevel !== BlockVerificationLevel.isAir)
// this.blockVerificationLevels[JSON.stringify(block.location)] = verificationLevel;
// else
// this.statistics.correctlyAir++;
// }
// }
verifyBlock(location) {
const worldBlock = this.instance.getDimension().getBlock(this.instance.toGlobalCoords(location));
if (!worldBlock)