Skip to content

Commit

Permalink
Support MInecraft 1.20.2
Browse files Browse the repository at this point in the history
Signed-off-by: Hendrix-Shen <[email protected]>
  • Loading branch information
Hendrix-Shen committed Sep 23, 2023
1 parent e06db49 commit 61c3583
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 32 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ jobs:
1.19.3
1.19.4
1.20.1
1.20.2
version-resolver: exact
version-resolver: any

retry-attempts: 3
retry-delay: 10000
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -441,10 +441,11 @@ ItemScroller 存储的配方编号,只支持 2x2 配方
- Minecraft 1.16.5
- Minecraft 1.17.1
- Minecraft 1.18.2
- Minecraft 1.19.2
- Minecraft 1.19.3
- Minecraft 1.19.2 (即将终止支持)
- Minecraft 1.19.3 (即将终止支持)
- Minecraft 1.19.4
- Minecraft 1.20.1
- Minecraft 1.20.1 (即将终止支持)
- Minecraft 1.20.2

### 混淆映射表

Expand Down
7 changes: 4 additions & 3 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -441,10 +441,11 @@ And use `preprocess` to be compatible with all versions.
- Minecraft 1.16.5
- Minecraft 1.17.1
- Minecraft 1.18.2
- Minecraft 1.19.2
- Minecraft 1.19.3
- Minecraft 1.19.2 (Ending support soon)
- Minecraft 1.19.3 (Ending support soon)
- Minecraft 1.19.4
- Minecraft 1.20.1
- Minecraft 1.20.1 (Ending support soon)
- Minecraft 1.20.2

### Mappings

Expand Down
32 changes: 22 additions & 10 deletions fabricWrapper/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import groovy.json.JsonBuilder
import groovy.json.JsonSlurper

plugins {
id("java-library")
Expand Down Expand Up @@ -49,32 +50,43 @@ jar {
processResources {
// disable cache
outputs.upToDateWhen { false }
ArrayList<?> mc_condition = []
ArrayList<?> jars = []

fabric_subprojects.each({
mc_condition.add("${it.minecraft_dependency}")
jars.add(["file": "META-INF/jars/${project.mod_archives_base_name}-${it.minecraft_version}-${project.version}.jar"])
})

from("${rootDir}/icon.png") {
into("assets/${project.mod_id}")
}

filesMatching("fabric.mod.json") {
expand([
"minecraft_dependency": new JsonBuilder(mc_condition),
"magiclib_dependency" : project.magiclib_dependency,
"mod_description" : project.mod_description,
"mod_homepage" : project.mod_homepage,
"mod_id" : project.mod_id,
"mod_license" : project.mod_license,
"mod_name" : project.mod_name,
"mod_version" : project.version,
"mod_sources" : project.mod_sources,
"sub_jars" : new JsonBuilder(jars).toPrettyString(),
"mod_sources" : project.mod_sources
])
}

doLast {
ArrayList<?> mc_condition = []
ArrayList<?> jars = []

fabric_subprojects.each({
mc_condition.add("${it.minecraft_dependency}")
jars.add(["file": "META-INF/jars/${project.mod_archives_base_name}-${it.minecraft_version}-${project.version}.jar"])
})

File file = file("build/resources/main/fabric.mod.json")
JsonSlurper slurper = new JsonSlurper()
JsonBuilder builder = new JsonBuilder(slurper.parse(file))
builder.content.depends.minecraft = mc_condition
builder.content.jars = jars
BufferedWriter writer = file.newWriter()
writer.append(builder.toPrettyString())
writer.flush()
writer.close()
}
}

java {
Expand Down
4 changes: 1 addition & 3 deletions fabricWrapper/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@
},
"depends": {
"magiclib": ">=${magiclib_dependency}",
"minecraft": ${minecraft_dependency},
"malilib": "*"
},
"custom": {
"modmenu:clientsideOnly": true
},
"jars": ${sub_jars}
}
}
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ mod_version=3.2
mod_license=LGPL-3.0

# Required Libraries
# MagicLib - 0.7.384
magiclib_dependency=0.7.384+e9e3c4a-beta
magiclib_version=0.7.384+e9e3c4a-beta
# MagicLib - 0.7.387
magiclib_dependency=0.7.387
magiclib_version=0.7.387

# Annotation processor
lombok_version=1.18.28
lombok_version=1.18.30
2 changes: 1 addition & 1 deletion versions/1.19.2/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Development Environment
minecraft_version=1.19.2
minecraft_dependency=>1.18.2 <=1.19.2
minecraft_dependency=1.19.2
# Compatible Libraries
minihud_version=3923228
tweakeroo_version=3923075
Expand Down
2 changes: 1 addition & 1 deletion versions/1.20.1/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Development Environment
minecraft_version=1.20.1
minecraft_dependency=>1.20 <=1.20.1
minecraft_dependency=1.20.1

# Compatible Libraries
itemscroller_version=4593079
Expand Down
12 changes: 6 additions & 6 deletions versions/1.20.2/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Development Environment
minecraft_version=1.20.2-pre2
minecraft_dependency=1.20.2-beta.2
minecraft_version=1.20.2
minecraft_dependency=1.20.2

# Compatible Libraries
itemscroller_version=1.20.2-pre2.1
litematica_version=1.20.2-pre2.1
minihud_version=1.20.2-pre2.1
tweakeroo_version=1.20.2-pre2.1
itemscroller_version=0.16.2-nyan.6
litematica_version=0.15.3-nyan.6
minihud_version=0.27.0-nyan.6
tweakeroo_version=0.17.1-nyan.6

0 comments on commit 61c3583

Please sign in to comment.