@@ -1,7 +1,7 @@
|
||||
import { Command } from '../classes/Commands/Command';
|
||||
import { CommandPermissionLevel, CustomCommandParamType, CustomCommandStatus, system, world } from '@minecraft/server';
|
||||
import { Vector } from '../lib/Vector';
|
||||
import { structureCollection } from '../classes/Structure/StructureCollection';
|
||||
import { instanceCollection } from '../classes/Instance/InstanceCollection';
|
||||
import { PlayerCommandOrigin } from '../classes/Commands/PlayerCommandOrigin';
|
||||
|
||||
export class MoveCommand extends Command {
|
||||
@@ -13,7 +13,7 @@ export class MoveCommand extends Command {
|
||||
{ name: 'instanceName', type: CustomCommandParamType.String }
|
||||
],
|
||||
optionalParameters: [
|
||||
{ name: 'dimensionId', type: CustomCommandParamType.Enum }, // Enum defined in PlaceCommand.js
|
||||
{ name: 'dimensionId', type: CustomCommandParamType.Enum }, // Enum defined in PlaceCommand
|
||||
{ name: 'location', type: CustomCommandParamType.Location }
|
||||
],
|
||||
permissionLevel: CommandPermissionLevel.Any,
|
||||
@@ -22,7 +22,7 @@ export class MoveCommand extends Command {
|
||||
}
|
||||
|
||||
run(origin, instanceName, dimensionId, location) {
|
||||
const instance = structureCollection.get(instanceName);
|
||||
const instance = instanceCollection.get(instanceName);
|
||||
if (dimensionId === void 0 || location === void 0) {
|
||||
if (!(origin instanceof PlayerCommandOrigin))
|
||||
return { status: CustomCommandStatus.Failure, message: 'construct.commands.move.locationRequired' };
|
||||
|
||||
Reference in New Issue
Block a user