SkullRenderer uses a Redirect now.

This commit is contained in:
Matthew Messinger 2016-03-16 00:40:17 -04:00
parent 1d40648e47
commit 01ea749732

View file

@ -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<TileEntitySkull> {
@Inject(method = "renderSkull",
at = @At(
@Redirect(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) {
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<ResourceLocation> skin = HDSkinManager.INSTANCE.getSkinLocation(profile, Type.SKIN, true);
if (skin.isPresent())
// rebind
bindTexture(skin.get());
}
else
bindTexture(rl);
} else
bindTexture(rl);
}
}