Now is standalone from Canopy

This commit is contained in:
ForestOfLight
2025-04-20 02:06:55 -07:00
Unverified
parent d6c9acdaab
commit 1ca91a0993
28 changed files with 256 additions and 151 deletions
+7 -2
View File
@@ -2,6 +2,7 @@ import { Command } from '../lib/canopy/CanopyExtension';
import { extension } from '../config';
import { world, system } from '@minecraft/server';
import { MenuForm } from '../classes/MenuForm';
import { structureCollection } from '../classes/Structure/StructureCollection'
const ACTION_ITEM = 'minecraft:paper';
@@ -21,7 +22,11 @@ world.beforeEvents.itemUse.subscribe((event) => {
function openMenu(sender, event = void 0) {
const options = { jumpToInstance: true }
if (event)
options.instanceName = event.itemStack?.typeId;
if (event) {
const instanceNames = structureCollection.getInstanceNames();
const instanceName = event.itemStack?.nameTag;
if (instanceNames.includes(instanceName))
options.instanceName = instanceName;
}
new MenuForm(sender, options);
}