From f533d084f4c5c97f689c1b754a62f2075fe0e7a2 Mon Sep 17 00:00:00 2001 From: ChrissW-R1 Date: Wed, 11 May 2022 21:22:58 +0200 Subject: [PATCH 1/2] added icons for non-standard map names. --- src/model/LiveAtlasMapDefinition.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/model/LiveAtlasMapDefinition.ts b/src/model/LiveAtlasMapDefinition.ts index 7bb3862..6c17ce1 100644 --- a/src/model/LiveAtlasMapDefinition.ts +++ b/src/model/LiveAtlasMapDefinition.ts @@ -139,21 +139,23 @@ export default class LiveAtlasMapDefinition implements LiveAtlasTileLayerOptions return this.icon; } + let mapName = this.name.split(/[^a-zA-Z\d]/, 1)[0]; + switch(this.world.dimension) { case 'nether': worldType = 'nether'; - mapType = ['surface', 'nether'].includes(this.name) ? 'surface' : 'flat'; + mapType = ['surface', 'nether'].includes(mapName) ? 'surface' : 'flat'; break; case 'end': worldType = 'the_end'; - mapType = ['surface', 'the_end'].includes(this.name) ? 'surface' : 'flat'; + mapType = ['surface', 'the_end'].includes(mapName) ? 'surface' : 'flat'; break; case 'overworld': default: worldType = 'world'; - mapType = ['surface', 'flat', 'biome', 'cave'].includes(this.name) ? this.name : 'flat'; + mapType = ['surface', 'flat', 'biome', 'cave'].includes(mapName) ? this.name : 'flat'; break; } From 14facbbd1c485b509623d3b5cf047c75590beae0 Mon Sep 17 00:00:00 2001 From: ChrissW-R1 Date: Wed, 11 May 2022 21:45:50 +0200 Subject: [PATCH 2/2] use split map name for as type --- src/model/LiveAtlasMapDefinition.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/model/LiveAtlasMapDefinition.ts b/src/model/LiveAtlasMapDefinition.ts index 6c17ce1..35271e4 100644 --- a/src/model/LiveAtlasMapDefinition.ts +++ b/src/model/LiveAtlasMapDefinition.ts @@ -155,7 +155,7 @@ export default class LiveAtlasMapDefinition implements LiveAtlasTileLayerOptions case 'overworld': default: worldType = 'world'; - mapType = ['surface', 'flat', 'biome', 'cave'].includes(mapName) ? this.name : 'flat'; + mapType = ['surface', 'flat', 'biome', 'cave'].includes(mapName) ? mapName : 'flat'; break; }