diff --git a/nbt-to-mcstructure/__main__.py b/nbt-to-mcstructure/__main__.py index 5c7d41a..9ef0bc6 100644 --- a/nbt-to-mcstructure/__main__.py +++ b/nbt-to-mcstructure/__main__.py @@ -7,15 +7,13 @@ from os import listdir, makedirs, remove from os.path import isfile, join, isdir import threading -import json +from better_json_tools import load_jsonc structurePath = 'BP/structures' # Path of structures settings_path = './data/nbt-to-mcstructure/settings.json' # Load settings file -with open(settings_path, "r") as f: - json_file = f.read() - settings = json.loads(json_file) +settings = load_jsonc(settings_path).data def get_custom_mapping(structure_id): for entry in settings.get("block_mapping", []): diff --git a/nbt-to-mcstructure/requirements.txt b/nbt-to-mcstructure/requirements.txt index b89f8ca..c72a38b 100644 --- a/nbt-to-mcstructure/requirements.txt +++ b/nbt-to-mcstructure/requirements.txt @@ -3,3 +3,4 @@ mdurl==0.1.2 mutf8==1.0.6 Pygments==2.15.0 rich==13.3.2 +better-json-tools~=1.0