Installation
Adding Matthiesen Lib to Your Project
Section titled “Adding Matthiesen Lib to Your Project”Matthiesen Lib is available through the Matthiesen Dev Maven repository. Follow the instructions below to add it to your Gradle project.
Prerequisites
Section titled “Prerequisites”- Minecraft 1.21.1
- Java 21 or higher
- Fabric Loader 0.17.2+ (for Fabric)
- NeoForge 21.1.182+ (for NeoForge)
Gradle Configuration
Section titled “Gradle Configuration”Step 1: Add the Repository
Section titled “Step 1: Add the Repository”Add the Matthiesen Dev Maven repository to your build.gradle or build.gradle.kts:
repositories { maven("https://maven.matthiesen.dev/releases") { name = "devMatthiesenMaven-releases" content { includeGroup("dev.matthiesen") } } // For Snapshot versions, also include the snapshots repository maven("https://maven.matthiesen.dev/snapshots") { name = "devMatthiesenMaven-snapshots" content { includeGroup("dev.matthiesen") } }}Step 2: Add Version to gradle.properties
Section titled “Step 2: Add Version to gradle.properties”Add the Matthiesen Lib version to your gradle.properties file:
matthiesen_lib_version=1.1.0| Current Release Versions |
|---|
| |
| |
| |
| Current Snapshot Versions |
|---|
| |
| |
| |
Step 3: Add Dependencies
Section titled “Step 3: Add Dependencies”The dependency you need depends on your project structure:
For Common/Shared Code
Section titled “For Common/Shared Code”If you’re writing multi-loader code in a common module:
dependencies { modImplementation("dev.matthiesen:matthiesen-lib-common:${property("matthiesen_lib_version")}") { isTransitive = false }}For Fabric-Specific Code
Section titled “For Fabric-Specific Code”In your Fabric module:
dependencies { modImplementation("dev.matthiesen:matthiesen-lib-fabric:${property("matthiesen_lib_version")}")}For NeoForge-Specific Code
Section titled “For NeoForge-Specific Code”In your NeoForge module:
dependencies { modImplementation("dev.matthiesen:matthiesen-lib-neoforge:${property("matthiesen_lib_version")}")}Complete Multi-Loader Example
Section titled “Complete Multi-Loader Example”For a typical Architectury-style multi-loader setup:
// In common/build.gradle.ktsdependencies { modImplementation("dev.matthiesen:matthiesen-lib-common:${property("matthiesen_lib_version")}") { isTransitive = false }}
// In fabric/build.gradle.ktsdependencies { modImplementation("dev.matthiesen:matthiesen-lib-fabric:${property("matthiesen_lib_version")}") { isTransitive = false }}
// In neoforge/build.gradle.ktsdependencies { modImplementation("dev.matthiesen:matthiesen-lib-neoforge:${property("matthiesen_lib_version")}") { isTransitive = false }}Declaring as a Dependency
Section titled “Declaring as a Dependency”Make sure to declare Matthiesen Lib as a dependency in your mod metadata files so users know they need it.
For Fabric (fabric.mod.json)
Section titled “For Fabric (fabric.mod.json)”{ "depends": { "matthiesen_lib": ">=1.1.0" }}For NeoForge (neoforge.mods.toml)
Section titled “For NeoForge (neoforge.mods.toml)”[[dependencies.yourmodid]]modId = "matthiesen_lib"type = "required"versionRange = "[1.1.0,)"ordering = "AFTER"side = "BOTH"Verification
Section titled “Verification”After adding the dependency, sync your Gradle project. You should now be able to import Matthiesen Lib classes:
import dev.matthiesen.common.matthiesen_lib.MatthiesenLib;import dev.matthiesen.common.matthiesen_lib.MatthiesenLib.RegistryBuilder;Troubleshooting
Section titled “Troubleshooting”Dependency Not Found
Section titled “Dependency Not Found”If Gradle can’t find the dependency:
- Verify the repository URL is correct
- Check that you’ve included the correct group (
dev.matthiesen) - Ensure the version exists on Maven by visiting maven.matthiesen.dev
- Try invalidating caches and restarting your IDE
Version Conflicts
Section titled “Version Conflicts”If you encounter version conflicts:
- Ensure all modules use the same version of Matthiesen Lib
- Check that your Minecraft version is compatible (1.21.1)
- Verify your loader versions meet the minimum requirements
Next Steps
Section titled “Next Steps”Now that you have Matthiesen Lib installed, learn how to use it: