Datafix harness: pre-1.17 worlds in worlds-pre-1.17, which other worktrees' harnesses do not read
This commit is contained in:
@@ -44,7 +44,7 @@ LEGACY = {'1.8.9', '1.9.4', '1.10.2', '1.11.2', '1.12.2', '1.13.2', '1.14.4', '1
|
||||
|
||||
|
||||
def worlds_dir(name):
|
||||
return (LOCAL if name.split('-')[0] in LEGACY else SHARED) / 'worlds'
|
||||
return LOCAL / 'worlds-pre-1.17' if name.split('-')[0] in LEGACY else SHARED / 'worlds'
|
||||
|
||||
|
||||
VERSIONS = ['1.8.9', '1.9.4', '1.10.2', '1.11.2', '1.12.2', '1.13.2', '1.14.4', '1.15.2', '1.16.1', '1.16.5', '1.17.1', '1.18.1', '1.18.2', '1.19', '1.19.2', '1.19.3', '1.19.4', '1.20.1', '1.20.2', '1.20.4', '1.20.5', '1.20.6', '1.21.1',
|
||||
|
||||
@@ -54,7 +54,7 @@ IGNORED = {
|
||||
|
||||
|
||||
def world_path(name):
|
||||
return (LOCAL / 'worlds' if (LOCAL / 'worlds' / name).is_dir() else WORLDS) / name
|
||||
return (LOCAL / 'worlds-pre-1.17' if (LOCAL / 'worlds-pre-1.17' / name).is_dir() else WORLDS) / name
|
||||
|
||||
|
||||
def java_classpath():
|
||||
@@ -222,7 +222,7 @@ def main():
|
||||
if missing:
|
||||
print('generating sample worlds:', ' '.join(missing), flush=True)
|
||||
subprocess.run([sys.executable, str(ROOT / 'tools' / 'datafix_worlds.py'), *missing], cwd=ROOT, check=True)
|
||||
worlds = sorted(p.name for d in (WORLDS, LOCAL / 'worlds') if d.is_dir() for p in d.iterdir() if p.is_dir())
|
||||
worlds = sorted(p.name for d in (WORLDS, LOCAL / 'worlds-pre-1.17') if d.is_dir() for p in d.iterdir() if p.is_dir())
|
||||
band = args.band
|
||||
if band and not args.versions: # worlds in the layout of before 1.16, saved before the target
|
||||
worlds = [w for w in worlds if json.loads((world_path(w) / 'datafix-source.json').read_text())['data_version'] < band]
|
||||
|
||||
Reference in New Issue
Block a user