Skip to content

Improve Schematica compatibility with GTNH blocks - #31

Draft
Worive wants to merge 64 commits into
masterfrom
fix/gtnh-mod-compatibility
Draft

Worive wants to merge 64 commits into
masterfrom
fix/gtnh-mod-compatibility

Conversation

@Worive

@Worive Worive commented Nov 20, 2026 •

Copy link
Copy Markdown

Summary

Schematica currently mishandles a number of GTNH blocks: block IDs above 4095 get truncated when saving/loading, and several mods' blocks print wrong, preview wrong, or are miscounted in the materials list. One concrete example: e.g. "a schematic containing X loads as Y, and the printer places Z instead".

This PR fixes those for the mods below.

What changed

Schematic format. .schematic and .schemplus now keep block IDs up to 65,535 and 16-bit metadata (EndlessIDs). Old schematics still load in the matching format mode. Older Schematica versions can truncate extended metadata. Packed AddBlocks readers can represent block IDs up to 4095. Use this version for a faithful round trip of files with extended data.

Per-mod support (printing, preview, material list, rotate/mirror where relevant):

  • GregTech ores: legacy tile entities converted via Postea; player-placed ores match saved natural ores of the same variant.
  • ForgeMultipart / Microblocks: mixed tiles load; microblocks print with correct material, type and thickness.
  • ArchitectureCraft: the printer places shapes with their saved base material and orientation. The preview also checks cladding and connections, which are applied manually. Rotate and mirror support is included.
  • Carpenter's Blocks: covers resolved by registry name; shapes, garage doors and hammer settings supported.
  • Cooking for Blockheads: dye counting for colored blocks and fridges.
  • Slabs (vanilla, modded, EnderIO painted): correct half, doubles, no merging a slab that is acting as support.

Printer behavior (affects all blocks, not just modded). Retry timers advance at zero placement delay; held item and sneak state are synced for client interactions; blocks can be placed without a neighbor when "adjacent only" is off; facing-only damage is ignored when matching materials.

Build. GTNH Gradle toolchain updated (Java 25 build daemon); optional mod
detection is cached.

Checklist

  • I have tested this PR in DevEnv
  • I have tested this PR in Fullpack
  • This PR is in compliance with the GTNH AI Policy
  • This PR requires another PR in order to merge

@Worive
Worive marked this pull request as draft November 20, 2026 20:59
@Worive Worive added the Bug Fix Fixes a bug. Please link it in the PR if an issue exists for it. label Nov 20, 2026
@Worive
Worive requested a review from boubou19 November 20, 2026 20:59
Append the optional high bytes after the legacy fields to preserve
older decoders and avoid Forge's signed-short NBT length limit.
Rewriting a compound can omit high metadata or change the ID
encoding. Clear the previous optional arrays before writing.
Keep the microblock render-bounds update while a schematic tile is
detached. Other multipart implementations may need an attached world.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Fix Fixes a bug. Please link it in the PR if an issue exists for it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant