Skip to content

Commit 4fca00a

Browse files
authored
Determine spawner format from world version
1 parent 8fa7723 commit 4fca00a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

WorldTranslationExtractor.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import amulet_nbt as n
33
from tqdm import tqdm
44

5-
OLD_SPAWNER_FORMAT = True # If this is false, uses 1.18+ nbt paths for spawners
5+
OLD_SPAWNER_FORMAT = False
66

77
REG = re.compile(r'"text" *: *"((?:[^"\\]|\\\\"|\\.)*)"')
88
REG2 = re.compile(r'\\"text\\" *: *\\"((?:[^"\\]|\\\\.)*)\\"')
@@ -324,7 +324,7 @@ def gen_lang(path):
324324
def main():
325325
print("\nWorld Translation Extractor, by Suso. Using amulet core.\n")
326326

327-
if len(sys.argv) != 2:
327+
if len(sys.argv) < 2:
328328
print("Usage: python {} <world>".format(sys.argv[0]))
329329
exit(0)
330330

@@ -336,6 +336,10 @@ def main():
336336
print("\nScanning chunks...")
337337
try:
338338
level = amulet.load_level(sys.argv[1])
339+
if level.level_wrapper.version < 2826:
340+
global OLD_SPAWNER_FORMAT
341+
OLD_SPAWNER_FORMAT = True
342+
print("Using old spawner format.")
339343
scan_world(level)
340344
except Exception as e:
341345
print("Error loading world:", e)

0 commit comments

Comments
 (0)