Skip to content

Build the mod for fabric 1.21.1 from the shared sources - #59

Merged
macmv merged 25 commits into
mainfrom
worktree-stonecutter-1-21
Oct 30, 2026
Merged

macmv merged 25 commits into
mainfrom
worktree-stonecutter-1-21

Conversation

@macmv

@macmv macmv commented Oct 22, 2026

Copy link
Copy Markdown
Owner

What

Gets the mod building and loading on fabric 1.21.1, from the same common/ sources as 1.12.

  • mod-fabric is a stonecutter project with one version (1.21.1) for now. The generated sources are in their 1.12 state, so there is no active version.
  • v12-to-fabric translates common/ into yarn sources before stonecutter runs. It renames classes and imports, drops methods that only exist in 1.12 (leaving a // v12-to-fabric: dropped note), and adds the modern arguments and constructors.
  • Handwritten fabric code is in mod-fabric/src/main/java (allow-listed in its .gitignore): RGen, BlockSettings, compat/, the four items, and the data generator.
  • Assets in common/ are now in the modern layout (textures/block, textures/item, blockstates with full model paths). mod-v12/assets.gradle converts them back when building the 1.12 mod. Fabric uses them as they are.
  • Item models and the language file come from the fabric data generator (runDatagen), checked in under mod-fabric/src/main/generated.
  • mod-v12 is its own gradle build (ForgeGradle can't use Gradle 9). The root build is the fabric mod and needs Java 25 or newer.

Not done

  • No world type or terrain generation on fabric. The rust library and the 1.12 generator classes are only v12.
  • A lot of block behavior is dropped on fabric: leaf decay, cactus growth and damage, sapling growth, the second half of tall plants, and others. grep -r "v12-to-fabric: dropped" mod-fabric/src/main/java lists them.
  • One creative tab on fabric instead of two. The debug stick and moss compass are stubs.
  • 1.21.5 was removed from stonecutter. The //? if >=1.21.2 code is still there for when it comes back.

For people working on 1.12

  • Build the 1.12 mod from inside mod-v12/ (own wrapper). The root ./gradlew is the fabric build now.
  • Write new assets in the modern layout.
  • New common/ files are transformed for fabric. Add // # only v12 # to the top of a file that fabric can't use. Methods named like a 1.12-only method (see drop_methods in v12-to-fabric/src/main.rs) are dropped on fabric.
  • LeavesBlock, Sapling, RBlocks and RItems have small signature changes, see the diff.

Testing

  • ./gradlew :mod-fabric:1.21.1:build passes, and a dedicated 1.21.1 server started with the mod and registered everything.
  • The asset conversion for 1.12 was run in an isolated project and matched the original 1.12 assets exactly.
  • Not tested: a mod-v12 build after these changes, and the mod in a client.
  • Still stale: docs/block_guide.md and the build commands in docs/advanced_setup.md still describe the old layout.

@macmv
macmv force-pushed the worktree-stonecutter-1-21 branch from 9302e40 to baa882f Compare October 22, 2026 18:52
macmv added 25 commits October 29, 2026 17:25
ForgeGradle 6 refuses to run on Gradle 9, so mod-v12 gets its own wrapper
pinned to Gradle 8. This lets the root build update independently.
The root build now runs on Gradle 9 with the latest Stonecutter and Loom,
since mod-v12 is a separate build. The v12-to-fabric transformer runs once in
the stonecutter controller and writes src/generated/java, which stonecutter
then processes for each version.

Needs Java 25+ to run gradle.
Stonecutter only processes src/main/java, and leaves the active version
alone. So the transformer now writes into src/main/java (ignored by git, with a
manifest to clean up), and 1.12.2 is a placeholder active version so that every
real version gets processed.
A stonecutter flag (vanilla_moss, from 1.17) picks between vanilla's moss and
our own MossBlock/MossCarpet. Vanilla blocks are recorded as aliases of the
rgen: names, and the rust block lookup goes through RBlocks.byName, so the
terrain generator can keep placing rgen:mossy_block everywhere.
…w blockstate paths

GraveDirtBlock has a handwritten fabric version, and the transformer drops the
BlockDirt import. Main's burned tree and grave dirt blockstates now name their
models with the full block/ path. The fabric build now puts the generated lang
and item models in the processed resources, since adding them to the run
classpath had no effect.
@macmv
macmv force-pushed the worktree-stonecutter-1-21 branch from baa882f to 613038b Compare October 30, 2026 00:39
@macmv
macmv merged commit 1b2ec48 into main Oct 30, 2026
1 of 2 checks passed
@macmv
macmv deleted the worktree-stonecutter-1-21 branch October 30, 2026 00:44
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