mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-11-16 10:55:39 +01:00
Replace Redirect with ModifyExpressionValue
Fixes mod compatibility issue
This commit is contained in:
parent
1c23746dfc
commit
43d5065e1e
@ -19,20 +19,19 @@
|
|||||||
|
|
||||||
package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.screen.hud;
|
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.IPlayerListEntry;
|
||||||
import de.florianmichael.viafabricplus.injection.access.IPlayerListHud;
|
import de.florianmichael.viafabricplus.injection.access.IPlayerListHud;
|
||||||
import de.florianmichael.viafabricplus.settings.impl.VisualSettings;
|
import de.florianmichael.viafabricplus.settings.impl.VisualSettings;
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.client.gui.hud.PlayerListHud;
|
import net.minecraft.client.gui.hud.PlayerListHud;
|
||||||
import net.minecraft.client.network.PlayerListEntry;
|
import net.minecraft.client.network.PlayerListEntry;
|
||||||
import net.minecraft.network.ClientConnection;
|
|
||||||
import org.spongepowered.asm.mixin.Final;
|
import org.spongepowered.asm.mixin.Final;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
import org.spongepowered.asm.mixin.Unique;
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
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"))
|
@ModifyExpressionValue(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/ClientConnection;isEncrypted()Z"))
|
||||||
private boolean hideSkins(ClientConnection instance) {
|
private boolean hideSkins(boolean original) {
|
||||||
return !viaFabricPlus$hideSkins && instance.isEncrypted();
|
return original && !viaFabricPlus$hideSkins;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Unique
|
@Unique
|
||||||
|
Loading…
Reference in New Issue
Block a user