From 5d2ccda8a14598a88c16ee0653fe41cabe4e7ee0 Mon Sep 17 00:00:00 2001 From: ThebestkillerTBK <2593828650@qq.com> Date: Fri, 3 Feb 2023 15:14:55 +0800 Subject: [PATCH] Only hide own --- .../meteorclient/mixin/PlayerListEntryMixin.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/PlayerListEntryMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/PlayerListEntryMixin.java index 30f4a5aac1..7c5a0c1068 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/PlayerListEntryMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/PlayerListEntryMixin.java @@ -5,20 +5,30 @@ package meteordevelopment.meteorclient.mixin; +import com.mojang.authlib.GameProfile; import meteordevelopment.meteorclient.systems.modules.Modules; import meteordevelopment.meteorclient.systems.modules.misc.NameProtect; +import net.minecraft.client.MinecraftClient; import net.minecraft.client.network.PlayerListEntry; import net.minecraft.client.util.DefaultSkinHelper; import net.minecraft.util.Identifier; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(PlayerListEntry.class) -public class PlayerListEntryMixin { +public abstract class PlayerListEntryMixin { + @Shadow + public abstract GameProfile getProfile(); + @Inject(method = "getSkinTexture", at = @At("HEAD"), cancellable = true) private void onGetTexture(CallbackInfoReturnable info) { - if (Modules.get().get(NameProtect.class).skinProtect()) info.setReturnValue(DefaultSkinHelper.getTexture()); + if (getProfile().getName().equals(MinecraftClient.getInstance().getSession().getUsername())) { + if (Modules.get().get(NameProtect.class).skinProtect()) { + info.setReturnValue(DefaultSkinHelper.getTexture()); + } + } } }