From cc6150655cbdb79630a6ee93861375dbebb1060f Mon Sep 17 00:00:00 2001 From: Hendrix-Shen Date: Sat, 23 Sep 2023 12:15:20 +0800 Subject: [PATCH] Support MInecraft 1.20.2 Signed-off-by: Hendrix-Shen --- .github/workflows/CI.yml | 6 ++-- README.md | 9 +++--- README_ZH_CN.md | 9 +++--- fabricWrapper/build.gradle | 32 +++++++++++++------ .../src/main/resources/fabric.mod.json | 6 ++-- gradle.properties | 8 ++--- settings.gradle | 5 ++- versions/1.20.1/gradle.properties | 10 +++--- versions/1.20.2/gradle.properties | 20 ++++++------ 9 files changed, 59 insertions(+), 46 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index ccdff78..efa0a89 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -126,7 +126,8 @@ jobs: 1.19.3 1.19.4 1.20.1 - version-resolver: latest + 1.20.2 + version-resolver: any java: | 8 9 @@ -248,7 +249,8 @@ jobs: 1.19.3 1.19.4 1.20.1 - version-resolver: latest + 1.20.2 + version-resolver: any java: | 8 9 diff --git a/README.md b/README.md index 6c78589..e0da1b8 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ The default hotkey to open the in-game config GUI is **T + C**. |--------------------------|----------|------------|----------------------------------------------------------------------------------------------------------------------------------------------------| | Auth Me | Optional | Any | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/auth-me) | [Github](https://github.com/axieum/authme) | | In-Game Account Switcher | Optional | Any | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/in-game-account-switcher) | -| MagicLib | Required | \>=0.7.336 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/magiclib) | [Github](https://github.com/Hendrix-Shen/MagicLib) | +| MagicLib | Required | \>=0.7.387 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/magiclib) | [Github](https://github.com/Hendrix-Shen/MagicLib) | | MaliLib | Required | Any | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/malilib) | [Masa WebSite](https://masa.dy.fi/mcmods/client_mods/?mod=malilib) | | Litematica | Optional | Any | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/litematica) | [Masa WebSite](https://masa.dy.fi/mcmods/client_mods/?mod=litematica) | | ReAuth (Fabric) | Optional | Any | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/reauth-fabric) | @@ -43,10 +43,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 diff --git a/README_ZH_CN.md b/README_ZH_CN.md index d2893fc..2359e11 100644 --- a/README_ZH_CN.md +++ b/README_ZH_CN.md @@ -23,7 +23,7 @@ |--------------------------|-----|------------|----------------------------------------------------------------------------------------------------------------------------------------------------| | Auth Me | 可选 | 任意 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/auth-me) | [Github](https://github.com/axieum/authme) | | In-Game Account Switcher | 可选 | 任意 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/in-game-account-switcher) | -| MagicLib | 必须 | \>=0.7.336 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/magiclib) | [Github](https://github.com/Hendrix-Shen/MagicLib) | +| MagicLib | 必须 | \>=0.7.387 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/magiclib) | [Github](https://github.com/Hendrix-Shen/MagicLib) | | MaliLib | 必须 | 任意 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/malilib) | [Masa WebSite](https://masa.dy.fi/mcmods/client_mods/?mod=malilib) | | Litematica | 可选 | 任意 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/litematica) | [Masa WebSite](https://masa.dy.fi/mcmods/client_mods/?mod=litematica) | | ReAuth (Fabric) | 可选 | 任意 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/reauth-fabric) | @@ -43,10 +43,11 @@ - 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 ### 混淆映射表 diff --git a/fabricWrapper/build.gradle b/fabricWrapper/build.gradle index 7109228..367ccd5 100644 --- a/fabricWrapper/build.gradle +++ b/fabricWrapper/build.gradle @@ -1,4 +1,5 @@ import groovy.json.JsonBuilder +import groovy.json.JsonSlurper plugins { id("java-library") @@ -49,13 +50,6 @@ 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}") @@ -63,7 +57,6 @@ processResources { 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, @@ -71,10 +64,29 @@ processResources { "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 { diff --git a/fabricWrapper/src/main/resources/fabric.mod.json b/fabricWrapper/src/main/resources/fabric.mod.json index 5a41514..2d1ceab 100644 --- a/fabricWrapper/src/main/resources/fabric.mod.json +++ b/fabricWrapper/src/main/resources/fabric.mod.json @@ -27,11 +27,9 @@ }, "depends": { "magiclib": ">=${magiclib_dependency}", - "malilib": "*", - "minecraft": ${minecraft_dependency} + "malilib": "*" }, "custom": { "modmenu:clientsideOnly": true - }, - "jars": ${sub_jars} + } } diff --git a/gradle.properties b/gradle.properties index 636aaeb..8833b2e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,9 +19,9 @@ fabric_installer_version=0.11.2 fabric_loader_version=0.14.22 # Annotation processor -lombok_version=1.18.28 +lombok_version=1.18.30 # Required Libraries -# MagicLib - 0.7.384 -magiclib_dependency=0.7.384+e9e3c4a-beta -magiclib_version=0.7.384+e9e3c4a-beta \ No newline at end of file +# MagicLib - 0.7.387 +magiclib_dependency=0.7.387 +magiclib_version=0.7.387 \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 1c7b37b..5d20f3f 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,6 +1,8 @@ pluginManagement { repositories { mavenLocal() + mavenCentral() + gradlePluginPortal() maven { name("Fabric") @@ -21,9 +23,6 @@ pluginManagement { name("Cotton") url("https://server.bbkr.space/artifactory/libs-release") } - - mavenCentral() - gradlePluginPortal() } } diff --git a/versions/1.20.1/gradle.properties b/versions/1.20.1/gradle.properties index 51145ec..9af7502 100644 --- a/versions/1.20.1/gradle.properties +++ b/versions/1.20.1/gradle.properties @@ -1,14 +1,14 @@ # Independent branch configuration # Development Environment minecraft_version=1.20.1 -minecraft_dependency=>1.20 <=1.20.1 +minecraft_dependency=1.20.1 # Compatible Libraries # Litematica - 0.15.0 # https://www.curseforge.com/minecraft/mc-mods/litematica/files/4593296 # litematica-fabric-1.20.1-0.15.0.jar litematica_version=4593296 -# Not Enough Crashes - 4.4.0 -# https://www.curseforge.com/minecraft/mc-mods/not-enough-crashes/files/4587295 -# notenoughcrashes-4.4.4+1.20.1-fabric.jar -not_enough_crashes_version=4587295 \ No newline at end of file +# Not Enough Crashes - 4.4.6 +# https://www.curseforge.com/minecraft/mc-mods/not-enough-crashes/files/4684046 +# notenoughcrashes-4.4.6+1.20.1-fabric.jar +not_enough_crashes_version=4684046 \ No newline at end of file diff --git a/versions/1.20.2/gradle.properties b/versions/1.20.2/gradle.properties index 6915afd..b857593 100644 --- a/versions/1.20.2/gradle.properties +++ b/versions/1.20.2/gradle.properties @@ -1,14 +1,14 @@ # Independent branch configuration # 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 -# Litematica - 1.20.2-pre1-0.15.3-nyan.5 -# https://jitpack.io/#Nyan-Work/litematica/1.20.2-pre2.1 -# litematica-1.20.2-pre2.1.jar -litematica_version=1.20.2-pre2.1 -# Not Enough Crashes - 4.4.0 -# https://www.curseforge.com/minecraft/mc-mods/not-enough-crashes/files/4587295 -# notenoughcrashes-4.4.4+1.20.1-fabric.jar -not_enough_crashes_version=4587295 \ No newline at end of file +# Litematica - 0.15.3-nyan.6 +# https://jitpack.io/#Nyan-Work/litematica/0.15.3-nyan.6 +# litematica-0.15.3-nyan.6.jar +litematica_version=0.15.3-nyan.6 +# Not Enough Crashes - 4.4.6 +# https://www.curseforge.com/minecraft/mc-mods/not-enough-crashes/files/4762979 +# notenoughcrashes-4.4.6+1.20.2-fabric.jar +not_enough_crashes_version=4762979 \ No newline at end of file