refactor: rename source -> origin in all commands
This commit is contained in:
@@ -17,16 +17,16 @@ export class MoveCommand extends Command {
|
||||
{ name: 'location', type: CustomCommandParamType.Location }
|
||||
],
|
||||
permissionLevel: CommandPermissionLevel.Any,
|
||||
callback: (source, instanceName, dimensionId, location) => this.run(source, instanceName, dimensionId, location)
|
||||
callback: (origin, instanceName, dimensionId, location) => this.run(origin, instanceName, dimensionId, location)
|
||||
});
|
||||
}
|
||||
|
||||
run(source, instanceName, dimensionId, location) {
|
||||
run(origin, instanceName, dimensionId, location) {
|
||||
const instance = structureCollection.get(instanceName);
|
||||
if (dimensionId === void 0 || location === void 0) {
|
||||
if (!(source instanceof PlayerCommandOrigin))
|
||||
if (!(origin instanceof PlayerCommandOrigin))
|
||||
return { status: CustomCommandStatus.Failure, message: 'construct.commands.move.locationRequired' };
|
||||
const player = source.getSource();
|
||||
const player = origin.getSource();
|
||||
location = player.location;
|
||||
dimensionId = player.dimension.id;
|
||||
}
|
||||
@@ -34,7 +34,7 @@ export class MoveCommand extends Command {
|
||||
const flooredLocation = Vector.from(location).floor();
|
||||
system.run(() => {
|
||||
instance.move(dimensionId, flooredLocation);
|
||||
source.sendMessage({ translate: 'construct.commands.move.success', with: [instanceName, flooredLocation.toString(), dimensionId.replace('minecraft:', '')] });
|
||||
origin.sendMessage({ translate: 'construct.commands.move.success', with: [instanceName, flooredLocation.toString(), dimensionId.replace('minecraft:', '')] });
|
||||
});
|
||||
return { status: CustomCommandStatus.Success };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user