start flexible movement

This commit is contained in:
ForestOfLight
2025-09-18 11:08:34 -07:00
Unverified
parent 6e1883edd0
commit 2d4631c1f7
5 changed files with 59 additions and 0 deletions
@@ -15,6 +15,7 @@ export class StructureInstance {
verifier = void 0;
verificationRenderer = void 0;
materials = void 0;
flexMovingPlayerId = void 0;
constructor(instanceName, structureId) {
this.structure = new Structure(structureId);
@@ -245,6 +246,23 @@ export class StructureInstance {
this.setLayer(this.options.currentLayer - 1);
}
startFlexibleMove(player) {
this.flexMovingPlayerId = player.id;
this.disable();
// create flex movement outliner
}
stopFlexibleMove(finalLocation) {
// disable flex movement outliner
this.move(this.getDimension(), finalLocation);
this.enable();
this.flexMovingPlayerId = void 0;
}
isFlexibleMoving() {
return this.flexMovingPlayerId !== void 0;
}
disableInstanceWhenNoPlayersOnline() {
// This prevents a memory leak when no players are online.
world.beforeEvents.playerLeave.subscribe(event => {