From 64d72a3ac2fab16eee8ba0669bc4e876f493e4b9 Mon Sep 17 00:00:00 2001 From: shedaniel Date: Wed, 23 Oct 2024 02:29:05 +0800 Subject: [PATCH] Update to 1.21.2 --- common/build.gradle | 2 +- .../gui/GlobalizedClothConfigScreen.java | 11 +++++++---- common/src/main/resources/cloth-config.accessWidener | 1 - fabric/build.gradle | 4 ++-- fabric/src/main/resources/cloth-config.accessWidener | 1 - gradle.properties | 12 ++++++------ neoforge/build.gradle | 2 +- .../main/resources/META-INF/accesstransformer.cfg | 2 -- .../src/main/resources/META-INF/neoforge.mods.toml | 2 +- settings.gradle | 2 +- 10 files changed, 19 insertions(+), 20 deletions(-) diff --git a/common/build.gradle b/common/build.gradle index 7d3a5d8a..06e8dde5 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -31,7 +31,7 @@ dependencies { } architectury { - common("fabric"/*, "forge", "neoforge"*/) + common("fabric", "neoforge"/*, "forge", "neoforge"*/) } task sourcesJar(type: Jar, dependsOn: classes) { diff --git a/common/src/main/java/me/shedaniel/clothconfig2/gui/GlobalizedClothConfigScreen.java b/common/src/main/java/me/shedaniel/clothconfig2/gui/GlobalizedClothConfigScreen.java index 45a35408..b470c4a9 100644 --- a/common/src/main/java/me/shedaniel/clothconfig2/gui/GlobalizedClothConfigScreen.java +++ b/common/src/main/java/me/shedaniel/clothconfig2/gui/GlobalizedClothConfigScreen.java @@ -277,10 +277,13 @@ public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) { } Rectangle slideArrowBounds = new Rectangle(sliderPosition - 14, 0, 14, height); { - graphics.drawSpecial(source -> { - font.renderText(">", sliderPosition - 7 - font.width(">") / 2f, height / 2, (slideArrowBounds.contains(mouseX, mouseY) ? 16777120 : 16777215) | Mth.clamp(Mth.ceil((1 - sideSlider.scrollAmount()) * 255.0F), 0, 255) << 24, false, graphics.pose().last().pose(), source, Font.DisplayMode.NORMAL, 0, 15728880); - font.renderText("<", sliderPosition - 7 - font.width("<") / 2f, height / 2, (slideArrowBounds.contains(mouseX, mouseY) ? 16777120 : 16777215) | Mth.clamp(Mth.ceil(sideSlider.scrollAmount() * 255.0F), 0, 255) << 24, false, graphics.pose().last().pose(), source, Font.DisplayMode.NORMAL, 0, 15728880); - }); + int textColor = slideArrowBounds.contains(mouseX, mouseY) ? 16777120 : 16777215; + if (Mth.ceil((1 - sideSlider.scrollAmount()) * 255.0F) >= 10) { + graphics.drawString(font, ">", Math.round(sliderPosition - 7 - font.width(">") / 2f), height / 2, textColor | Mth.clamp(Mth.ceil((1 - sideSlider.scrollAmount()) * 255.0F), 0, 255) << 24); + } + if (Mth.ceil(sideSlider.scrollAmount() * 255.0F) >= 10) { + graphics.drawString(font, "<", Math.round(sliderPosition - 7 - font.width("<") / 2f), height / 2, textColor | Mth.clamp(Mth.ceil(sideSlider.scrollAmount() * 255.0F), 0, 255) << 24); + } Rectangle scrollerBounds = sideScroller.getBounds(); if (!scrollerBounds.isEmpty()) { diff --git a/common/src/main/resources/cloth-config.accessWidener b/common/src/main/resources/cloth-config.accessWidener index 6eb80869..4212b7e4 100644 --- a/common/src/main/resources/cloth-config.accessWidener +++ b/common/src/main/resources/cloth-config.accessWidener @@ -1,5 +1,4 @@ accessWidener v1 named -accessible method net/minecraft/client/gui/Font renderText (Ljava/lang/String;FFIZLorg/joml/Matrix4f;Lnet/minecraft/client/renderer/MultiBufferSource;Lnet/minecraft/client/gui/Font$DisplayMode;II)F accessible field net/minecraft/client/gui/components/Button onPress Lnet/minecraft/client/gui/components/Button$OnPress; mutable field net/minecraft/client/gui/components/Button onPress Lnet/minecraft/client/gui/components/Button$OnPress; accessible field net/minecraft/client/KeyMapping key Lcom/mojang/blaze3d/platform/InputConstants$Key; diff --git a/fabric/build.gradle b/fabric/build.gradle index b938a8e6..d4c84c9f 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -111,7 +111,7 @@ publishing { unifiedPublishing { project { displayName = "[Fabric $rootProject.supported_version] v$project.version" - releaseType = "beta" + releaseType = "release" gameVersions = [] gameLoaders = ["fabric"] @@ -121,7 +121,7 @@ unifiedPublishing { curseforge { token = project.hasProperty("curse_api_key") ? project.property("curse_api_key") : System.getenv("curse_api_key") id = project.curseforge_id - gameVersions.addAll "1.21.2-Snapshot", "Java 21" + gameVersions.addAll "1.21.2-Snapshot", "Java 21", "1.21.2" } } diff --git a/fabric/src/main/resources/cloth-config.accessWidener b/fabric/src/main/resources/cloth-config.accessWidener index 6eb80869..4212b7e4 100644 --- a/fabric/src/main/resources/cloth-config.accessWidener +++ b/fabric/src/main/resources/cloth-config.accessWidener @@ -1,5 +1,4 @@ accessWidener v1 named -accessible method net/minecraft/client/gui/Font renderText (Ljava/lang/String;FFIZLorg/joml/Matrix4f;Lnet/minecraft/client/renderer/MultiBufferSource;Lnet/minecraft/client/gui/Font$DisplayMode;II)F accessible field net/minecraft/client/gui/components/Button onPress Lnet/minecraft/client/gui/components/Button$OnPress; mutable field net/minecraft/client/gui/components/Button onPress Lnet/minecraft/client/gui/components/Button$OnPress; accessible field net/minecraft/client/KeyMapping key Lcom/mojang/blaze3d/platform/InputConstants$Key; diff --git a/gradle.properties b/gradle.properties index 945c357d..780c726f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,8 +1,8 @@ org.gradle.jvmargs=-Xmx3G org.gradle.daemon=false -minecraft_version=24w36a -supported_version=1.21.2 (24w36a) +minecraft_version=1.21.2 +supported_version=1.21.2 archives_base_name=cloth-config archives_base_name_snapshot=cloth-config-snapshot @@ -13,12 +13,12 @@ jankson_version=1.2.0 toml4j_version=0.7.2 snakeyaml_version=1.27 -fabric_loader_version=0.16.5 -fabric_api_version=0.103.2+1.21.2 -mod_menu_version=12.0.0-alpha.1 +fabric_loader_version=0.16.7 +fabric_api_version=0.106.1+1.21.2 +mod_menu_version=12.0.0-beta.1 forge_version=51.0.33 -neoforge_version=21.0.167 +neoforge_version=21.2.0-beta neoforge_pr= curseforge_id=348521 diff --git a/neoforge/build.gradle b/neoforge/build.gradle index 18e9b855..945e63dc 100644 --- a/neoforge/build.gradle +++ b/neoforge/build.gradle @@ -100,7 +100,7 @@ unifiedPublishing { project { displayName = "[NeoForge $rootProject.supported_version] v$project.version" releaseType = "release" - gameVersions = ["1.21"] + gameVersions = ["1.21.2"] gameLoaders = ["neoforge"] mainPublication remapJar diff --git a/neoforge/src/main/resources/META-INF/accesstransformer.cfg b/neoforge/src/main/resources/META-INF/accesstransformer.cfg index f9c9fa56..dd38a309 100644 --- a/neoforge/src/main/resources/META-INF/accesstransformer.cfg +++ b/neoforge/src/main/resources/META-INF/accesstransformer.cfg @@ -1,5 +1,3 @@ -# Font.renderText -public net.minecraft.client.gui.Font renderText(Ljava/lang/String;FFIZLorg/joml/Matrix4f;Lnet/minecraft/client/renderer/MultiBufferSource;Lnet/minecraft/client/gui/Font$DisplayMode;II)F # renderText # Button.onPress public-f net.minecraft.client.gui.components.Button onPress # onPress # KeyMapping.key diff --git a/neoforge/src/main/resources/META-INF/neoforge.mods.toml b/neoforge/src/main/resources/META-INF/neoforge.mods.toml index deb2df73..8e9e6368 100644 --- a/neoforge/src/main/resources/META-INF/neoforge.mods.toml +++ b/neoforge/src/main/resources/META-INF/neoforge.mods.toml @@ -17,6 +17,6 @@ An API for config screens. [[dependencies.cloth_config]] modId = "neoforge" type = "required" -versionRange = "[21.0.110-beta,)" +versionRange = "[21.2.0-beta,)" ordering = "NONE" side = "BOTH" diff --git a/settings.gradle b/settings.gradle index 5f295fa9..be984dd1 100755 --- a/settings.gradle +++ b/settings.gradle @@ -15,6 +15,6 @@ if (JavaVersion.current().ordinal() + 1 < 21) { include("common") include("fabric") //include("forge") -//include("neoforge") +include("neoforge") rootProject.name = 'cloth-config'