### Project Setup and Loader Targeting - settings.gradle.kts Source: https://context7.com/meza/stonecraft-template/llms.txt Configures the Stonecraft and Stonecutter plugins, defines Minecraft versions and loaders, and sets the version for the VCS. Ensure Maven repositories for Fabric and NeoForge are included. ```kotlin // settings.gradle.kts pluginManagement { repositories { mavenCentral() gradlePluginPortal() maven("https://maven.kikugie.dev/releases") maven("https://maven.fabricmc.net/") maven("https://maven.neoforged.net/releases/") } } plugins { id("gg.meza.stonecraft") version "1.10.+" id("dev.kikugie.stonecutter") version "0.9.+" } stonecutter { centralScript = "build.gradle.kts" kotlinController = true shared { fun mc(version: String, vararg loaders: String) { for (it in loaders) version("$version-$it", version) } // Add more Minecraft versions here, e.g. mc("1.21.4", "fabric", "neoforge", "forge") mc("26.1", "fabric", "neoforge") vcsVersion = "26.1-fabric" // version stored in the root src/ tree } create(rootProject) } rootProject.name = "AwesomeBlocks" ``` -------------------------------- ### GitHub Actions Bootstrap Workflow (YAML) Source: https://context7.com/meza/stonecraft-template/llms.txt Initiates the Stonecraft template setup via GitHub UI, requiring specific inputs for mod configuration and build options. ```yaml # Trigger via GitHub UI: Actions → "🪄 Initialise Stonecraft template" → Run workflow # Required inputs: # mod_group: com.example.awesomeblocks # mod_name: AwesomeBlocks # mod_id: awesomeblocks # mod_slug: awesome-blocks # java_version: 21 # include_datagen: true # include_gametests: true ``` -------------------------------- ### Conventional Commit Examples Source: https://context7.com/meza/stonecraft-template/llms.txt Examples of Conventional Commit messages used for version control. The commit type dictates the semantic version bump: 'feat' for minor, 'fix' for patch, and 'BREAKING CHANGE' for major versions. ```bash # Patch release (0.1.0 → 0.1.1) git commit -m "fix: resolve crash when placing block in water" ``` ```bash # Minor release (0.1.1 → 0.2.0) git commit -m "feat: add glowing variant of awesome block" ``` -------------------------------- ### Non-Release Commit Examples Source: https://context7.com/meza/stonecraft-template/llms.txt These commit messages are for routine changes that do not trigger a version bump. Use prefixes like 'chore:', 'docs:', 'style:', 'refactor:', or 'test:' to categorize these commits. ```git git commit -m "chore: update gradle wrapper to 8.14" ``` ```git git commit -m "docs: add crafting recipe to README" ``` ```git git commit -m "test: add gametest for water interaction" ``` -------------------------------- ### Local Bootstrap Script Execution (Bash) Source: https://context7.com/meza/stonecraft-template/llms.txt Initializes the Stonecraft template locally by renaming packages, updating properties, patching workflows, and configuring the Discord notifier. ```bash # Run locally after cloning the template chmod +x scripts/bootstrap.sh scripts/bootstrap.sh \ --group com.example.awesomeblocks \ --name AwesomeBlocks \ --id awesomeblocks \ --slug awesome-blocks \ --java 21 \ --datagen true \ --gametests true \ --discord-user "AwesomeBlocks Bot" \ --discord-avatar "https://example.com/icon.png" # What the script does: # 1. Updates mod.id / mod.name / mod.group in gradle.properties # 2. Sets rootProject.name in settings.gradle.kts # 3. Moves src/main/java/com/example/* → src/main/java/com/example/awesomeblocks/ # 4. Renames yourmodid.accesswidener → awesomeblocks.accesswidener # 5. Patches .github/workflows/build.yml (java version, datagen, gametests) # 6. Updates Discord notifier in .releaserc.json with mod slug & bot details # 7. Renames ExampleMod.java → AwesomeBlocks.java and refactors class name # 8. Removes scripts/bootstrap.sh from git index (self-cleanup) ``` -------------------------------- ### Build Configuration and Publishing - build.gradle.kts Source: https://context7.com/meza/stonecraft-template/llms.txt Applies the Stonecraft plugin and customizes client launch options and per-platform publishing requirements. Conditional dependencies can be added based on the loader. ```kotlin // build.gradle.kts import gg.meza.stonecraft.mod plugins { id("gg.meza.stonecraft") } modSettings { clientOptions { fov = 90 guiScale = 3 narrator = false darkBackground = true musicVolume = 0.0 } } publishMods { modrinth { if (mod.isFabric) requires("fabric-api") // only add Fabric API dep on Fabric builds } curseforge { clientRequired = true serverRequired = false if (mod.isFabric) requires("fabric-api") } } ``` -------------------------------- ### Local CI Pipeline Equivalent Source: https://context7.com/meza/stonecraft-template/llms.txt This command simulates the full CI pipeline locally, running game tests and collecting artifacts. It's useful for testing the build process before committing. ```yaml # Local equivalent of the full CI pipeline: ./gradlew chiseledGameTest chiseledBuildAndCollect --stacktrace ``` -------------------------------- ### Execute Release Script Source: https://context7.com/meza/stonecraft-template/llms.txt Invokes the release script, which stamps the version into gradle.properties and runs the full build, test, and publish process. This script is typically called by semantic-release but can be run manually for dry runs. ```bash # Called automatically by semantic-release (via .releaserc.json prepareCmd) # Can also be invoked manually for a local release dry-run ./scripts/release.sh "1.2.3" ``` ```bash # Equivalent Gradle commands run internally: ./gradlew chiseledGameTest # run game tests across all versions ./gradlew chiseledBuildAndCollect # build all loader JARs ./gradlew chiseledPublishMods # publish to Modrinth & CurseForge ``` -------------------------------- ### Run Data Generation Script Source: https://context7.com/meza/stonecraft-template/llms.txt Executes the data generation script for all configured versions. Ensure the script has execute permissions before running. Generated resources are placed in version-specific directories. ```bash # Run data generation for all versions chmod +x scripts/datagen.sh ./scripts/datagen.sh ``` ```bash # If fabric and neoforge share generated resources, uncomment the copy lines: # cp -rfv "versions/26.1-fabric/src" "versions/26.1-neoforge/src" ``` -------------------------------- ### Dependency Versions per Minecraft Target - versions/dependencies/.properties Source: https://context7.com/meza/stonecraft-template/llms.txt Pins specific loader and API versions for each supported Minecraft version. Create a new file for each additional Minecraft version you want to support. ```properties # versions/dependencies/26.1.properties minecraft_version=26.1 loader_version=0.19.2 # Fabric API fabric_version=0.145.1+26.1 neoforge_version=26.1.0.19-beta ``` -------------------------------- ### Cross-Loader Mod Entry Point (Java) Source: https://context7.com/meza/stonecraft-template/llms.txt Uses Stonecutter comment-conditions for single-file compilation across Fabric, Forge, and NeoForge. The build system removes inactive code blocks. ```java // src/main/java/com/example/awesomeblocks/AwesomeBlocks.java package com.example.awesomeblocks; /*? if fabric { import net.fabricmc.api.ModInitializer; }*/ /*? if neoforge { /*import net.neoforged.bus.api.IEventBus; import net.neoforged.fml.ModContainer; import net.neoforged.fml.common.Mod; */ /*?}*/ /*? if forgeLike { /*@Mod("awesomeblocks") public class AwesomeBlocks { */ /*?}*/ /*? if fabric { public class AwesomeBlocks implements ModInitializer { */ /*?}*/ /*? if neoforge { /*public AwesomeBlocks(IEventBus modEventBus, ModContainer modContainer) { // register event listeners here }*/ /*?}*/ /*? if fabric { @Override public void onInitialize() { // mod initialization logic here } /*?}*/ } ``` -------------------------------- ### NeoForge Mod Descriptor (TOML) Source: https://context7.com/meza/stonecraft-template/llms.txt Declares mod metadata, dependencies, and loader information for NeoForge using template variables for dynamic configuration. ```toml # src/main/resources/META-INF/neoforge.mods.toml modLoader = "javafml" loaderVersion = "*" license = "MIT" [[mods]] modId = "${id}" version = "${version}" displayName = "${name}" description = '''${description}''' logoFile = "assets/${id}/icon.png" [[dependencies.${id}]] modId = "minecraft" mandatory = true versionRange = "[${minecraftVersion},)" ordering = "NONE" side = "CLIENT" ``` -------------------------------- ### Required GitHub Repository Variables Source: https://context7.com/meza/stonecraft-template/llms.txt These are variables that need to be configured in your GitHub repository's Actions settings. They provide project-specific identifiers. ```text # Variables (Settings → Secrets and variables → Actions → Variables) MODRINTH_ID – Modrinth project ID CURSEFORGE_ID – CurseForge project ID ``` -------------------------------- ### Fabric Mod Descriptor (JSON) Source: https://context7.com/meza/stonecraft-template/llms.txt Defines mod metadata, entrypoints, and dependencies for Fabric. Template variables are filled during the build process. ```json // src/main/resources/fabric.mod.json { "schemaVersion": 1, "id": "${id}", "version": "${version}", "name": "${name}", "description": "${description}", "authors": ["YourName"], "contact": { "homepage": "https://example.com", "sources": "https://github.com/example/awesomeblocks" }, "environment": "*", "entrypoints": { "main": ["com.example.awesomeblocks.AwesomeBlocks"] }, "depends": { "fabricloader": "*", "fabric-api": ">=/${fabricVersion}", "minecraft": ">=/${minecraftVersion}" } } ``` -------------------------------- ### Mod Identity Configuration - gradle.properties Source: https://context7.com/meza/stonecraft-template/llms.txt Defines the core properties for your mod, such as ID, name, version, group, and description. These values are interpolated into mod descriptor files. ```properties # gradle.properties org.gradle.jvmargs=-Xmx2G org.gradle.parallel=false mod.id=awesomeblocks mod.name=AwesomeBlocks mod.version=0.0-SNAPSHOT # replaced at release time by release.sh mod.group=com.example.awesomeblocks mod.description=Adds a bunch of awesome blocks to Minecraft! ``` -------------------------------- ### Semantic Release Configuration Source: https://context7.com/meza/stonecraft-template/llms.txt Configuration for semantic-release, defining branches, tag format, and plugins for versioning, changelog generation, GitHub releases, and Discord notifications. It uses Conventional Commit messages to determine release types. ```json // .releaserc.json (abbreviated — shows key plugin wiring) { "branches": [ "main", { "name": "beta", "prerelease": true } ], "tagFormat": "v${version}", "plugins": [ ["@semantic-release/commit-analyzer", { "preset": "conventionalcommits" }], ["@semantic-release/release-notes-generator", { "preset": "conventionalcommits" }], "semantic-release-export-data", ["@semantic-release/changelog", { "changelogFile": "CHANGELOG.md" }], ["@semantic-release/github", { "assets": [{ "path": "build/libs/*.jar" }] }], ["@semantic-release/exec", { "prepareCmd": "./scripts/release.sh \"${nextRelease.version}\"" }], ["semantic-release-discord-notifier", { "embedJson": { "username": "AwesomeBlocks", "avatar_url": "https://example.com/icon.png", "content": "# 🚀 ${nextRelease.version} just dropped", "embeds": [{ "title": "What changed?", "description": "${nextRelease.notes}", "color": 7377919 }], "components": [{ "type": 1, "components": [ { "type": 2, "style": 5, "label": "Modrinth", "url": "https://modrinth.com/mod/awesome-blocks" }, { "type": 2, "style": 5, "label": "CurseForge", "url": "https://www.curseforge.com/minecraft/mc-mods/awesome-blocks" } ] }] } }] ] } ``` -------------------------------- ### Access Widener Configuration Source: https://context7.com/meza/stonecraft-template/llms.txt Allows modification of Minecraft's internal access levels for private or package-private members. The filename must match the mod ID. ```properties # src/main/resources/awesomeblocks.accesswidener accessWidener v2 official # Example: make a package-private method accessible accessible method net/minecraft/world/World somePrivateMethod ()V ``` -------------------------------- ### Major Release Commit Source: https://context7.com/meza/stonecraft-template/llms.txt Use this commit message format for major releases that introduce breaking changes. The 'feat!:' prefix signals a feature with breaking changes, and the 'BREAKING CHANGE:' footer details the impact. ```git git commit -m "feat!: redesign block registry API BREAKING CHANGE: BlockRegistry.register() now requires a ResourceLocation instead of a String" ``` -------------------------------- ### Required GitHub Repository Secrets Source: https://context7.com/meza/stonecraft-template/llms.txt These are secrets that need to be configured in your GitHub repository's Actions settings. They are used for authentication with various services. ```text # Secrets (Settings → Secrets and variables → Actions → Secrets) GH_TOKEN – GitHub Personal Access Token (repo scope) MODRINTH_TOKEN – Modrinth API token CURSEFORGE_TOKEN – CurseForge API token CURSEFORGE_SLUG – CurseForge mod slug string DISCORD_WEBHOOK – Discord bot webhook URL ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.