prevent structureVerifier from having multiple instances

This commit is contained in:
ForestOfLight
2025-06-04 19:05:44 -07:00
Unverified
parent 6ad128cc9c
commit 7b0afc529d
4 changed files with 19 additions and 6 deletions
@@ -136,7 +136,15 @@ export class InstanceForm {
}
async statisticsForm() {
const statsForm = await InstanceFormBuilder.buildStatistics(this.instance)
let statsForm;
try {
statsForm = await InstanceFormBuilder.buildStatistics(this.instance);
} catch (e) {
if (e.message === 'StructureVerifier is already running.') {
this.player.sendMessage('§cA verification is already in progress. Please wait until it finishes.');
return;
}
}
statsForm.form.show(this.player).then((response) => {
if (response.canceled && response.cancelationReason === FormCancelationReason.UserBusy)
this.player.sendMessage(statsForm.stats);