stop storing individual worlds in class vars

This commit is contained in:
Holly Stubbs 2023-12-05 20:36:50 +00:00
parent 9231ce85d6
commit 91395db919
Signed by: tgpholly
GPG key ID: B8583C4B7D18119E

View file

@ -46,8 +46,6 @@ export class MinecraftServer {
private clients:FunkyArray<string, MPClient>; private clients:FunkyArray<string, MPClient>;
public worlds:FunkyArray<number, World>; public worlds:FunkyArray<number, World>;
public saveManager:WorldSaveManager; public saveManager:WorldSaveManager;
private overworld:World;
private nether:World;
// https://stackoverflow.com/a/7616484 // https://stackoverflow.com/a/7616484
// Good enough for the world seed. // Good enough for the world seed.
@ -123,8 +121,8 @@ export class MinecraftServer {
} }
this.worlds = new FunkyArray<number, World>(); this.worlds = new FunkyArray<number, World>();
this.worlds.set(0, this.overworld = new World(this.saveManager, 0, worldSeed, new HillyGenerator(worldSeed))); this.worlds.set(0, 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(-1, new World(this.saveManager, -1, worldSeed, new NetherGenerator(worldSeed)));
// Generate spawn area (overworld) // Generate spawn area (overworld)
/*(async () => { /*(async () => {