feat: API is now functional ingame

This commit is contained in:
ForestOfLight
2026-06-03 23:46:32 +02:00
Unverified
parent 630d5e0950
commit 059d7b5c03
7 changed files with 69 additions and 41 deletions
@@ -64,7 +64,7 @@ export class InstanceOptions extends Option {
}
setLayer(layer) {
this.currentLayer = layer.floor();
this.currentLayer = Math.floor(layer);
this.save();
}
@@ -308,8 +308,9 @@ export class StructureInstance {
setOptions(newOptions) {
const newVerifierOptions = newOptions.verifier;
this.options.rename(newOptions.name);
this.options.setStructure(newOptions.structureId);
if (newOptions.name !== this.getName())
structureCollection.rename(this.getName(), newOptions.name);
this.setStructure(newOptions.structureId);
this.options.setEnabled(newOptions.isEnabled);
this.options.move(newOptions.dimensionId, newOptions.location);
this.options.setLayer(newOptions.currentLayer);
@@ -317,5 +318,6 @@ export class StructureInstance {
this.options.setVerifierDistance(newVerifierOptions.trackPlayerDistance);
this.options.setVerifierParticleLifetime(newVerifierOptions.particleLifetime);
this.options.save();
this.refreshBox();
}
}