Skip to content

Commit

Permalink
Fix various issues with Pl3xmap world/map creation
Browse files Browse the repository at this point in the history
  • Loading branch information
JLyne committed Sep 29, 2021
1 parent dc479ca commit daee15d
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/providers/Pl3xmapMapProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, LiveAtlasMapDefinition> = 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',
Expand All @@ -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());
Expand Down

0 comments on commit daee15d

Please sign in to comment.