|
5 | 5 | import meteordevelopment.meteorclient.systems.modules.Modules; |
6 | 6 | import net.minecraft.client.network.PlayerListEntry; |
7 | 7 | import net.minecraft.client.util.DefaultSkinHelper; |
| 8 | +import net.minecraft.client.util.SkinTextures; |
8 | 9 | import net.minecraft.util.Identifier; |
| 10 | +import org.spongepowered.asm.mixin.Final; |
9 | 11 | import org.spongepowered.asm.mixin.Mixin; |
10 | 12 | import org.spongepowered.asm.mixin.Shadow; |
11 | 13 | import org.spongepowered.asm.mixin.injection.At; |
12 | 14 | import org.spongepowered.asm.mixin.injection.Inject; |
13 | 15 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; |
14 | 16 |
|
| 17 | +import java.util.function.Supplier; |
| 18 | + |
15 | 19 | @Mixin(PlayerListEntry.class) |
16 | 20 | public abstract class PlayerListEntryMixin { |
| 21 | + @Final |
17 | 22 | @Shadow |
18 | | - public abstract GameProfile getProfile(); |
| 23 | + private Supplier<SkinTextures> texturesSupplier; |
19 | 24 |
|
20 | 25 | @Inject(method = "getSkinTextures", at = @At("HEAD"), cancellable = true) |
21 | | - private void onGetTexture(CallbackInfoReturnable<Identifier> info) { |
| 26 | + private void onGetTexture(CallbackInfoReturnable<SkinTextures> cir) { |
22 | 27 | if (Modules.get().get(Boykisser.class).isActive()) { |
23 | | - info.setReturnValue(Boykisser.boykisser); |
| 28 | + cir.setReturnValue( |
| 29 | + new SkinTextures( |
| 30 | + Boykisser.boykisser, |
| 31 | + texturesSupplier.get().textureUrl(), |
| 32 | + texturesSupplier.get().capeTexture(), |
| 33 | + texturesSupplier.get().elytraTexture(), |
| 34 | + SkinTextures.Model.SLIM, |
| 35 | + texturesSupplier.get().secure() |
| 36 | + ) |
| 37 | + ); |
24 | 38 | } |
25 | 39 | } |
26 | | - |
27 | | -// @Inject(method = "", at = @At("HEAD"), cancellable = true) |
28 | | -// private void getModel(CallbackInfoReturnable<String> info) { |
29 | | -// if (Modules.get().get(Boykisser.class).isActive()) { |
30 | | -// info.setReturnValue("slim"); |
31 | | -// } |
32 | | -// } |
33 | 40 | } |
0 commit comments