Search in sources :

Example 11 with ModelBiped

use of net.minecraft.client.model.ModelBiped in project SimplyJetpacks by Tonius.

the class RenderUtils method getArmorModel.

public static ModelBiped getArmorModel(PackBase pack, EntityLivingBase entity) {
    ModelBiped model = null;
    switch(pack.armorModel) {
        case JETPACK:
            model = ModelJetpack.INSTANCE;
            break;
        case FLUX_PACK:
            model = ModelFluxPack.INSTANCE;
        default:
    }
    if (model == null) {
        return null;
    }
    model.isSneak = entity.isSneaking();
    model.isRiding = entity.isRiding();
    model.isChild = entity.isChild();
    model.heldItemRight = entity.getEquipmentInSlot(0) != null ? 1 : 0;
    if (entity instanceof EntityPlayer) {
        model.aimedBow = ((EntityPlayer) entity).getItemInUseDuration() > 2;
    }
    return model;
}
Also used : ModelBiped(net.minecraft.client.model.ModelBiped) EntityPlayer(net.minecraft.entity.player.EntityPlayer)

Example 12 with ModelBiped

use of net.minecraft.client.model.ModelBiped in project GregTech by GregTechCE.

the class ArmorRenderHooks method renderArmorLayer.

public static void renderArmorLayer(LayerArmorBase<ModelBase> layer, EntityLivingBase entity, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale, EntityEquipmentSlot slotIn) {
    ItemStack itemStack = entity.getItemStackFromSlot(slotIn);
    if (isArmorItem(itemStack, slotIn)) {
        IArmorItem armorItem = (IArmorItem) itemStack.getItem();
        ModelBase armorModel = layer.getModelFromSlot(slotIn);
        if (armorModel instanceof ModelBiped) {
            armorModel = ForgeHooksClient.getArmorModel(entity, itemStack, slotIn, (ModelBiped) armorModel);
        }
        armorModel.setModelAttributes(layer.renderer.getMainModel());
        armorModel.setLivingAnimations(entity, limbSwing, limbSwingAmount, partialTicks);
        layer.setModelSlotVisible(armorModel, slotIn);
        GlStateManager.enableBlend();
        GlStateManager.blendFunc(SourceFactor.ONE, DestFactor.ONE_MINUS_SRC_ALPHA);
        int layers = armorItem.getArmorLayersAmount(itemStack);
        for (int layerIndex = 0; layerIndex < layers; layerIndex++) {
            int i = armorItem.getArmorLayerColor(itemStack, layerIndex);
            float f = (float) (i >> 16 & 255) / 255.0F;
            float f1 = (float) (i >> 8 & 255) / 255.0F;
            float f2 = (float) (i & 255) / 255.0F;
            GlStateManager.color(f, f1, f2, 1.0f);
            String type = layerIndex == 0 ? null : "layer_" + layerIndex;
            layer.renderer.bindTexture(getArmorTexture(entity, itemStack, slotIn, type));
            armorModel.render(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
        }
        if (itemStack.hasEffect()) {
            LayerArmorBase.renderEnchantedGlint(layer.renderer, entity, armorModel, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale);
        }
    }
}
Also used : ModelBiped(net.minecraft.client.model.ModelBiped) ModelBase(net.minecraft.client.model.ModelBase) ItemStack(net.minecraft.item.ItemStack)

Example 13 with ModelBiped

use of net.minecraft.client.model.ModelBiped in project BetterWithAddons by DaedalusGame.

the class RenderKarateZombie method doRender.

@Override
public void doRender(EntityKarateZombie entity, double x, double y, double z, float entityYaw, float partialTicks) {
    ModelBiped biped = (ModelBiped) getMainModel();
    boolean grabbing = entity.getPassengers().size() > 0;
    if (grabbing) {
        biped.rightArmPose = ModelBiped.ArmPose.BOW_AND_ARROW;
        biped.leftArmPose = ModelBiped.ArmPose.BOW_AND_ARROW;
    } else if (entity.getAttackTarget() != null) {
        switch(entity.getCurrentMove()) {
            case Attack:
                biped.rightArmPose = ModelBiped.ArmPose.ITEM;
                biped.leftArmPose = ModelBiped.ArmPose.ITEM;
                break;
            case Suplex:
                biped.rightArmPose = ModelBiped.ArmPose.EMPTY;
                biped.leftArmPose = ModelBiped.ArmPose.ITEM;
                break;
            case Throw:
                biped.rightArmPose = ModelBiped.ArmPose.BLOCK;
                biped.leftArmPose = ModelBiped.ArmPose.BLOCK;
                break;
            case Disarm:
                biped.rightArmPose = ModelBiped.ArmPose.BOW_AND_ARROW;
                biped.leftArmPose = ModelBiped.ArmPose.BOW_AND_ARROW;
                break;
        }
    } else {
        biped.rightArmPose = ModelBiped.ArmPose.EMPTY;
        biped.leftArmPose = ModelBiped.ArmPose.EMPTY;
    }
    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
Also used : ModelBiped(net.minecraft.client.model.ModelBiped)

Example 14 with ModelBiped

use of net.minecraft.client.model.ModelBiped in project Galacticraft by micdoodle8.

the class LayerHeldItemGC method doRenderLayer.

@Override
public void doRenderLayer(AbstractClientPlayer player, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) {
    if (player.ridingEntity instanceof ICameraZoomEntity) {
        return;
    }
    ItemStack itemstack = player.getHeldItem();
    if (itemstack != null) {
        GlStateManager.pushMatrix();
        if (this.livingEntityRenderer.getMainModel().isChild) {
            float f = 0.5F;
            GlStateManager.translate(0.0F, 0.625F, 0.0F);
            GlStateManager.rotate(-20.0F, -1.0F, 0.0F, 0.0F);
            GlStateManager.scale(f, f, f);
        }
        ((ModelBiped) this.livingEntityRenderer.getMainModel()).postRenderArm(0.0625F);
        GlStateManager.translate(-0.0625F, 0.4375F, 0.0625F);
        if (player instanceof EntityPlayer && ((EntityPlayer) player).fishEntity != null) {
            itemstack = new ItemStack(Items.fishing_rod, 0);
        }
        Item item = itemstack.getItem();
        Minecraft minecraft = Minecraft.getMinecraft();
        if (item instanceof ItemBlock && Block.getBlockFromItem(item).getRenderType() == 2) {
            GlStateManager.translate(0.0F, 0.1875F, -0.3125F);
            GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);
            GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
            float f1 = 0.375F;
            GlStateManager.scale(-f1, -f1, f1);
        }
        if (player.isSneaking()) {
            GlStateManager.translate(0.0F, 0.203125F, 0.0F);
        }
        minecraft.getItemRenderer().renderItem(player, itemstack, ItemCameraTransforms.TransformType.THIRD_PERSON);
        GlStateManager.popMatrix();
    }
}
Also used : Item(net.minecraft.item.Item) ModelBiped(net.minecraft.client.model.ModelBiped) EntityPlayer(net.minecraft.entity.player.EntityPlayer) ICameraZoomEntity(micdoodle8.mods.galacticraft.api.entity.ICameraZoomEntity) ItemStack(net.minecraft.item.ItemStack) ItemBlock(net.minecraft.item.ItemBlock) Minecraft(net.minecraft.client.Minecraft)

Example 15 with ModelBiped

use of net.minecraft.client.model.ModelBiped in project ClaySoldiersMod by SanAndreasP.

the class SoldierModelRenderHandler method renderIronCoreBuff.

private void renderIronCoreBuff(EntityClayMan clayMan, RenderClayMan clayManRender, float partTicks) {
    ModelBiped model = clayManRender.modelBipedMain;
    this.buffedBody.rotateAngleX = model.bipedBody.rotateAngleX;
    this.buffedBody.rotateAngleY = model.bipedBody.rotateAngleY;
    this.buffedBody.rotateAngleZ = model.bipedBody.rotateAngleZ;
    clayManRender.bindTexture(clayMan.getTexture());
    GL11.glPushMatrix();
    GL11.glScalef(1.5F, 1.5F, 1.5F);
    this.buffedBody.render(partTicks);
    GL11.glPopMatrix();
}
Also used : ModelBiped(net.minecraft.client.model.ModelBiped)

Aggregations

ModelBiped (net.minecraft.client.model.ModelBiped)28 ItemStack (net.minecraft.item.ItemStack)7 Item (net.minecraft.item.Item)6 ItemArmor (net.minecraft.item.ItemArmor)5 Color (java.awt.Color)4 SideOnly (cpw.mods.fml.relauncher.SideOnly)3 Render (net.minecraft.client.renderer.entity.Render)3 EntityPlayer (net.minecraft.entity.player.EntityPlayer)3 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)2 ModelBase (net.minecraft.client.model.ModelBase)2 ModelRenderer (net.minecraft.client.model.ModelRenderer)2 RenderPlayer (net.minecraft.client.renderer.entity.RenderPlayer)2 ItemBlock (net.minecraft.item.ItemBlock)2 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)2 IColouredItem (blusunrize.immersiveengineering.common.items.IEItemInterfaces.IColouredItem)1 IMixinModelBiped (cc.hyperium.mixinsimp.client.model.IMixinModelBiped)1 MinestuckKeyHandler (com.mraof.minestuck.client.settings.MinestuckKeyHandler)1 EntityBigPart (com.mraof.minestuck.entity.EntityBigPart)1 EntityDecoy (com.mraof.minestuck.entity.EntityDecoy)1 EntityPawn (com.mraof.minestuck.entity.carapacian.EntityPawn)1