Files
Construct-CN/packs/BP/scripts/classes/Instance/FlexibleInstanceMove.js
T
2025-09-18 11:08:34 -07:00

35 lines
822 B
JavaScript

export class FlexibleInstanceMove {
player;
instance;
constructor(instance, player) {
this.instance = instance;
this.player = player;
this.tryBeginFlexibleMove();
}
tryBeginFlexibleMove() {
if (this.instance.isFlexMoving) {
this.feedback('§cThis instance is already being moved.');
return;
}
this.beginFlexibleMove();
}
beginFlexibleMove() {
// place structure in movement mode
this.instance.startFlexibleMove(this.player);
// lock player controls
// start handling player movement controls
}
endFlexibleMove() {
this.instance.stopFlexibleMove();
}
feedback(str) {
this.player.sendMessage(str);
}
}
// if the player logs out, stop the move