Skip to content

Commit

Permalink
Add support for comments in settings file.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nusiq committed Dec 10, 2024
1 parent abf41c8 commit 97a5245
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 2 additions & 4 deletions nbt-to-mcstructure/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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", []):
Expand Down
1 change: 1 addition & 0 deletions nbt-to-mcstructure/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 97a5245

Please sign in to comment.