From 43d5065e1ede55eaf3ce9653e01e2235deeb5fe0 Mon Sep 17 00:00:00 2001 From: RaphiMC <50594595+RaphiMC@users.noreply.github.com> Date: Mon, 27 May 2024 14:45:36 +0200 Subject: [PATCH] Replace Redirect with ModifyExpressionValue Fixes mod compatibility issue --- .../fixes/minecraft/screen/hud/MixinPlayerListHud.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/hud/MixinPlayerListHud.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/hud/MixinPlayerListHud.java index dac0eccc..82f78c77 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/hud/MixinPlayerListHud.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/hud/MixinPlayerListHud.java @@ -19,20 +19,19 @@ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.screen.hud; +import com.llamalad7.mixinextras.injector.ModifyExpressionValue; import de.florianmichael.viafabricplus.injection.access.IPlayerListEntry; import de.florianmichael.viafabricplus.injection.access.IPlayerListHud; import de.florianmichael.viafabricplus.settings.impl.VisualSettings; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.hud.PlayerListHud; import net.minecraft.client.network.PlayerListEntry; -import net.minecraft.network.ClientConnection; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import java.util.ArrayList; @@ -68,9 +67,9 @@ public abstract class MixinPlayerListHud implements IPlayerListHud { } } - @Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/ClientConnection;isEncrypted()Z")) - private boolean hideSkins(ClientConnection instance) { - return !viaFabricPlus$hideSkins && instance.isEncrypted(); + @ModifyExpressionValue(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/ClientConnection;isEncrypted()Z")) + private boolean hideSkins(boolean original) { + return original && !viaFabricPlus$hideSkins; } @Unique