Skip to content

Enforce native Python str for blockData in MCStructure.setBlock()#10

Open
YousefOnWeb wants to merge 1 commit intoSloimayyy:mainfrom
YousefOnWeb:Enforce-native-Python-str-for-blockData-in-MCStructure.setBlock-to-ensure-correct-palette-generation
Open

Enforce native Python str for blockData in MCStructure.setBlock()#10
YousefOnWeb wants to merge 1 commit intoSloimayyy:mainfrom
YousefOnWeb:Enforce-native-Python-str-for-blockData-in-MCStructure.setBlock-to-ensure-correct-palette-generation

Conversation

@YousefOnWeb
Copy link

This commit addresses an issue where schem could be generated with an incomplete block palette (making it corrupt) if non-native Python string types (e.g., numpy.str_) were passed as blockData to MCStructure.setBlock().

The reason the block palette could be incomplete in this case is because MCStructure.getBlockPalette() method filters keys from _blockPalette using the check: type(key) == str.

…sure correct palette generation

This commit addresses an issue where schem could be generated with an incomplete block palette (making it corrupt) if non-native Python string types (e.g., ``numpy.str_``) were passed as ``blockData`` to ``MCStructure.setBlock()``.

The reason the block palette could be incomplete in this case is because ``MCStructure.getBlockPalette()`` method filters keys from ``_blockPalette`` using the check: ``type(key) == str``.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant