From 91395db919b6367867065570aac016f7c3231956 Mon Sep 17 00:00:00 2001 From: Holly Date: Tue, 5 Dec 2023 20:36:50 +0000 Subject: [PATCH] stop storing individual worlds in class vars --- server/MinecraftServer.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/server/MinecraftServer.ts b/server/MinecraftServer.ts index 1b1e84c..4eaf72a 100644 --- a/server/MinecraftServer.ts +++ b/server/MinecraftServer.ts @@ -46,8 +46,6 @@ export class MinecraftServer { private clients:FunkyArray; public worlds:FunkyArray; public saveManager:WorldSaveManager; - private overworld:World; - private nether:World; // https://stackoverflow.com/a/7616484 // Good enough for the world seed. @@ -123,8 +121,8 @@ export class MinecraftServer { } this.worlds = new FunkyArray(); - this.worlds.set(0, this.overworld = new World(this.saveManager, 0, worldSeed, new HillyGenerator(worldSeed))); - this.worlds.set(-1, this.nether = new World(this.saveManager, -1, worldSeed, new NetherGenerator(worldSeed))); + this.worlds.set(0, new World(this.saveManager, 0, worldSeed, new HillyGenerator(worldSeed))); + this.worlds.set(-1, new World(this.saveManager, -1, worldSeed, new NetherGenerator(worldSeed))); // Generate spawn area (overworld) /*(async () => {