remove unused imports & stop mixing returns with and without values

This commit is contained in:
ForestOfLight
2026-02-11 14:02:06 -08:00
Unverified
parent 68c9ad5ef2
commit 2a83907162
5 changed files with 8 additions and 9 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ world.beforeEvents.playerLeave.subscribe((event) => {
return; return;
Builders.onLeave(event.player.id); Builders.onLeave(event.player.id);
}); });
world.afterEvents.worldLoad.subscribe((event) => { world.afterEvents.worldLoad.subscribe(() => {
for (const player of world.getAllPlayers()) { for (const player of world.getAllPlayers()) {
if (!player) if (!player)
continue; continue;
@@ -252,7 +252,7 @@ export class StructureInstance {
disableInstanceWhenNoPlayersOnline() { disableInstanceWhenNoPlayersOnline() {
// This prevents a memory leak when no players are online. // This prevents a memory leak when no players are online.
world.beforeEvents.playerLeave.subscribe(event => { world.beforeEvents.playerLeave.subscribe(() => {
system.run(() => { system.run(() => {
if (world.getAllPlayers().length === 0 && this.options.isEnabled) { if (world.getAllPlayers().length === 0 && this.options.isEnabled) {
console.info(`[Construct] No players are online. Disabling instance: '${this.options.instanceName}'`); console.info(`[Construct] No players are online. Disabling instance: '${this.options.instanceName}'`);
@@ -261,7 +261,7 @@ export class StructureInstance {
} }
}); });
}); });
world.afterEvents.playerJoin.subscribe(event => { world.afterEvents.playerJoin.subscribe(() => {
if (this.shouldEnableOnJoin) { if (this.shouldEnableOnJoin) {
console.info(`[Construct] A player rejoined. Re-enabling instance: '${this.options.instanceName}'`); console.info(`[Construct] A player rejoined. Re-enabling instance: '${this.options.instanceName}'`);
this.enable(); this.enable();
+4 -4
View File
@@ -55,13 +55,13 @@ export class MenuForm {
async createNewInstance() { async createNewInstance() {
return MenuFormBuilder.buildNewInstance().show(this.player).then(async (response) => { return MenuFormBuilder.buildNewInstance().show(this.player).then(async (response) => {
if (response.canceled) if (response.canceled)
return; return void 0;
const instanceName = response.formValues[0]; const instanceName = response.formValues[0];
if (instanceName === '') if (instanceName === '')
return void 0; return void 0;
const structureId = await this.getStructureId(); const structureId = await this.getStructureId();
if (!structureId) if (!structureId)
return; return void 0;
try { try {
structureCollection.add(instanceName, structureId); structureCollection.add(instanceName, structureId);
} catch (e) { } catch (e) {
@@ -82,7 +82,7 @@ export class MenuForm {
async getStructureId() { async getStructureId() {
return MenuFormBuilder.buildAllStructures().show(this.player).then((response) => { return MenuFormBuilder.buildAllStructures().show(this.player).then((response) => {
if (response.canceled) if (response.canceled)
return; return void 0;
const selectedStructureId = structureCollection.getWorldStructureIds()[response.selection]; const selectedStructureId = structureCollection.getWorldStructureIds()[response.selection];
return selectedStructureId || this.getOtherStructureId(); return selectedStructureId || this.getOtherStructureId();
}); });
@@ -91,7 +91,7 @@ export class MenuForm {
getOtherStructureId() { getOtherStructureId() {
return MenuFormBuilder.buildOtherStructure().show(this.player).then((response) => { return MenuFormBuilder.buildOtherStructure().show(this.player).then((response) => {
if (response.canceled) if (response.canceled)
return; return void 0;
const structureId = response.formValues[0]; const structureId = response.formValues[0];
if (structureId === '') if (structureId === '')
return void 0; return void 0;
+1 -1
View File
@@ -1,4 +1,4 @@
import { MolangVariableMap, system, TicksPerSecond, world } from "@minecraft/server"; import { MolangVariableMap, system, TicksPerSecond } from "@minecraft/server";
import { Vector } from "../lib/Vector"; import { Vector } from "../lib/Vector";
export class Outliner { export class Outliner {
-1
View File
@@ -1,5 +1,4 @@
import { structureCollection } from "./Structure/StructureCollection"; import { structureCollection } from "./Structure/StructureCollection";
import { world } from "@minecraft/server";
export class Raycaster { export class Raycaster {
static STEP_SIZE = 0.2; static STEP_SIZE = 0.2;