Skip to content

Commit

Permalink
Only hide own
Browse files Browse the repository at this point in the history
  • Loading branch information
hexadecimal233 authored and arlomcwalter committed Feb 3, 2023
1 parent 8dd4c52 commit 5d2ccda
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Identifier> 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());
}
}
}
}

0 comments on commit 5d2ccda

Please sign in to comment.