Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,14 @@ def _load_iter(self) -> Iterator[float]:
try:
self._blockstate_files[key] = json.load(fi)
except json.JSONDecodeError:
log.error(f"Failed to parse blockstate file {path}")
log.exception(f"Failed to parse blockstate file {path}")

for key, path in model_file_paths.items():
with open(path) as fi:
try:
self._model_files[key] = json.load(fi)
except json.JSONDecodeError:
log.error(f"Failed to parse model file file {path}")
log.exception(f"Failed to parse model file file {path}")

@property
def textures(self) -> tuple[str, ...]:
Expand Down Expand Up @@ -236,8 +236,8 @@ def _get_model(self, block: Block) -> BlockMesh:
blockstate["variants"][variant]
)
except Exception as e:
log.error(
f"Failed to load block model {blockstate['variants'][variant]}\n{e}"
log.exception(
f"Failed to load block model {blockstate['variants'][variant]}"
)
else:
properties_match = Block.properties_regex.finditer(
Expand All @@ -256,8 +256,8 @@ def _get_model(self, block: Block) -> BlockMesh:
blockstate["variants"][variant]
)
except Exception as e:
log.error(
f"Failed to load block model {blockstate['variants'][variant]}\n{e}"
log.exception(
f"Failed to load block model {blockstate['variants'][variant]}"
)

elif "multipart" in blockstate:
Expand Down Expand Up @@ -300,11 +300,11 @@ def _get_model(self, block: Block) -> BlockMesh:
)

except Exception as e:
log.error(
f"Failed to load block model {case['apply']}\n{e}"
log.exception(
f"Failed to load block model {case['apply']}"
)
except Exception as e:
log.error(f"Failed to parse block state for {block}\n{e}")
log.exception(f"Failed to parse block state for {block}")

return BlockMesh.merge(models)

Expand Down Expand Up @@ -411,6 +411,8 @@ def _load_block_model(self, model_path: str) -> BlockMesh:
texture_relative_path = java_model["textures"].get(
texture_relative_path[1:], None
)
if isinstance(texture_relative_path, dict):
texture_relative_path = texture_relative_path["sprite"]
texture_path_list = texture_relative_path.split(":", 1)
if len(texture_path_list) == 2:
namespace, texture_relative_path = texture_path_list
Expand Down
Loading