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;
}
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);
}
}
}
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);
}
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();
}
}
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();
}
Aggregations