diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/mixin/MixinSkullRenderer.java b/src/hdskins/java/com/voxelmodpack/hdskins/mixin/MixinSkullRenderer.java index 49dd69c2..549ed06e 100644 --- a/src/hdskins/java/com/voxelmodpack/hdskins/mixin/MixinSkullRenderer.java +++ b/src/hdskins/java/com/voxelmodpack/hdskins/mixin/MixinSkullRenderer.java @@ -2,9 +2,7 @@ package com.voxelmodpack.hdskins.mixin; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.At.Shift; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.Redirect; import com.google.common.base.Optional; import com.mojang.authlib.GameProfile; @@ -20,19 +18,20 @@ import net.minecraft.util.ResourceLocation; @Mixin(TileEntitySkullRenderer.class) public abstract class MixinSkullRenderer extends TileEntitySpecialRenderer { - @Inject(method = "renderSkull", - at = @At( - value = "INVOKE", - target = "Lnet/minecraft/client/renderer/tileentity/TileEntitySkullRenderer;bindTexture(Lnet/minecraft/util/ResourceLocation;)V", - ordinal = 4, - shift = Shift.AFTER) ) - private void onBindTexture(float x, float y, float z, EnumFacing facing, float rotation, int meta, GameProfile profile, int p_180543_8_, - CallbackInfo ci) { + @Redirect(method = "renderSkull", at = @At( + value = "INVOKE", + target = "Lnet/minecraft/client/renderer/tileentity/TileEntitySkullRenderer;bindTexture(Lnet/minecraft/util/ResourceLocation;)V", + ordinal = 4)) + private void onBindTexture(TileEntitySkullRenderer tesr, ResourceLocation rl, float x, float y, float z, EnumFacing facing, float rotation, int meta, + GameProfile profile, int p_180543_8_) { if (profile != null) { Optional skin = HDSkinManager.INSTANCE.getSkinLocation(profile, Type.SKIN, true); if (skin.isPresent()) // rebind bindTexture(skin.get()); - } + else + bindTexture(rl); + } else + bindTexture(rl); } }