Refactoring StructureInstance

This commit is contained in:
ForestOfLight
2025-04-18 01:22:50 -07:00
Unverified
parent 35b7575d2f
commit 80aed5f349
16 changed files with 372 additions and 313 deletions
@@ -4,13 +4,13 @@ import { Vector } from "../lib/Vector";
export class BlockVerificationLevelRender {
opacity = 0.2;
lifetime = 0;
lifetimeSeconds = 0;
constructor(dimensionLocation, verificationLevel, lifetime = 5) {
constructor(dimensionLocation, verificationLevel, lifetimeSeconds = 5) {
this.dimension = dimensionLocation.dimension;
this.location = new Vector(dimensionLocation.location.x, dimensionLocation.location.y, dimensionLocation.location.z);
this.location = Vector.from(dimensionLocation.location);
this.verificationLevel = verificationLevel;
this.lifetime = lifetime;
this.lifetimeSeconds = lifetimeSeconds;
this.renderBlock();
}
@@ -19,7 +19,7 @@ export class BlockVerificationLevelRender {
const color = this.getRGBAMolang();
if (!color)
return;
color.setFloat("lifetime", this.lifetime);
color.setFloat("lifetime", this.lifetimeSeconds);
try {
this.dimension.spawnParticle(particleLocation.particleType, particleLocation.location, color);
} catch {