Material grabber functional

This commit is contained in:
ForestOfLight
2025-04-21 02:15:27 -07:00
Unverified
parent 6d7db482c0
commit 6c32436cf0
8 changed files with 122 additions and 35 deletions
+8 -1
View File
@@ -59,7 +59,14 @@ export class MenuForm {
const structureId = await this.getStructureId();
if (!structureId)
return;
structureCollection.add(instanceName, structureId);
try {
structureCollection.add(instanceName, structureId);
} catch (e) {
if (e.name === 'InvalidInstanceError') {
this.player.sendMessage(`§cInstance '${instanceName}' already exists. Try again with a new name.`);
return void 0;
}
}
return instanceName;
});
}