Improve world icon logic (Fixes #25)

This commit is contained in:
James Lyne 2021-05-20 21:44:22 +01:00
parent fcf124c9ef
commit 360e1e8f94

View File

@ -58,7 +58,7 @@ export default defineComponent({
computed: {
currentMap(): DynmapWorldMap | undefined {
return useStore().state.currentMap;
}
},
},
methods: {
@ -66,10 +66,10 @@ export default defineComponent({
let worldType: string,
mapType: string;
if (this.world.name.endsWith('_nether') || (this.world.name == 'DIM-1')) {
if (/(^|_)nether(_|$)/i.test(this.world.name) || (this.world.name == 'DIM-1')) {
worldType = 'nether';
mapType = (map.name == 'nether') ? 'surface' : 'flat';
} else if (this.world.name.endsWith('the_end') || (this.world.name == 'DIM1')) {
} else if (/(^|_)end(_|$)/i.test(this.world.name) || (this.world.name == 'DIM1')) {
worldType = 'the_end';
mapType = (map.name == 'the_end') ? 'surface' : 'flat';
} else {