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