Skip to content

Commit 9cc815b

Browse files
committed
feat: add Modrinth integration and implement image upload functionality on fabric-1.21.11
1 parent 33bcd3f commit 9cc815b

18 files changed

Lines changed: 249 additions & 8 deletions

File tree

build.gradle.kts

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1+
import com.modrinth.minotaur.ModrinthExtension
2+
13
plugins {
24
java
35
`java-library`
4-
id("com.modrinth.minotaur") version "2.+"
6+
id("com.modrinth.minotaur") version "2.+" apply false
57
}
68

79
allprojects {
810
apply {
911
plugin("java")
1012
plugin("java-library")
11-
plugin("com.modrinth.minotaur")
1213
}
1314

1415
group = "net.azisaba.interchatmod"
15-
version = "0.7.0"
16+
version = "0.7.1-alpha.2"
1617

1718
repositories {
1819
// mavenLocal()
@@ -32,3 +33,26 @@ allprojects {
3233
}
3334
}
3435
}
36+
37+
subprojects {
38+
if (name == "common") return@subprojects
39+
40+
apply {
41+
plugin("com.modrinth.minotaur")
42+
}
43+
44+
extensions.configure<ModrinthExtension>("modrinth") {
45+
fun getVersionType(): String {
46+
return if (project.version.toString().contains("alpha")) {
47+
"alpha"
48+
} else if (project.version.toString().contains("beta")) {
49+
"beta"
50+
} else {
51+
"release"
52+
}
53+
}
54+
55+
projectId.set("interchat")
56+
versionType.set(getVersionType())
57+
}
58+
}

common/build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,9 @@ dependencies {
88
api("net.kyori:adventure-text-serializer-gson:$adventureVersion")
99
api("org.java-websocket:Java-WebSocket:1.5.4")
1010
}
11+
12+
plugins.withId("com.modrinth.minotaur") {
13+
tasks.named("modrinth") {
14+
enabled = false
15+
}
16+
}

common/src/main/resources/assets/interchatmod/lang/en_us.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,8 @@
2727
"generic.disconnected": "Disconnected from InterChat. Will try to reconnect in 5 seconds.",
2828
"generic.disconnected_check_api_key": "Disconnected from InterChat. Please check your API key and do /reconnectinterchat [apikey] to reconnect.",
2929
"generic.error_from_server": "Error was returned from the server: %s",
30-
"generic.error_in_connection": "Error in WebSocket connection: %s"
30+
"generic.error_in_connection": "Error in WebSocket connection: %s",
31+
"generic.upload": "Upload",
32+
"generic.upload.tooltip": "Upload screenshot to the guild",
33+
"generic.upload_image_failed": "Failed to upload image: %s"
3134
}

common/src/main/resources/assets/interchatmod/lang/ja_jp.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,8 @@
2727
"generic.disconnected": "ギルドチャットから切断されました。5秒後に再接続を試みます。",
2828
"generic.disconnected_check_api_key": "ギルドチャットから切断されました。APIキーを確認して、/reconnectinterchat [apikey]を実行してください。",
2929
"generic.error_from_server": "サーバーからエラーが返されました: %s",
30-
"generic.error_in_connection": "WebSocket接続でエラーが発生しました: %s"
30+
"generic.error_in_connection": "WebSocket接続でエラーが発生しました: %s",
31+
"generic.upload": "アップロード",
32+
"generic.upload.tooltip": "スクリーンショットをギルドにアップロードする",
33+
"generic.upload_image_failed": "画像のアップロードに失敗しました: %s"
3134
}

fabric-1.16/build.gradle.kts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,14 @@ java {
9595
// If you remove this line, sources will not be generated.
9696
withSourcesJar()
9797
}
98+
99+
modrinth {
100+
versionNumber.set("${project.version}+1.16.5-fabric")
101+
uploadFile.set(tasks.remapJar)
102+
file.set { tasks.remapJar.get().outputs.files.singleFile }
103+
gameVersions.addAll("1.16.5")
104+
loaders.add("fabric")
105+
dependencies {
106+
required.project("fabric-api", "modmenu")
107+
}
108+
}

fabric-1.17/build.gradle.kts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,14 @@ java {
9393
// If you remove this line, sources will not be generated.
9494
withSourcesJar()
9595
}
96+
97+
modrinth {
98+
versionNumber.set("${project.version}+1.17.1-fabric")
99+
uploadFile.set(tasks.remapJar)
100+
file.set { tasks.remapJar.get().outputs.files.singleFile }
101+
gameVersions.addAll("1.17.1")
102+
loaders.add("fabric")
103+
dependencies {
104+
required.project("fabric-api", "modmenu")
105+
}
106+
}

fabric-1.18/build.gradle.kts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,14 @@ java {
9393
// If you remove this line, sources will not be generated.
9494
withSourcesJar()
9595
}
96+
97+
modrinth {
98+
versionNumber.set("${project.version}+1.18.2-fabric")
99+
uploadFile.set(tasks.remapJar)
100+
file.set { tasks.remapJar.get().outputs.files.singleFile }
101+
gameVersions.addAll("1.18.2")
102+
loaders.add("fabric")
103+
dependencies {
104+
required.project("fabric-api", "modmenu")
105+
}
106+
}

fabric-1.19/build.gradle.kts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,15 @@ java {
9494
// If you remove this line, sources will not be generated.
9595
withSourcesJar()
9696
}
97+
98+
modrinth {
99+
versionNumber.set("${project.version}+1.19.4-fabric")
100+
uploadFile.set(tasks.remapJar)
101+
file.set { tasks.remapJar.get().outputs.files.singleFile }
102+
gameVersions.addAll("1.19.4")
103+
loaders.add("fabric")
104+
dependencies {
105+
required.project("fabric-api", "owo-lib")
106+
optional.project("modmenu")
107+
}
108+
}

fabric-1.20/build.gradle.kts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,15 @@ java {
9494
// If you remove this line, sources will not be generated.
9595
withSourcesJar()
9696
}
97+
98+
modrinth {
99+
versionNumber.set("${project.version}+1.20.2-fabric")
100+
uploadFile.set(tasks.remapJar)
101+
file.set { tasks.remapJar.get().outputs.files.singleFile }
102+
gameVersions.addAll("1.20.2")
103+
loaders.add("fabric")
104+
dependencies {
105+
required.project("fabric-api", "owo-lib")
106+
optional.project("modmenu")
107+
}
108+
}

fabric-1.21.11/build.gradle.kts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,15 @@ java {
9595
// If you remove this line, sources will not be generated.
9696
withSourcesJar()
9797
}
98+
99+
modrinth {
100+
versionNumber.set("${project.version}+1.21.11-fabric")
101+
uploadFile.set(tasks.remapJar)
102+
file.set { tasks.remapJar.get().outputs.files.singleFile }
103+
gameVersions.addAll("1.21.11")
104+
loaders.add("fabric")
105+
dependencies {
106+
required.project("fabric-api", "cloth-config")
107+
optional.project("modmenu")
108+
}
109+
}

0 commit comments

Comments
 (0)