Start working at 1.2.0
/ build (push) Waiting to run

This commit is contained in:
2026-08-26 09:54:39 +08:00
Unverified
parent 36f2dd0685
commit 136d5ffa3b
159 changed files with 60793 additions and 617 deletions
+4 -4
View File
@@ -1,6 +1,6 @@
import { Command } from '../classes/Commands/Command';
import { CommandPermissionLevel, CustomCommandParamType, CustomCommandStatus, system } from '@minecraft/server';
import { structureCollection } from '../classes/Structure/StructureCollection';
import { instanceCollection } from '../classes/Instance/InstanceCollection';
export class RenameCommand extends Command {
constructor() {
@@ -17,12 +17,12 @@ export class RenameCommand extends Command {
}
run(origin, instanceName, newName) {
const instance = structureCollection.get(instanceName);
if (structureCollection.has(newName)) {
const instance = instanceCollection.get(instanceName);
if (instanceCollection.has(newName)) {
origin.sendMessage({ translate: 'construct.error.instanceExists', with: [newName] });
return void 0;
}
structureCollection.rename(instanceName, newName);
instanceCollection.rename(instanceName, newName);
origin.sendMessage({ translate: 'construct.commands.rename.success', with: [instanceName, newName] });
return { status: CustomCommandStatus.Success };
}