Skip to content

Commit

Permalink
Boykisser fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Nxyi committed Nov 12, 2023
1 parent 4c92891 commit 7701de0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx2G
# Fabric Properties (https://fabricmc.net/versions.html)
minecraft_version=1.20.2
yarn_mappings=1.20.2+build.4
loader_version=0.14.22
loader_version=0.14.12

# Mod Properties
mod_version=1.0.6
Expand Down
27 changes: 17 additions & 10 deletions src/main/java/com/dark/zewo2/mixin/PlayerListEntryMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,36 @@
import meteordevelopment.meteorclient.systems.modules.Modules;
import net.minecraft.client.network.PlayerListEntry;
import net.minecraft.client.util.DefaultSkinHelper;
import net.minecraft.client.util.SkinTextures;
import net.minecraft.util.Identifier;
import org.spongepowered.asm.mixin.Final;
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;

import java.util.function.Supplier;

@Mixin(PlayerListEntry.class)
public abstract class PlayerListEntryMixin {
@Final
@Shadow
public abstract GameProfile getProfile();
private Supplier<SkinTextures> texturesSupplier;

@Inject(method = "getSkinTextures", at = @At("HEAD"), cancellable = true)
private void onGetTexture(CallbackInfoReturnable<Identifier> info) {
private void onGetTexture(CallbackInfoReturnable<SkinTextures> cir) {
if (Modules.get().get(Boykisser.class).isActive()) {
info.setReturnValue(Boykisser.boykisser);
cir.setReturnValue(
new SkinTextures(
Boykisser.boykisser,
texturesSupplier.get().textureUrl(),
texturesSupplier.get().capeTexture(),
texturesSupplier.get().elytraTexture(),
SkinTextures.Model.SLIM,
texturesSupplier.get().secure()
)
);
}
}

// @Inject(method = "", at = @At("HEAD"), cancellable = true)
// private void getModel(CallbackInfoReturnable<String> info) {
// if (Modules.get().get(Boykisser.class).isActive()) {
// info.setReturnValue("slim");
// }
// }
}

0 comments on commit 7701de0

Please sign in to comment.