From b5d8f25a836c1fabb41ab17465ab8efa852d765f Mon Sep 17 00:00:00 2001 From: trafficlunar Date: Fri, 28 Feb 2025 22:12:59 +0000 Subject: [PATCH] fix: add architectury api --- README.md | 2 +- common/build.gradle | 3 +++ fabric/build.gradle | 3 +++ fabric/src/main/resources/fabric.mod.json | 1 + gradle.properties | 1 + neoforge/build.gradle | 3 +++ neoforge/src/main/resources/META-INF/neoforge.mods.toml | 7 +++++++ 7 files changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3e2db6e..ca4302f 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ If you would like support for another mod, open an issue. - Where can I find the source code for older versions? > You can find them in the branches. - Dependencies? - > Versions 1.1 require Architectury API, however versions 1.2+ do not. + > Architectury API and Fabric API (if on Fabric) - For any other questions, create an issue or contact me at hello@trafficlunar.net ## Gallery diff --git a/common/build.gradle b/common/build.gradle index 4bfc245..af61a85 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -22,6 +22,9 @@ dependencies { // Do NOT use other classes from Fabric Loader. modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}" + // Architectury API + modImplementation "dev.architectury:architectury:$rootProject.architectury_api_version" + // Mod implementations modImplementation "maven.modrinth:sodium:mc1.21.4-0.6.3-fabric" // Sodium modImplementation "maven.modrinth:sodium-extra:mc1.21.4-0.6.1+fabric" // Sodium Extra diff --git a/fabric/build.gradle b/fabric/build.gradle index 33b06d8..18e6388 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -30,6 +30,9 @@ dependencies { // Fabric API. This is technically optional, but you probably want it anyway. modImplementation "net.fabricmc.fabric-api:fabric-api:$rootProject.fabric_api_version" + // Architectury API + modImplementation "dev.architectury:architectury-fabric:$rootProject.architectury_api_version" + common(project(path: ':common', configuration: 'namedElements')) { transitive false } shadowBundle project(path: ':common', configuration: 'transformProductionFabric') } diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index 533a24d..ad42d69 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -27,6 +27,7 @@ "fabricloader": ">=0.15.11", "minecraft": "~1.21", "java": ">=21", + "architectury": ">=15.0.3", "fabric-api": "*" } } diff --git a/gradle.properties b/gradle.properties index 59668ef..fde16b3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,6 +14,7 @@ enabled_platforms=fabric,neoforge minecraft_version=1.21.4 # Dependencies +architectury_api_version = 15.0.3 fabric_loader_version=0.16.9 fabric_api_version=0.111.0+1.21.4 neoforge_version=21.4.9-beta \ No newline at end of file diff --git a/neoforge/build.gradle b/neoforge/build.gradle index a6f520b..25d1554 100644 --- a/neoforge/build.gradle +++ b/neoforge/build.gradle @@ -34,6 +34,9 @@ repositories { dependencies { neoForge "net.neoforged:neoforge:$rootProject.neoforge_version" + // Architectury API + modImplementation "dev.architectury:architectury-neoforge:$rootProject.architectury_api_version" + common(project(path: ':common', configuration: 'namedElements')) { transitive false } shadowBundle project(path: ':common', configuration: 'transformProductionNeoForge') } diff --git a/neoforge/src/main/resources/META-INF/neoforge.mods.toml b/neoforge/src/main/resources/META-INF/neoforge.mods.toml index 0fa26fb..64ca7c9 100644 --- a/neoforge/src/main/resources/META-INF/neoforge.mods.toml +++ b/neoforge/src/main/resources/META-INF/neoforge.mods.toml @@ -27,5 +27,12 @@ versionRange = "[1.21,)" ordering = "NONE" side = "BOTH" +[[dependencies.optionsprofiles]] +modId = "architectury" +type = "required" +versionRange = "[15.0.3,)" +ordering = "AFTER" +side = "BOTH" + [[mixins]] config = "optionsprofiles.mixins.json"