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
@@ -1,6 +1,7 @@
import { MaterialsFormBuilder } from './MaterialsFormBuilder';
import { forceShow } from '../../utils';
import { Builders } from '../Builder/Builders';
import { structureCollection } from '../Structure/StructureCollection';
export class MaterialsForm {
constructor(player) {
@@ -10,14 +11,13 @@ export class MaterialsForm {
show() {
try {
return forceShow(this.player, MaterialsFormBuilder.buildInstanceSelector()).then((response) => {
return forceShow(this.player, MaterialsFormBuilder.buildInstanceSelector(this.player)).then((response) => {
if (response.canceled)
return;
let selection = response.selection;
const selectedInstanceName = structureCollection.getInstanceNames()[selection];
const selectedInstanceName = structureCollection.getInstanceNames()[response.selection];
if (selectedInstanceName) {
this.setActiveInstance(selectedInstanceName);
this.player.sendMessage(`§8Selected instance for material grabber: §2${selectedInstanceName}`);
this.player.sendMessage(`§7Selected instance for material grabber: §2${selectedInstanceName}`);
return;
}
});