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;
Builders.onLeave(event.player.id);
});
world.afterEvents.worldLoad.subscribe((event) => {
world.afterEvents.worldLoad.subscribe(() => {
for (const player of world.getAllPlayers()) {
if (!player)
continue;
@@ -252,7 +252,7 @@ export class StructureInstance {
disableInstanceWhenNoPlayersOnline() {
// This prevents a memory leak when no players are online.
world.beforeEvents.playerLeave.subscribe(event => {
world.beforeEvents.playerLeave.subscribe(() => {
system.run(() => {
if (world.getAllPlayers().length === 0 && this.options.isEnabled) {
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) {
console.info(`[Construct] A player rejoined. Re-enabling instance: '${this.options.instanceName}'`);
this.enable();
+4 -4
View File
@@ -55,13 +55,13 @@ export class MenuForm {
async createNewInstance() {
return MenuFormBuilder.buildNewInstance().show(this.player).then(async (response) => {
if (response.canceled)
return;
return void 0;
const instanceName = response.formValues[0];
if (instanceName === '')
return void 0;
const structureId = await this.getStructureId();
if (!structureId)
return;
return void 0;
try {
structureCollection.add(instanceName, structureId);
} catch (e) {
@@ -82,7 +82,7 @@ export class MenuForm {
async getStructureId() {
return MenuFormBuilder.buildAllStructures().show(this.player).then((response) => {
if (response.canceled)
return;
return void 0;
const selectedStructureId = structureCollection.getWorldStructureIds()[response.selection];
return selectedStructureId || this.getOtherStructureId();
});
@@ -91,7 +91,7 @@ export class MenuForm {
getOtherStructureId() {
return MenuFormBuilder.buildOtherStructure().show(this.player).then((response) => {
if (response.canceled)
return;
return void 0;
const structureId = response.formValues[0];
if (structureId === '')
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";
export class Outliner {
-1
View File
@@ -1,5 +1,4 @@
import { structureCollection } from "./Structure/StructureCollection";
import { world } from "@minecraft/server";
export class Raycaster {
static STEP_SIZE = 0.2;