From a97c9cb796e1b08d0003a5855348e2f0efc10cea Mon Sep 17 00:00:00 2001 From: ForestOfLight Date: Wed, 20 May 2026 17:21:23 -0700 Subject: [PATCH] feat: rename /list -> /instances --- .../{ListCommand.js => InstancesCommand.js} | 22 +++++++++---------- packs/BP/scripts/main.js | 2 +- packs/RP/texts/en_US.lang | 18 +++++++-------- 3 files changed, 21 insertions(+), 21 deletions(-) rename packs/BP/scripts/commands/{ListCommand.js => InstancesCommand.js} (72%) diff --git a/packs/BP/scripts/commands/ListCommand.js b/packs/BP/scripts/commands/InstancesCommand.js similarity index 72% rename from packs/BP/scripts/commands/ListCommand.js rename to packs/BP/scripts/commands/InstancesCommand.js index dccd5e4..f3d628c 100644 --- a/packs/BP/scripts/commands/ListCommand.js +++ b/packs/BP/scripts/commands/InstancesCommand.js @@ -2,11 +2,11 @@ import { CommandPermissionLevel, CustomCommandStatus, system } from '@minecraft/ import { Command } from '../classes/Commands/Command'; import { structureCollection } from '../classes/Structure/StructureCollection'; -export class ListCommand extends Command { +export class InstancesCommand extends Command { constructor() { super({ - name: 'list', - description: 'construct.commands.list', + name: 'instances', + description: 'construct.commands.instances', permissionLevel: CommandPermissionLevel.Any, callback: (source) => this.run(source) }); @@ -15,16 +15,16 @@ export class ListCommand extends Command { run(source) { const names = structureCollection.getInstanceNames(); if (names.length === 0) - return { status: CustomCommandStatus.Success, message: 'construct.commands.list.empty' }; + return { status: CustomCommandStatus.Success, message: 'construct.commands.instances.empty' }; const rawtext = [ - { translate: 'construct.commands.list.header', with: [String(names.length)] }, + { translate: 'construct.commands.instances.header', with: [String(names.length)] }, { text: '\n' } ]; for (const name of names) { const instance = structureCollection.get(name); const status = this.formatStatus(instance); rawtext.push({ - translate: 'construct.commands.list.row', + translate: 'construct.commands.instances.row', with: { rawtext: [{ text: name }, { text: instance.getStructureId() }, status] } }); rawtext.push({ text: '\n' }); @@ -36,17 +36,17 @@ export class ListCommand extends Command { formatStatus(instance) { const statusMessage = { rawtext: [] }; if (instance.isEnabled()) - statusMessage.rawtext.push({ translate: 'construct.commands.list.row.enabled' }); + statusMessage.rawtext.push({ translate: 'construct.commands.instances.row.enabled' }); else - statusMessage.rawtext.push({ translate: 'construct.commands.list.row.disabled' }); + statusMessage.rawtext.push({ translate: 'construct.commands.instances.row.disabled' }); if (instance.hasLocation()) { const { dimensionId, location } = instance.getLocation(); - statusMessage.rawtext.push({ translate: 'construct.commands.list.row.location', with: [location.toString(), dimensionId.replace('minecraft:', '')] }); + statusMessage.rawtext.push({ translate: 'construct.commands.instances.row.location', with: [location.toString(), dimensionId.replace('minecraft:', '')] }); } else { - statusMessage.rawtext.push({ translate: 'construct.commands.list.row.nolocation' }); + statusMessage.rawtext.push({ translate: 'construct.commands.instances.row.nolocation' }); } return statusMessage; } } -export const listCommand = new ListCommand(); +export const instancesCommand = new InstancesCommand(); diff --git a/packs/BP/scripts/main.js b/packs/BP/scripts/main.js index 6af027f..78a64c0 100644 --- a/packs/BP/scripts/main.js +++ b/packs/BP/scripts/main.js @@ -14,7 +14,7 @@ import './commands/ConstructCommand'; import './commands/CreateCommand'; import './commands/DeleteCommand'; import './commands/RenameCommand'; -import './commands/ListCommand'; +import './commands/InstancesCommand'; import './commands/PlaceCommand'; import './commands/MoveCommand'; import './commands/ActiveCommand'; diff --git a/packs/RP/texts/en_US.lang b/packs/RP/texts/en_US.lang index 1079a2d..04f56e4 100644 --- a/packs/RP/texts/en_US.lang +++ b/packs/RP/texts/en_US.lang @@ -117,15 +117,15 @@ construct.commands.delete.success=§aDeleted instance "%1". construct.commands.rename=Rename an existing Construct instance. construct.commands.rename.success=§aRenamed instance "%1" to "%2". -## construct:list -construct.commands.list=List all registered Construct instances. -construct.commands.list.empty=§7No instances registered. -construct.commands.list.header=§aRegistered instances (%1):§r -construct.commands.list.row=§a%1§r §8[§r%2§8]§r §7%3§r -construct.commands.list.row.enabled=enabled -construct.commands.list.row.disabled=disabled -construct.commands.list.row.location= at %1 in %2 -construct.commands.list.row.nolocation= (no location) +## construct:instances +construct.commands.instances=List all registered Construct instances. +construct.commands.instances.empty=§7No instances registered. +construct.commands.instances.header=§aRegistered instances (%1):§r +construct.commands.instances.row=§a%1§r §8[§r%2§8]§r §7%3§r +construct.commands.instances.row.enabled=enabled +construct.commands.instances.row.disabled=disabled +construct.commands.instances.row.location= at %1 in %2 +construct.commands.instances.row.nolocation= (no location) ## construct:place construct.commands.place=Place a Construct instance in the world.