Skip to content

Commit 35d7b39

Browse files
feat: switch from minotaur to mod-publish
1 parent 908e21d commit 35d7b39

File tree

5 files changed

+105
-74
lines changed

5 files changed

+105
-74
lines changed

build.gradle.kts

Lines changed: 53 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
plugins {
22
java
3+
34
alias(libs.plugins.fabric.loom)
4-
alias(libs.plugins.minotaur)
5+
alias(libs.plugins.modpublish)
56
}
67

7-
val modId: String by project
8-
val modVersion: String by project
8+
val modVersion = "1.0.0"
9+
val modId = "template"
10+
val modName = "Template"
911

10-
version = "$modVersion+${libs.versions.minecraft.get()}"
12+
val modrinthProject = "template"
13+
val githubRepository = "SpiritGameStudios/Template"
14+
15+
group = "dev.spiritstudios"
1116
base.archivesName = modId
1217

13-
loom {
14-
splitEnvironmentSourceSets()
15-
}
18+
version = "$modVersion+${libs.versions.minecraft.get()}"
1619

1720
repositories {
18-
mavenCentral()
19-
2021
maven {
2122
name = "Spirit Studios Releases"
2223
url = uri("https://maven.spiritstudios.dev/releases/")
@@ -26,19 +27,42 @@ repositories {
2627
includeGroupAndSubgroups("dev.spiritstudios")
2728
}
2829
}
30+
31+
maven {
32+
name = "ParchmentMC"
33+
url = uri("https://maven.parchmentmc.org")
34+
35+
content {
36+
@Suppress("UnstableApiUsage")
37+
includeGroupAndSubgroups("org.parchmentmc")
38+
}
39+
}
40+
41+
mavenCentral()
42+
}
43+
44+
loom {
45+
splitEnvironmentSourceSets()
2946
}
3047

3148
dependencies {
3249
minecraft(libs.minecraft)
33-
mappings(variantOf(libs.yarn) { classifier("v2") })
34-
modImplementation(libs.fabric.loader)
50+
mappings(
51+
@Suppress("UnstableApiUsage")
52+
loom.layered {
53+
officialMojangMappings()
54+
parchment(libs.parchment)
55+
}
56+
)
3557

58+
modImplementation(libs.fabric.loader)
3659
modImplementation(libs.fabric.api)
3760
}
3861

3962
tasks.processResources {
4063
val map = mapOf(
41-
"version" to modVersion
64+
"version" to modVersion,
65+
"loader_version" to libs.versions.fabric.loader.get()
4266
)
4367

4468
inputs.properties(map)
@@ -59,18 +83,24 @@ tasks.withType<JavaCompile> {
5983
}
6084

6185
tasks.jar {
62-
from("LICENSE") { rename { "${it}_${base.archivesName.get()}" } }
86+
from("LICENSE") { rename { "${it}_$modId" } }
6387
}
6488

65-
modrinth {
66-
token.set(System.getenv("MODRINTH_TOKEN"))
67-
projectId.set("template")
68-
versionNumber.set("$modVersion+${libs.versions.minecraft.get()}")
69-
uploadFile.set(tasks.remapJar)
70-
gameVersions.addAll(libs.versions.minecraft.get())
71-
loaders.addAll("fabric", "quilt")
72-
syncBodyFrom.set(rootProject.file("README.md").readText())
73-
dependencies {
74-
required.version("fabric-api", libs.versions.fabric.api.get())
89+
publishMods {
90+
file = tasks.remapJar.get().archiveFile
91+
modLoaders.add("fabric")
92+
93+
version = modVersion
94+
type = STABLE
95+
displayName = "$modName $modVersion for Minecraft ${libs.versions.minecraft.get()}"
96+
97+
modrinth {
98+
accessToken = providers.gradleProperty("secrets.modrinth_token")
99+
projectId = modrinthProject
100+
minecraftVersions.add(libs.versions.minecraft.get())
101+
102+
projectDescription = providers.fileContents(layout.projectDirectory.file("README.md")).asText
103+
104+
requires("fabric-api")
75105
}
76106
}

gradle.properties

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
org.gradle.jvmargs=-Xmx1G
22
org.gradle.parallel=true
33

4-
# Make sure to set "Shorten command line" in InteliJ to "none". "argsfile" will break configuration cache
5-
org.gradle.configuration-cache=true
6-
7-
group = dev.spiritstudios
8-
modVersion = 1.0.0
9-
modId = template
4+
# IntelliJ IDEA is not yet fully compatible with configuration cache, see: https://github.com/FabricMC/fabric-loom/issues/1349
5+
# If you really want to use this, it may work on some tasks if you set "Shorten command line" in your InteliJ run configuration to "none".
6+
org.gradle.configuration-cache=false

gradle/libs.versions.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
[versions]
2-
fabric_loom = "1.11-SNAPSHOT"
3-
minotaur = "2.+"
2+
fabric_loom = "1.13-SNAPSHOT"
3+
modpublish = "1.1.0"
44

55
minecraft = "1.21.10"
6-
yarn = "1.21.10+build.2"
6+
parchment = "2025.10.12"
77

8-
fabric_loader = "0.17.3"
9-
fabric_api = "0.135.0+1.21.10"
8+
fabric_loader = "0.18.1"
9+
fabric_api = "0.138.3+1.21.10"
1010

1111
[plugins]
1212
fabric_loom = { id = "fabric-loom", version.ref = "fabric_loom" }
13-
minotaur = { id = "com.modrinth.minotaur", version.ref = "minotaur" }
13+
modpublish = { id = "me.modmuss50.mod-publish-plugin", version.ref = "modpublish" }
1414

1515
[libraries]
1616
minecraft = { group = "mojang", name = "minecraft", version.ref = "minecraft" }
17-
yarn = { group = "net.fabricmc", name = "yarn", version.ref = "yarn" }
17+
parchment = { group = "org.parchmentmc.data", name = "parchment-1.21.10", version.ref = "parchment" }
1818

1919
fabric_loader = { group = "net.fabricmc", name = "fabric-loader", version.ref = "fabric_loader" }
2020
fabric_api = { group = "net.fabricmc.fabric-api", name = "fabric-api", version.ref = "fabric_api" }

settings.gradle.kts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
pluginManagement {
2-
repositories {
3-
maven("https://maven.fabricmc.net/")
4-
gradlePluginPortal()
5-
}
2+
repositories {
3+
maven {
4+
name = "Fabric"
5+
url = uri("https://maven.fabricmc.net/")
6+
}
7+
8+
gradlePluginPortal()
9+
}
610
}
711

812
rootProject.name = "template"

src/main/resources/fabric.mod.json

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
{
2-
"schemaVersion": 1,
3-
"id": "template",
4-
"version": "${version}",
5-
"name": "Template",
6-
"description": "",
7-
"authors": [],
8-
"contact": {
9-
"repo": "https://github.com/SpiritGameStudios/Template",
10-
"issues": "https://github.com/SpiritGameStudios/Template/issues"
11-
},
12-
"license": "MPL-2.0",
13-
"icon": "assets/template/icon.png",
14-
"environment": "*",
15-
"entrypoints": {
16-
"client": [
17-
"dev.spiritstudios.template.TemplateClient"
18-
],
19-
"main": [
20-
"dev.spiritstudios.template.Template"
21-
]
22-
},
23-
"mixins": [
24-
"template.mixins.json",
25-
{
26-
"config": "template.client.mixins.json",
27-
"environment": "client"
28-
}
29-
],
30-
"depends": {
31-
"fabricloader": ">=0.17.3",
32-
"minecraft": "~1.21.10-",
33-
"fabric-api": "*",
34-
"java": ">=21"
35-
},
2+
"schemaVersion": 1,
3+
"id": "template",
4+
"version": "${version}",
5+
"name": "Template",
6+
"description": "",
7+
"authors": [],
8+
"contact": {
9+
"repo": "https://github.com/SpiritGameStudios/Template",
10+
"issues": "https://github.com/SpiritGameStudios/Template/issues"
11+
},
12+
"license": "MPL-2.0",
13+
"icon": "assets/template/icon.png",
14+
"environment": "*",
15+
"entrypoints": {
16+
"client": [
17+
"dev.spiritstudios.template.TemplateClient"
18+
],
19+
"main": [
20+
"dev.spiritstudios.template.Template"
21+
]
22+
},
23+
"mixins": [
24+
"template.mixins.json",
25+
{
26+
"config": "template.client.mixins.json",
27+
"environment": "client"
28+
}
29+
],
30+
"depends": {
31+
"fabricloader": ">=${loader_version}",
32+
"minecraft": "~1.21.10",
33+
"fabric-api": "*",
34+
"java": ">=21"
35+
},
3636
"custom": {
3737
"modmenu": {
3838
"links": {

0 commit comments

Comments
 (0)