From 3d11453b309f5a5cc14095d91413d9d093f72226 Mon Sep 17 00:00:00 2001 From: kb1000 Date: Fri, 24 Sep 2021 00:13:29 +0200 Subject: [PATCH] Fix mixins --- src/main/java/de/kb1000/notelemetry/NoTelemetry.java | 2 +- .../notelemetry/mixin/YggdrasilUserApiServiceMixin.java | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/de/kb1000/notelemetry/NoTelemetry.java b/src/main/java/de/kb1000/notelemetry/NoTelemetry.java index dffc186..a909486 100644 --- a/src/main/java/de/kb1000/notelemetry/NoTelemetry.java +++ b/src/main/java/de/kb1000/notelemetry/NoTelemetry.java @@ -29,7 +29,7 @@ public void onPreLaunch() { } // from Fabric Loader, copied to avoid depending on Loader internals - static Optional getSource(ClassLoader loader, String filename) { + private static Optional getSource(ClassLoader loader, String filename) { URL url; if ((url = loader.getResource(filename)) != null) { diff --git a/src/main/java/de/kb1000/notelemetry/mixin/YggdrasilUserApiServiceMixin.java b/src/main/java/de/kb1000/notelemetry/mixin/YggdrasilUserApiServiceMixin.java index 5d5f6b8..57a05da 100644 --- a/src/main/java/de/kb1000/notelemetry/mixin/YggdrasilUserApiServiceMixin.java +++ b/src/main/java/de/kb1000/notelemetry/mixin/YggdrasilUserApiServiceMixin.java @@ -3,7 +3,6 @@ import com.google.gson.Gson; import com.mojang.authlib.minecraft.TelemetrySession; import com.mojang.authlib.yggdrasil.YggdrasilUserApiService; -import com.mojang.authlib.yggdrasil.YggdrassilTelemetrySession; import com.mojang.authlib.yggdrasil.response.PrivilegesResponse; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; @@ -19,15 +18,15 @@ public class YggdrasilUserApiServiceMixin { @Unique private static final PrivilegesResponse.Privileges.Privilege PRIVILEGE_DISABLED = new Gson().fromJson("{\"enabled\": false}", PrivilegesResponse.Privileges.Privilege.class); - @Redirect(method = "checkPrivileges", at = @At(value = "INVOKE", target = "Lcom/mojang/authlib/yggdrasil/response/PrivilegesResponse$Privileges;getTelemetry()Ljava/util/Optional;")) - private static Optional getTelemetry(PrivilegesResponse.Privileges privileges) { + @Redirect(method = "checkPrivileges", at = @At(value = "INVOKE", target = "Lcom/mojang/authlib/yggdrasil/response/PrivilegesResponse$Privileges;getTelemetry()Ljava/util/Optional;", remap = false), remap = false) + private Optional getTelemetry(PrivilegesResponse.Privileges privileges) { return Optional.of(PRIVILEGE_DISABLED); } /** * @author kb1000 */ - @Overwrite + @Overwrite(remap = false) public boolean telemetryAllowed() { return false; } @@ -35,7 +34,7 @@ public boolean telemetryAllowed() { /** * @author kb1000 */ - @Overwrite + @Overwrite(remap = false) public TelemetrySession newTelemetrySession(final Executor executor) { return TelemetrySession.DISABLED; }