From daee15dd3f79c0e2ae474f6d7b36aa0f7a5da3f0 Mon Sep 17 00:00:00 2001 From: James Lyne Date: Wed, 29 Sep 2021 21:35:26 +0100 Subject: [PATCH] Fix various issues with Pl3xmap world/map creation --- src/providers/Pl3xmapMapProvider.ts | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/providers/Pl3xmapMapProvider.ts b/src/providers/Pl3xmapMapProvider.ts index e58fd2e..230166e 100644 --- a/src/providers/Pl3xmapMapProvider.ts +++ b/src/providers/Pl3xmapMapProvider.ts @@ -122,13 +122,24 @@ export default class Pl3xmapMapProvider extends MapProvider { if(world.type === 'nether') { dimension = 'nether'; } else if(world.type === 'the_end') { - dimension = 'nether'; + dimension = 'end'; } const maps: Map = new Map(); + const w = { + name: world.name || '(Unnamed world)', + displayName: world.display_name || world.name, + dimension, + protected: false, + seaLevel: 0, + height: 256, + center: {x: worldResponse.spawn.x, y: 0, z: worldResponse.spawn.z}, + maps, + }; + maps.set('flat', Object.freeze(new LiveAtlasMapDefinition({ - world: world, + world: w, background: 'transparent', backgroundDay: 'transparent', @@ -143,16 +154,7 @@ export default class Pl3xmapMapProvider extends MapProvider { tileUpdateInterval: worldResponse.tiles_update_interval ? worldResponse.tiles_update_interval * 1000 : undefined, }))); - worlds.push({ - name: world.name || '(Unnamed world)', - displayName: world.display_name || world.name, - dimension, - protected: false, - seaLevel: 0, - height: 256, - center: {x: worldResponse.spawn.x, y: 0, z: worldResponse.spawn.z}, - maps, - }); + worlds.push(w); }); return Array.from(worlds.values());