Redo managing structure how-to page and rename ./menu to ./structool

This commit is contained in:
ForestOfLight
2025-04-14 23:27:05 -07:00
Unverified
parent 0c361a2523
commit 8a380dc173
8 changed files with 46 additions and 30 deletions
+12 -1
View File
@@ -50,7 +50,18 @@ class StructureCollection {
}
getStructures(dimensionId, location, options = {}) {
return Object.values(this.structures).filter(structure => structure.isLocationActive(dimensionId, structure.toStructureCoords(location), options));
return Object.values(this.structures).filter(structure => {
try {
return structure.isLocationActive(dimensionId, structure.toStructureCoords(location), options)
} catch (e) {
if (e.name === 'InvalidStructureError') {
structureCollection.delete(structure.name);
return false;
} else {
throw e;
}
}
});
}
getStructure(dimensionId, location, options = {}) {