Skip to main content

What is Stonecraft?

Stonecraft is a configuration Gradle plugin designed to eliminate the boilerplate involved in setting up a multi-loader, multi-version Minecraft modding workspace. It leverages Stonecutter and Architectury to provide comprehensive multi-loader and multi-version support.

  • Multi-loader (Architectury): Supports Fabric, Forge, and NeoForge, enabling mod development for each loader within the same workspace.
  • Multi-version (Stonecutter): Supports multiple Minecraft versions, allowing mod development across different versions in a unified workspace.
  • Single codebase: Develop mods for various loaders and versions within a single codebase, eliminating the need to maintain multiple branches or separate workspaces.
  • Consistent release process: Seamlessly release mods to Modrinth and CurseForge with accurate versioning and metadata for all loaders and Minecraft versions.

It sets sensible defaults for modloader dependencies, data generation, GameTest framework and the Mod Publish plugin.

Stonecraft reduces approximately 500 lines of repetitive build.gradle.kts code to a single line using a tested and versioned plugin.

info

This project was initially created to support my projects and is currently a work in progress.
However, I aim to make it valuable for others as well, so feedback and contributions are highly encouraged.

As this is my first attempt at developing a Gradle plugin and working with Kotlin, there’s certainly room for improvement. If you have suggestions, feature requests, bug reports, or enhancements, please open an issue or a pull request on the GitHub repository.

warning

Stonecraft relies on your understanding of Stonecutter.
Please familiarize yourself with Stonecutter before using Stonecraft.

What's Included?

Stonecutter

Stonecraft configures Stonecutter to adapt your code based on the active Minecraft version and modloader. This eliminates the need to manually manage separate configurations for each version and loader.

Instead of having to maintain separate git branches for each Minecraft version or modloader, you can have a single codebase that adapts to the active environment.

This is achieved by using special comments in your code that are replaced by Stonecutter at compile time.

Don't be frightened by how this looks, Stonecutter will manage this for you.

/*? if fabric {*/
import net.fabricmc.api.ModInitializer;
/*?}*/

/*? if forge {*/
/*import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
*/
/*?}*/

/*? if neoforge {*/
/*import net.neoforged.fml.ModContainer;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.fml.common.Mod;
*/
/*?}*/

/*? if forgeLike {*/
/*@Mod("examplemod")
public class ExampleMod {*/
/*?}*/

/*? if fabric {*/
public class ExampleMod implements ModInitializer {
/*? }*/

/*? if forge {*/
/*public ExampleMod(final FMLJavaModLoadingContext context) {}*/
/*?}*/

/*? if neoforge {*/
/*public ExampleMod(IEventBus modEventBus, ModContainer modContainer) {}*/
/*?}*/

/*? if fabric {*/
@Override
public void onInitialize() {}
/*?}*/
}

note

The above example only uses loaders for conditions but you can use Minecraft versions as well.

Please refer to the Stonecutter documentation for more information, you will need it! Alternatively you can check out the Server Redstone Block mod for inspiration.

Architectury

Architectury is a fork of fabric-loom which coordinates the setup of a multi-loader project. Stonecraft configures Architectury to support Fabric, Forge and NeoForge with more loaders to come.

Yarn Mappings

Stonecraft uses the Yarn mappings currently but Mojmap support is coming soon.

Mod-Publish-Plugin

Stonecraft includes the Mod-Publish-Plugin which allows you to easily publish your mods to Modrinth and Curseforge. It's all configured in a way that you can publish your mod to all loaders and versions with a single command.

Test client configuration

Stonecraft includes a way for you to set your minecraft client configuration for testing. You can now avoid having your eyes and ears blown out by the default Minecraft settings.