Merge pull request #428 from Urelion/master

Make icons more flexible
This commit is contained in:
James Lyne 2022-05-18 21:41:02 +01:00 committed by GitHub
commit e3070c9039
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) ? mapName : 'flat';
break;
}