Improve world icon logic (Fixes #25)
This commit is contained in:
parent
fcf124c9ef
commit
360e1e8f94
@ -58,7 +58,7 @@ export default defineComponent({
|
|||||||
computed: {
|
computed: {
|
||||||
currentMap(): DynmapWorldMap | undefined {
|
currentMap(): DynmapWorldMap | undefined {
|
||||||
return useStore().state.currentMap;
|
return useStore().state.currentMap;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@ -66,10 +66,10 @@ export default defineComponent({
|
|||||||
let worldType: string,
|
let worldType: string,
|
||||||
mapType: 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';
|
worldType = 'nether';
|
||||||
mapType = (map.name == 'nether') ? 'surface' : 'flat';
|
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';
|
worldType = 'the_end';
|
||||||
mapType = (map.name == 'the_end') ? 'surface' : 'flat';
|
mapType = (map.name == 'the_end') ? 'surface' : 'flat';
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user