Search in sources :

Example 11 with RenderPlayer

use of net.minecraft.client.renderer.entity.RenderPlayer in project PneumaticCraft by MineMaarten.

the class ItemPneumaticArmor method getArmorModel.

/**
 * Override this method to have an item handle its own armor rendering.
 *
 * @param  entityLiving  The entity wearing the armor
 * @param  itemStack  The itemStack to render the model of
 * @param  armorSlot  0=head, 1=torso, 2=legs, 3=feet
 *
 * @return  A ModelBiped to render instead of the default
 */
@Override
@SideOnly(Side.CLIENT)
public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) {
    if (armorSlot == 0 && (Config.useHelmetModel || DateEventHandler.isIronManEvent())) {
        RenderItemPneumaticHelmet.INSTANCE.render(entityLiving);
        RenderPlayer render = (RenderPlayer) RenderManager.instance.entityRenderMap.get(EntityPlayer.class);
        ModelBiped model = armorSlot == 2 ? render.modelArmor : render.modelArmorChestplate;
        model.bipedHead.showModel = false;
        return model;
    }
    return null;
}
Also used : ModelBiped(net.minecraft.client.model.ModelBiped) EntityPlayer(net.minecraft.entity.player.EntityPlayer) RenderPlayer(net.minecraft.client.renderer.entity.RenderPlayer) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Aggregations

RenderPlayer (net.minecraft.client.renderer.entity.RenderPlayer)11 EntityPlayer (net.minecraft.entity.player.EntityPlayer)4 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)3 RenderManager (net.minecraft.client.renderer.entity.RenderManager)3 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)3 PlayerPointer (riskyken.armourersWorkshop.common.data.PlayerPointer)3 Field (java.lang.reflect.Field)2 ModelBiped (net.minecraft.client.model.ModelBiped)2 Render (net.minecraft.client.renderer.entity.Render)2 ResourceLocation (net.minecraft.util.ResourceLocation)2 FakePlayer (net.minecraftforge.common.util.FakePlayer)2 MannequinFakePlayer (riskyken.armourersWorkshop.client.render.MannequinFakePlayer)2 EquipmentWardrobeData (riskyken.armourersWorkshop.common.skin.EquipmentWardrobeData)2 LayerBloodElytra (WayofTime.bloodmagic.client.render.LayerBloodElytra)1 InvokeEvent (cc.hyperium.event.InvokeEvent)1 IMixinThreadDownloadImageData (cc.hyperium.mixins.client.renderer.IMixinThreadDownloadImageData)1 IMixinTextureManager (cc.hyperium.mixins.client.renderer.texture.IMixinTextureManager)1 BloodRenderLayer (com.teamwizardry.wizardry.client.render.BloodRenderLayer)1 RenderHaloEntity (com.teamwizardry.wizardry.client.render.item.RenderHaloEntity)1 RenderHaloPlayer (com.teamwizardry.wizardry.client.render.item.RenderHaloPlayer)1