From 360e1e8f944df9c47a215110f7b7fb7772849dd7 Mon Sep 17 00:00:00 2001 From: James Lyne Date: Thu, 20 May 2021 21:44:22 +0100 Subject: [PATCH] Improve world icon logic (Fixes #25) --- src/components/sidebar/WorldListItem.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/sidebar/WorldListItem.vue b/src/components/sidebar/WorldListItem.vue index c439e42..c5afe9c 100644 --- a/src/components/sidebar/WorldListItem.vue +++ b/src/components/sidebar/WorldListItem.vue @@ -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 {