From b358528fd9250a819269ba88a432f480cf392b54 Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Mon, 25 Nov 2024 19:37:55 +0100 Subject: [PATCH 01/10] Update Gradle to latest version --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a80b22c..e2847c8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME From aa802d4b6ef93d6198fa84463f4ae3fbb0b39d8d Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Mon, 25 Nov 2024 19:38:16 +0100 Subject: [PATCH 02/10] Update compatibilityLevel to Java 21 --- src/main/resources/numeralping.mixins.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/numeralping.mixins.json b/src/main/resources/numeralping.mixins.json index 3732e1c..820921d 100644 --- a/src/main/resources/numeralping.mixins.json +++ b/src/main/resources/numeralping.mixins.json @@ -2,7 +2,7 @@ "required": false, "minVersion": "0.8", "package": "io.toadlabs.numeralping.mixin", - "compatibilityLevel": "JAVA_17", + "compatibilityLevel": "JAVA_21", "mixins": [ ], "client": [ From 89bd4961eb6990da616c41395c9c6238e385dc98 Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Mon, 25 Nov 2024 19:39:48 +0100 Subject: [PATCH 03/10] Update version to MC 1.21.3 --- gradle.properties | 10 +++++----- src/main/resources/fabric.mod.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gradle.properties b/gradle.properties index 2d6d50a..3b02a0a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,16 +2,16 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://modmuss50.me/fabric.html -minecraft_version=1.21 -yarn_mappings=1.21+build.2 loader_version=0.15.11 +minecraft_version=1.21.3 +yarn_mappings=1.21.3+build.2 # Mod Properties mod_version=1.2.4 maven_group=io.toadlabs archives_base_name=numeralping # Dependencies # check this on https://modmuss50.me/fabric.html -fabric_version=0.100.1+1.21 -yacl_version=3.5.0+1.21-fabric -mod_menu_version=11.0.0-rc.4 +fabric_version=0.109.0+1.21.3 +yacl_version=3.6.1+1.21.2-fabric +mod_menu_version=12.0.0-beta.1 devauth_version=1.2.1 diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index add422b..e426981 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -35,7 +35,7 @@ "depends": { "fabricloader": ">=0.15", "fabric-api": "*", - "minecraft": "~1.21", + "minecraft": "~1.21.3", "yet_another_config_lib_v3": "*" }, "suggests": { From 290266c9d6c426c585c5e255bee8d51ac95f720f Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Mon, 25 Nov 2024 19:39:58 +0100 Subject: [PATCH 04/10] Update to latest loom version --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 4bfe9a1..276d97a 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '1.6-SNAPSHOT' + id 'fabric-loom' version '1.8.12' id 'maven-publish' } From 4c6abf62569545a2742964e3c9f37d5d5b77d7ed Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Mon, 25 Nov 2024 19:40:19 +0100 Subject: [PATCH 05/10] Update fabric loader to latest version --- gradle.properties | 2 +- src/main/resources/fabric.mod.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 3b02a0a..75f70f9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,9 +2,9 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://modmuss50.me/fabric.html -loader_version=0.15.11 minecraft_version=1.21.3 yarn_mappings=1.21.3+build.2 +loader_version=0.16.9 # Mod Properties mod_version=1.2.4 maven_group=io.toadlabs diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index e426981..74e4081 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -33,7 +33,7 @@ "numeralping.mixins.json" ], "depends": { - "fabricloader": ">=0.15", + "fabricloader": ">=0.16", "fabric-api": "*", "minecraft": "~1.21.3", "yet_another_config_lib_v3": "*" From e8a47607f669aad53b45f4f7b773a764efe4c33c Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Mon, 25 Nov 2024 19:40:40 +0100 Subject: [PATCH 06/10] Fix incompatible 1.21.3 code --- .../numeralping/mixin/ServerEntryMixin.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/toadlabs/numeralping/mixin/ServerEntryMixin.java b/src/main/java/io/toadlabs/numeralping/mixin/ServerEntryMixin.java index 6ebaf2b..cbd9c4b 100644 --- a/src/main/java/io/toadlabs/numeralping/mixin/ServerEntryMixin.java +++ b/src/main/java/io/toadlabs/numeralping/mixin/ServerEntryMixin.java @@ -8,6 +8,7 @@ import net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen; import net.minecraft.client.gui.screen.multiplayer.MultiplayerServerListWidget; import net.minecraft.client.network.ServerInfo; +import net.minecraft.client.render.RenderLayer; import net.minecraft.text.Text; import net.minecraft.text.TranslatableTextContent; import net.minecraft.util.Identifier; @@ -20,6 +21,8 @@ import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.asm.mixin.injection.invoke.arg.Args; +import java.util.function.Function; + // a priority of 2000 means it will apply later // this is combined with `require = 0` to allow other mods to apply more integral functionality first without the game crashing @Mixin(value = MultiplayerServerListWidget.ServerEntry.class, priority = 0) @@ -40,8 +43,13 @@ public boolean hideTooltip(MultiplayerScreen instance, Text text) { return !(NumeralConfig.instance().serverList && text.getContent() instanceof TranslatableTextContent content && content.getKey().equalsIgnoreCase("multiplayer.status.ping")); } - @Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/DrawContext;drawGuiTexture(Lnet/minecraft/util/Identifier;IIII)V", ordinal = 0)) - public void renderDetailedLatency(DrawContext instance, Identifier texture, int x, int y, int width, int height) { + @Redirect( + method = "render", + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/client/gui/DrawContext;drawGuiTexture(Ljava/util/function/Function;Lnet/minecraft/util/Identifier;IIII)V", + ordinal = 0)) + public void renderDetailedLatency(DrawContext instance, Function renderLayers, Identifier texture, int x, int y, int width, int height) { NumeralConfig config = NumeralConfig.instance(); if (server.ping >= 0 && config.serverList) { @@ -58,7 +66,7 @@ public void renderDetailedLatency(DrawContext instance, Identifier texture, int return; } - instance.drawGuiTexture(texture, x, y, width, height); + instance.drawGuiTexture(renderLayers, texture, x, y, width, height); } @Unique From 113cde1cb9b05f2dac717ba5bc2c8d1df4ded0ee Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Mon, 25 Nov 2024 19:40:47 +0100 Subject: [PATCH 07/10] Fix incorrect error message --- src/main/java/io/toadlabs/numeralping/NumeralPingMod.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/toadlabs/numeralping/NumeralPingMod.java b/src/main/java/io/toadlabs/numeralping/NumeralPingMod.java index 95032fe..b01e5b5 100644 --- a/src/main/java/io/toadlabs/numeralping/NumeralPingMod.java +++ b/src/main/java/io/toadlabs/numeralping/NumeralPingMod.java @@ -56,7 +56,7 @@ public void saveConfig() { try { config.save(configFile); } catch (IOException error) { - LOGGER.error("Failed to read config", error); + LOGGER.error("Failed to save config", error); } } From b191349d82bb19ff768761be32d1d97b5ad2f939 Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Mon, 25 Nov 2024 19:43:15 +0100 Subject: [PATCH 08/10] Update included resource pack versions --- src/main/resources/resourcepacks/font_fix/pack.mcmeta | 2 +- src/main/resources/resourcepacks/font_fix_high_res/pack.mcmeta | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/resourcepacks/font_fix/pack.mcmeta b/src/main/resources/resourcepacks/font_fix/pack.mcmeta index 7185ddd..2e83515 100644 --- a/src/main/resources/resourcepacks/font_fix/pack.mcmeta +++ b/src/main/resources/resourcepacks/font_fix/pack.mcmeta @@ -1,6 +1,6 @@ { "pack": { - "pack_format": 34, + "pack_format": 42, "description": "Fix for illegible font.\nThis is the low-res version." } } diff --git a/src/main/resources/resourcepacks/font_fix_high_res/pack.mcmeta b/src/main/resources/resourcepacks/font_fix_high_res/pack.mcmeta index 4e5d1ab..73c5cbd 100644 --- a/src/main/resources/resourcepacks/font_fix_high_res/pack.mcmeta +++ b/src/main/resources/resourcepacks/font_fix_high_res/pack.mcmeta @@ -1,6 +1,6 @@ { "pack": { - "pack_format": 34, + "pack_format": 42, "description": "Fix for illegible/low-res font.\nThis is the high-res version." } } From f3e0cb19d83c10e3a7da1b84428602a7c5bb2d29 Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Mon, 25 Nov 2024 19:43:26 +0100 Subject: [PATCH 09/10] Cleanup code --- .../integration/ModMenuIntegration.java | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/main/java/io/toadlabs/numeralping/integration/ModMenuIntegration.java b/src/main/java/io/toadlabs/numeralping/integration/ModMenuIntegration.java index 7bd766b..81f5dee 100644 --- a/src/main/java/io/toadlabs/numeralping/integration/ModMenuIntegration.java +++ b/src/main/java/io/toadlabs/numeralping/integration/ModMenuIntegration.java @@ -23,7 +23,7 @@ public final class ModMenuIntegration implements ModMenuApi { @Override public ConfigScreenFactory getModConfigScreenFactory() { - return (parent) -> { + return parent -> { NumeralConfig config = NumeralConfig.instance(); return YetAnotherConfigLib.createBuilder() .title(Text.of(NumeralPingMod.NAME)) @@ -37,7 +37,7 @@ public ConfigScreenFactory getModConfigScreenFactory() { .description(OptionDescription.of(Text.translatable(OPTION + ".playerList.desc"))) .binding(NumeralConfig.DEFAULTS.playerList, () -> config.playerList, - (value) -> config.playerList = value) + value -> config.playerList = value) .controller(TickBoxControllerBuilder::create) .build()) @@ -47,7 +47,7 @@ public ConfigScreenFactory getModConfigScreenFactory() { .description(OptionDescription.of(Text.translatable(OPTION + ".serverList.desc"))) .binding(NumeralConfig.DEFAULTS.serverList, () -> config.serverList, - (value) -> config.serverList = value) + value -> config.serverList = value) .controller(TickBoxControllerBuilder::create) .build()) @@ -57,7 +57,7 @@ public ConfigScreenFactory getModConfigScreenFactory() { .description(OptionDescription.of(Text.translatable(OPTION + ".smallPing.desc"))) .binding(NumeralConfig.DEFAULTS.smallPing, () -> config.smallPing, - (value) -> config.smallPing = value) + value -> config.smallPing = value) .controller(TickBoxControllerBuilder::create) .build()) @@ -69,7 +69,7 @@ public ConfigScreenFactory getModConfigScreenFactory() { .description(OptionDescription.of(Text.translatable(OPTION + ".defaultPingThreshold.desc"))) .binding(NumeralConfig.DEFAULTS.defaultPingThreshold, () -> config.defaultPingThreshold, - (value) -> config.defaultPingThreshold = value) + value -> config.defaultPingThreshold = value) .controller(IntegerFieldControllerBuilder::create) .build()) @@ -79,7 +79,7 @@ public ConfigScreenFactory getModConfigScreenFactory() { .description(OptionDescription.of(Text.translatable(OPTION + ".levelOnePingThreshold.desc"))) .binding(NumeralConfig.DEFAULTS.levelOnePingThreshold, () -> config.levelOnePingThreshold, - (value) -> config.levelOnePingThreshold = value) + value -> config.levelOnePingThreshold = value) .controller(IntegerFieldControllerBuilder::create) .build()) @@ -89,7 +89,7 @@ public ConfigScreenFactory getModConfigScreenFactory() { .description(OptionDescription.of(Text.translatable(OPTION + ".levelTwoPingThreshold.desc"))) .binding(NumeralConfig.DEFAULTS.levelTwoPingThreshold, () -> config.levelTwoPingThreshold, - (value) -> config.levelTwoPingThreshold = value) + value -> config.levelTwoPingThreshold = value) .controller(IntegerFieldControllerBuilder::create) .build()) @@ -99,7 +99,7 @@ public ConfigScreenFactory getModConfigScreenFactory() { .description(OptionDescription.of(Text.translatable(OPTION + ".levelThreePingThreshold.desc"))) .binding(NumeralConfig.DEFAULTS.levelThreePingThreshold, () -> config.levelThreePingThreshold, - (value) -> config.levelThreePingThreshold = value) + value -> config.levelThreePingThreshold = value) .controller(IntegerFieldControllerBuilder::create) .build()) @@ -108,7 +108,7 @@ public ConfigScreenFactory getModConfigScreenFactory() { .name(Text.translatable(OPTION + ".defaultPingColour")) .binding(NumeralConfig.DEFAULTS.defaultPingColour, () -> config.defaultPingColour, - (value) -> config.defaultPingColour = value) + value -> config.defaultPingColour = value) .controller(ColorControllerBuilder::create) .build()) @@ -117,7 +117,7 @@ public ConfigScreenFactory getModConfigScreenFactory() { .name(Text.translatable(OPTION + ".levelOnePingColour")) .binding(NumeralConfig.DEFAULTS.levelOnePingColour, () -> config.levelOnePingColour, - (value) -> config.levelOnePingColour = value) + value -> config.levelOnePingColour = value) .controller(ColorControllerBuilder::create) .build()) @@ -126,7 +126,7 @@ public ConfigScreenFactory getModConfigScreenFactory() { .name(Text.translatable(OPTION + ".levelTwoPingColour")) .binding(NumeralConfig.DEFAULTS.levelTwoPingColour, () -> config.levelTwoPingColour, - (value) -> config.levelTwoPingColour = value) + value -> config.levelTwoPingColour = value) .controller(ColorControllerBuilder::create) .build()) @@ -135,7 +135,7 @@ public ConfigScreenFactory getModConfigScreenFactory() { .name(Text.translatable(OPTION + ".levelThreePingColour")) .binding(NumeralConfig.DEFAULTS.levelThreePingColour, () -> config.levelThreePingColour, - (value) -> config.levelThreePingColour = value) + value -> config.levelThreePingColour = value) .controller(ColorControllerBuilder::create) .build()) @@ -145,7 +145,7 @@ public ConfigScreenFactory getModConfigScreenFactory() { .description(OptionDescription.of(Text.translatable(OPTION + ".levelFourPingColour.desc"))) .binding(NumeralConfig.DEFAULTS.levelFourPingColour, () -> config.levelFourPingColour, - (value) -> config.levelFourPingColour = value) + value -> config.levelFourPingColour = value) .controller(ColorControllerBuilder::create) .build()) @@ -154,7 +154,7 @@ public ConfigScreenFactory getModConfigScreenFactory() { .name(Text.translatable(OPTION + ".levelFivePingColour")) .binding(NumeralConfig.DEFAULTS.levelFivePingColour, () -> config.levelFivePingColour, - (value) -> config.levelFivePingColour = value) + value -> config.levelFivePingColour = value) .controller(ColorControllerBuilder::create) .build()) From 4a127e155b897dc71b778a2d9924228361f507e5 Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Mon, 25 Nov 2024 19:43:31 +0100 Subject: [PATCH 10/10] Bump mod version --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 75f70f9..e247a79 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ minecraft_version=1.21.3 yarn_mappings=1.21.3+build.2 loader_version=0.16.9 # Mod Properties -mod_version=1.2.4 +mod_version=1.2.5 maven_group=io.toadlabs archives_base_name=numeralping # Dependencies