From 5f2b7b873ad9ca07d099d3ed58557faf60fa0c66 Mon Sep 17 00:00:00 2001 From: kb1000 Date: Wed, 22 Mar 2023 00:01:26 +0100 Subject: [PATCH] Add support for 1.19.4 Fixes #14 --- build.gradle.kts | 2 +- gradle.properties | 10 +++++----- .../kb1000/notelemetry/mixin/OptionsScreenMixin.java | 10 ++++++++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index c083a17..5196363 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -54,7 +54,7 @@ sourceSets { dependencies { // To change the versions, see the gradle.properties file minecraft("com.mojang:minecraft:${minecraft_version}") - mappings("net.fabricmc:yarn:$minecraft_version+build.$yarn_mappings:v2") + mappings("net.fabricmc:yarn:$yarn_mappings:v2") modImplementation("net.fabricmc:fabric-loader:${loader_version}") compileOnly("net.minecraftforge:javafmllanguage:${forge_version}") { isTransitive = false diff --git a/gradle.properties b/gradle.properties index faafb3e..ae9a601 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,14 +3,14 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/versions.html -minecraft_version=23w04a -yarn_mappings=4 -loader_version=0.14.13 +minecraft_version=1.19.4 +yarn_mappings=1.19.4+build.1 +loader_version=0.14.17 # Forge -forge_version=1.19.3-44.1.8 +forge_version=1.19.4-45.0.18 # Mod Properties -mod_version=1.6.0 +mod_version=1.7.0 maven_group=de.kb1000 archives_base_name=no-telemetry diff --git a/src/main/java/de/kb1000/notelemetry/mixin/OptionsScreenMixin.java b/src/main/java/de/kb1000/notelemetry/mixin/OptionsScreenMixin.java index c6892b8..bd777df 100644 --- a/src/main/java/de/kb1000/notelemetry/mixin/OptionsScreenMixin.java +++ b/src/main/java/de/kb1000/notelemetry/mixin/OptionsScreenMixin.java @@ -5,14 +5,20 @@ @Mixin(targets = "net.minecraft.client.gui.screen.option.OptionsScreen") public class OptionsScreenMixin { - @Group(name = "removeTelemetryButton", min = 1) + @Group(name = "removeTelemetryButton", min = 1, max = 1) @Redirect(method = "init", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/widget/GridWidget$Adder;add(Lnet/minecraft/client/gui/widget/Widget;)Lnet/minecraft/client/gui/widget/Widget;", ordinal = 0), slice = @Slice(from = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/screen/option/OptionsScreen;TELEMETRY_TEXT:Lnet/minecraft/text/Text;"))) private @Coerce Object removeTelemetryButton(@Coerce Object adder, @Coerce Object widget) { return widget; } + @Group(name = "removeTelemetryButton", min = 1, max = 1) + @Redirect(method = "init", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/layouts/GridLayout$RowHelper;m_264139_(Lnet/minecraft/client/gui/layouts/LayoutElement;)Lnet/minecraft/client/gui/layouts/LayoutElement;", ordinal = 0), slice = @Slice(from = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/screen/option/OptionsScreen;TELEMETRY_TEXT:Lnet/minecraft/text/Text;"))) + private @Coerce Object removeTelemetryButtonForge(@Coerce Object adder, @Coerce Object widget) { + return widget; + } + @Redirect(method = "init", at = @At(value = "INVOKE", target = "Lnet/minecraft/class_7845$class_7939;method_47612(Lnet/minecraft/class_339;)Lnet/minecraft/class_339;", ordinal = 0), slice = @Slice(from = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/screen/option/OptionsScreen;TELEMETRY_TEXT:Lnet/minecraft/text/Text;"))) - @Group(name = "removeTelemetryButton", min = 1) + @Group(name = "removeTelemetryButton", min = 1, max = 1) private @Coerce Object removeTelemetryButtonOld(@Coerce Object adder, @Coerce Object widget) { return widget; }