Now is standalone from Canopy
This commit is contained in:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user