From 1d2e2b483a50bd5c892117690d5d95fa80ac4bc1 Mon Sep 17 00:00:00 2001 From: Wulian <1055917385@qq.com> Date: Sat, 26 Oct 2024 18:15:09 +0800 Subject: [PATCH] Port to 1.21.x --- .github/workflows/build.yml | 11 ----------- README.md | 2 +- README_ZH.md | 2 +- build.gradle | 18 ------------------ fabric/build.gradle | 8 +------- .../fabric/ModMenuCompat.java | 18 ------------------ .../fabric/mixin/ChatHudMixin.java | 4 ++-- fabric/src/main/resources/fabric.mod.json | 5 +---- gradle.properties | 4 +--- .../neoforge/mixin/ChatHudMixin.java | 4 ++-- .../main/resources/META-INF/neoforge.mods.toml | 7 ------- neoforge/src/main/resources/pack.mcmeta | 3 ++- 12 files changed, 11 insertions(+), 75 deletions(-) delete mode 100644 fabric/src/main/java/com/wulian/chatimpressiveanimation/fabric/ModMenuCompat.java diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2b97a5a..18a0c2f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,11 +27,6 @@ jobs: chmod +x gradlew ./gradlew build - - name: Merge Fabric & NeoForge JARs - run: | - chmod +x gradlew - ./gradlew fusejars - - name: Upload fabric artifacts uses: actions/upload-artifact@v4 with: @@ -43,9 +38,3 @@ jobs: with: name: neoforge-artifacts path: ${{ github.workspace }}/neoforge/build/libs - - - name: Upload merged artifacts - uses: actions/upload-artifact@v4 - with: - name: merged-artifacts - path: ${{ github.workspace }}/build/merged/* diff --git a/README.md b/README.md index 0f566aa..60cb6dd 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ This mod makes the chat look better by adding animations. Such as opening chat, Using this mod is very simple! -First of all, you need to install Architectury API and Cloth Config API, and then you can install this module and use it! +First of all, you need to install Cloth Config API, and then you can install this mod and use it! ## 👀 License diff --git a/README_ZH.md b/README_ZH.md index b17744a..063d6fd 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -48,7 +48,7 @@ 使用这个模组非常简单! -首先需要安装前置模组Architectury API和Cloth Config API,然后即可安装本模组使用啦! +首先需要安装前置模组Cloth Config API,然后即可安装本模组使用啦! ## 👀 协议 diff --git a/build.gradle b/build.gradle index 19ce109..4dbd000 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,6 @@ plugins { id "architectury-plugin" version "3.4-SNAPSHOT" id "dev.architectury.loom" version "1.7-SNAPSHOT" apply false - id "com.hypherionmc.modutils.modfusioner" version "1.0.+" id "com.github.johnrengelman.shadow" version "8.+" apply false } @@ -42,21 +41,4 @@ allprojects { java { withSourcesJar() } - - fusioner { - packageGroup = rootProject.maven_group - mergedJarName = "${rootProject.archives_base_name}" - outputDirectory = "build/merged" - jarVersion = rootProject.version - - neoforge { - projectName = "neoforge" - inputTaskName = "remapJar" - } - - fabric { - projectName = "fabric" - inputTaskName = "remapJar" - } - } } diff --git a/fabric/build.gradle b/fabric/build.gradle index ae7299f..f372bd1 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -20,22 +20,16 @@ configurations { } repositories { - maven { url "https://maven.terraformersmc.com/releases/" } - maven { url "https://maven.nucleoid.xyz/" } } dependencies { modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}" modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}" - // Remove the next line if you don't want to depend on the API modApi "dev.architectury:architectury-fabric:${rootProject.architectury_version}" + modApi "me.shedaniel.cloth:cloth-config-fabric:${rootProject.clothconfig_version}" common(project(path: ":common", configuration: "namedElements")) { transitive false } shadowBundle(project(path: ":common", configuration: "transformProductionFabric")) { transitive false } - - modApi "me.shedaniel.cloth:cloth-config-fabric:${rootProject.clothconfig_version}" - modApi "com.terraformersmc:modmenu:${rootProject.modmenu_version}" - modApi "eu.pb4:placeholder-api:${rootProject.placeholder_api_version}" } processResources { diff --git a/fabric/src/main/java/com/wulian/chatimpressiveanimation/fabric/ModMenuCompat.java b/fabric/src/main/java/com/wulian/chatimpressiveanimation/fabric/ModMenuCompat.java deleted file mode 100644 index 370777b..0000000 --- a/fabric/src/main/java/com/wulian/chatimpressiveanimation/fabric/ModMenuCompat.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.wulian.chatimpressiveanimation.fabric; - -import com.terraformersmc.modmenu.api.ConfigScreenFactory; -import com.terraformersmc.modmenu.api.ModMenuApi; -import com.wulian.chatimpressiveanimation.config.ModConfigs; -import me.shedaniel.autoconfig.AutoConfig; -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; - -@Environment(EnvType.CLIENT) -class ModMenuCompat implements ModMenuApi { - @Override - public ConfigScreenFactory getModConfigScreenFactory() { - return parent -> AutoConfig.getConfigScreen(ModConfigs.class, parent).get(); - } -} - - diff --git a/fabric/src/main/java/com/wulian/chatimpressiveanimation/fabric/mixin/ChatHudMixin.java b/fabric/src/main/java/com/wulian/chatimpressiveanimation/fabric/mixin/ChatHudMixin.java index 444974e..226febe 100644 --- a/fabric/src/main/java/com/wulian/chatimpressiveanimation/fabric/mixin/ChatHudMixin.java +++ b/fabric/src/main/java/com/wulian/chatimpressiveanimation/fabric/mixin/ChatHudMixin.java @@ -80,8 +80,8 @@ private float applyYOffset(float y) { return y + chatDisplacementY; } - @Inject(method = "addMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageSignatureData;ILnet/minecraft/client/gui/hud/MessageIndicator;Z)V", at = @At("TAIL")) - private void addMessage(Text message, MessageSignatureData signature, int ticks, MessageIndicator indicator, boolean refresh, CallbackInfo ci) { + @Inject(method = "addMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageSignatureData;Lnet/minecraft/client/gui/hud/MessageIndicator;)V", at = @At("TAIL")) + private void addMessage(Text message, MessageSignatureData signatureData, MessageIndicator indicator, CallbackInfo ci) { messageTimestamps.addFirst(System.currentTimeMillis()); while (this.messageTimestamps.size() > this.visibleMessages.size()) { this.messageTimestamps.removeLast(); diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index 5b636ae..bb80e47 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -17,10 +17,7 @@ "environment": "client", "entrypoints": { "client": [ - "com.wulian.chatimpressiveanimation.fabric.ChatImpressiveAnimationClientFabric" - ], - "modmenu": [ - "com.wulian.chatimpressiveanimation.fabric.ModMenuCompat" + "com.wulian.chatimpressiveanimation.fabric.ChatImpressiveAnimationClientFabric" ] }, "mixins": [ diff --git a/gradle.properties b/gradle.properties index 605b373..de47dd6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,12 +6,10 @@ yarn_mappings=1.21.1+build.3 yarn_patch=1.21+build.4 archives_base_name=ChatImpressiveAnimation -mod_version=1.1.0 +mod_version=1.2.0 maven_group=com.wulian.chatimpressiveanimation architectury_version=13.0.6 -modmenu_version=11.0.2 -placeholder_api_version=2.4.1+1.21 clothconfig_version=15.0.140 fabric_loader_version=0.16.7 diff --git a/neoforge/src/main/java/com/wulian/chatimpressiveanimation/neoforge/mixin/ChatHudMixin.java b/neoforge/src/main/java/com/wulian/chatimpressiveanimation/neoforge/mixin/ChatHudMixin.java index 908672e..0d29219 100644 --- a/neoforge/src/main/java/com/wulian/chatimpressiveanimation/neoforge/mixin/ChatHudMixin.java +++ b/neoforge/src/main/java/com/wulian/chatimpressiveanimation/neoforge/mixin/ChatHudMixin.java @@ -80,8 +80,8 @@ private float applyYOffset(float y) { return y + chatDisplacementY; } - @Inject(method = "addMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageSignatureData;ILnet/minecraft/client/gui/hud/MessageIndicator;Z)V", at = @At("TAIL")) - private void addMessage(Text message, MessageSignatureData signature, int ticks, MessageIndicator indicator, boolean refresh, CallbackInfo ci) { + @Inject(method = "addMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageSignatureData;Lnet/minecraft/client/gui/hud/MessageIndicator;)V", at = @At("TAIL")) + private void addMessage(Text message, MessageSignatureData signatureData, MessageIndicator indicator, CallbackInfo ci) { messageTimestamps.addFirst(System.currentTimeMillis()); while (this.messageTimestamps.size() > this.visibleMessages.size()) { this.messageTimestamps.removeLast(); diff --git a/neoforge/src/main/resources/META-INF/neoforge.mods.toml b/neoforge/src/main/resources/META-INF/neoforge.mods.toml index 9a1ec7c..3a089a3 100644 --- a/neoforge/src/main/resources/META-INF/neoforge.mods.toml +++ b/neoforge/src/main/resources/META-INF/neoforge.mods.toml @@ -34,13 +34,6 @@ versionRange = "[1.21,1.22)" ordering = "NONE" side = "BOTH" -[[dependencies.chatimpressiveanimation]] -modId = "architectury" -type = "required" -versionRange = "*" -ordering = "AFTER" -side = "BOTH" - [[dependencies.chatimpressiveanimation]] modId = "cloth_config" type = "required" diff --git a/neoforge/src/main/resources/pack.mcmeta b/neoforge/src/main/resources/pack.mcmeta index 2b22488..38cbcd3 100644 --- a/neoforge/src/main/resources/pack.mcmeta +++ b/neoforge/src/main/resources/pack.mcmeta @@ -1,6 +1,7 @@ { "pack": { "description": "Chat Impressive Animation", - "pack_format": 32 + "pack_format": 33, + "supported_formats": [33, 99] } }