Skip to content

Commit 2b550fd

Browse files
committed
genPOI: fix handling of new dimension format
Fixes #1778.
1 parent 1355f8c commit 2b550fd

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

overviewer_core/aux_files/genPOI.py

+14-2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@
3737
UUID_LOOKUP_URL = 'https://sessionserver.mojang.com/session/minecraft/profile/'
3838

3939

40+
DIMENSION_INT_TO_STR = {
41+
0: "minecraft:overworld",
42+
-1: "minecraft:the_nether",
43+
1: "minecraft:the_end"
44+
}
45+
46+
4047
def replaceBads(s):
4148
"Replaces bad characters with good characters!"
4249
bads = [" ", "(", ")"]
@@ -356,14 +363,19 @@ def handlePlayers(worldpath, filters, markers):
356363
dimension = int(re.match(r"^DIM(_MYST)?(-?\d+)$", rset.get_type()).group(2))
357364
else:
358365
dimension = 0
366+
dimension = DIMENSION_INT_TO_STR.get(dimension, "minecraft:overworld")
367+
368+
read_dim = data.get("Dimension", "minecraft:overworld")
369+
if type(read_dim) == int:
370+
DIMENSION_INT_TO_STR.get(read_dim, "minecraft:overworld")
359371

360-
if data.get('Dimension', 0) == dimension:
372+
if read_dim == dimension:
361373
result = filter_function(data)
362374
if result:
363375
d = create_marker_from_filter_result(data, result)
364376
markers[name]['raw'].append(d)
365377

366-
if dimension == 0 and "SpawnX" in data:
378+
if dimension == "minecraft:overworld" and "SpawnX" in data:
367379
result = filter_function(spawn)
368380
if result:
369381
d = create_marker_from_filter_result(spawn, result)

0 commit comments

Comments
 (0)