Skip to content
Open
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
8 changes: 8 additions & 0 deletions mcschematic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1259,8 +1259,16 @@ def setBlock(self, position: tuple[int, int, int], blockData: str):

:param position: The position to place the blockData at
:param blockData: The blockData to place
:raises TypeError: if blockData is not a native Python string.
"""

# validate blockData type
if not isinstance(blockData, str) or type(blockData) != str:
raise TypeError(
f"blockData must be a native Python string (str), but got type {type(blockData)}. "
f"Value: '{str(blockData)[:100]}{'...' if len(str(blockData)) > 100 else ''}'"
)

# We have a different treatment between block entities
# and normal blocks.
#if not self._isBlockDataBlockEntity(blockData):
Expand Down