Skip to content

Render Bedrock .mcstructure files in the 3D structure view#91

Open
Fabrimat wants to merge 1 commit into
misode:masterfrom
Fabrimat:bedrock-mcstructure
Open

Render Bedrock .mcstructure files in the 3D structure view#91
Fabrimat wants to merge 1 commit into
misode:masterfrom
Fabrimat:bedrock-mcstructure

Conversation

@Fabrimat

@Fabrimat Fabrimat commented Jul 6, 2026

Copy link
Copy Markdown

Bedrock .mcstructure files were already being parsed correctly (little endian, gzip/zlib detection is handled by deepslate), but the editor treated them as generic NBT, so they only showed up in the tree view. This adds proper support for viewing them in 3D.

Changes:

  • NbtDocument.isStructureData() now recogn with a size int list and a structure compound), so the structure panel is offered for these files.
  • New mcstructureToStructure() in Schematformat to a deepslate Structure: palette from structure.palette.default.block_palette(byte states become "true"/"false", everything else is passed through), blocks from layer 0 ofblock_indicesusing the Bedrock index order (x outermost, z innermost), -1 entries skipped, block entities attached fromblock_position_data`.
  • dataVersion returns undefined for Bedrock files so the latest release assets are used instead of the 1.18.2 fallback.
  • The empty-root endianness retry in readFile() now works in both directions instead of only when starting from big end
  • The side panel is read-only for Bedrock files, since the existing edit paths assume the Java structure layout and would

Known limitations, matching what the other schematic formats do: no mapping of Bedrock block states to Java ones (blocks with unrecognized states render with their default variant), and the waterlogging layer and entities are ignored.

Tested with structures exported from Bedrocked, plus a Java structure renamed to .mcstructure to check the endianness fallback.

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