Guess overviewer world dimensions from world name

This commit is contained in:
James Lyne 2022-02-26 13:52:24 +00:00
parent f472422281
commit f794dcb813

View File

@ -20,7 +20,6 @@
import { import {
LiveAtlasAreaMarker, LiveAtlasAreaMarker,
LiveAtlasComponentConfig, LiveAtlasComponentConfig,
LiveAtlasDimension,
LiveAtlasMarker, LiveAtlasMarker,
LiveAtlasMarkerSet, LiveAtlasPointMarker, LiveAtlasMarkerSet, LiveAtlasPointMarker,
LiveAtlasServerConfig, LiveAtlasServerConfig,
@ -29,7 +28,14 @@ import {
} from "@/index"; } from "@/index";
import {MutationTypes} from "@/store/mutation-types"; import {MutationTypes} from "@/store/mutation-types";
import MapProvider from "@/providers/MapProvider"; import MapProvider from "@/providers/MapProvider";
import {getBoundsFromPoints, getDefaultMinecraftHead, getMiddle, runSandboxed, stripHTML,} from "@/util"; import {
getBoundsFromPoints,
getDefaultMinecraftHead,
getMiddle,
guessWorldDimension,
runSandboxed,
stripHTML,
} from "@/util";
import ConfigurationError from "@/errors/ConfigurationError"; import ConfigurationError from "@/errors/ConfigurationError";
import {LiveAtlasTileLayer, LiveAtlasTileLayerOptions} from "@/leaflet/tileLayer/LiveAtlasTileLayer"; import {LiveAtlasTileLayer, LiveAtlasTileLayerOptions} from "@/leaflet/tileLayer/LiveAtlasTileLayer";
import {OverviewerTileLayer} from "@/leaflet/tileLayer/OverviewerTileLayer"; import {OverviewerTileLayer} from "@/leaflet/tileLayer/OverviewerTileLayer";
@ -63,7 +69,7 @@ export default class OverviewerMapProvider extends MapProvider {
//Not used by overviewer //Not used by overviewer
expandUI: false, expandUI: false,
defaultZoom: 0, defaultZoom: 0, //Defined per map
defaultMap: undefined, defaultMap: undefined,
defaultWorld: undefined, defaultWorld: undefined,
followMap: undefined, followMap: undefined,
@ -74,9 +80,9 @@ export default class OverviewerMapProvider extends MapProvider {
private static buildMessagesConfig(response: any): LiveAtlasServerMessageConfig { private static buildMessagesConfig(response: any): LiveAtlasServerMessageConfig {
return { return {
worldsHeading: 'Worlds', worldsHeading: 'Worlds',
playersHeading: 'Players',
//Not used by pl3xmap //Not used by overviewer
playersHeading: '',
chatPlayerJoin: '', chatPlayerJoin: '',
chatPlayerQuit: '', chatPlayerQuit: '',
chatAnonymousJoin: '', chatAnonymousJoin: '',
@ -95,7 +101,7 @@ export default class OverviewerMapProvider extends MapProvider {
worlds.set(world, { worlds.set(world, {
name: world, name: world,
displayName: world, displayName: world,
dimension: 'overworld' as LiveAtlasDimension, dimension: guessWorldDimension(world),
seaLevel: 64, seaLevel: 64,
center: {x: 0, y: 64, z: 0}, center: {x: 0, y: 64, z: 0},
maps: new Set<LiveAtlasMapDefinition>(), maps: new Set<LiveAtlasMapDefinition>(),