use of net.minecraft.client.model.ModelBiped in project Armourers-Workshop by RiskyKen.
the class RenderBlockMannequinItems method renderHeadStack.
public void renderHeadStack(MannequinFakePlayer fakePlayer, ItemStack stack, ModelBiped targetBiped, RenderManager rm, byte[] extraColours, double distance) {
Item targetItem = stack.getItem();
if (SkinNBTHelper.stackHasSkinData(stack)) {
SkinModelRenderer.INSTANCE.renderEquipmentPartFromStack(stack, targetBiped, extraColours, distance, true);
return;
}
if (targetItem instanceof ItemBlock) {
float blockScale = 0.5F;
GL11.glRotated(Math.toDegrees(targetBiped.bipedHead.rotateAngleZ), 0, 0, 1);
GL11.glRotated(Math.toDegrees(targetBiped.bipedHead.rotateAngleY), 0, 1, 0);
GL11.glRotated(Math.toDegrees(targetBiped.bipedHead.rotateAngleX), 1, 0, 0);
GL11.glTranslatef(0, -4 * scale, 0);
GL11.glScalef(-blockScale, -blockScale, blockScale);
GL11.glRotatef(90F, 0F, 1F, 0F);
rm.itemRenderer.renderItem(fakePlayer, stack, stack.getItemDamage());
} else {
if (targetItem instanceof ItemArmor) {
int passes = targetItem.getRenderPasses(stack.getItemDamage());
for (int i = 0; i < passes; i++) {
ModelBiped armourBiped = ForgeHooksClient.getArmorModel(fakePlayer, stack, 0, renderPlayer.modelArmorChestplate);
if (i == 0) {
bindTexture(RenderBiped.getArmorResource(fakePlayer, stack, 0, null));
} else {
bindTexture(RenderBiped.getArmorResource(fakePlayer, stack, 0, "overlay"));
}
Color c = new Color(targetItem.getColorFromItemStack(stack, i));
GL11.glColor3f((float) c.getRed() / 255, (float) c.getGreen() / 255, (float) c.getBlue() / 255);
armourBiped.isChild = false;
if (armourBiped == renderPlayer.modelArmorChestplate) {
setRotations(targetBiped.bipedHead, armourBiped.bipedHead);
armourBiped.bipedHead.showModel = true;
armourBiped.bipedHead.render(scale);
resetRotations(targetBiped.bipedHead);
} else {
try {
GL11.glRotated(Math.toDegrees(targetBiped.bipedHead.rotateAngleZ), 0, 0, 1);
GL11.glRotated(Math.toDegrees(targetBiped.bipedHead.rotateAngleY), 0, 1, 0);
GL11.glRotated(Math.toDegrees(targetBiped.bipedHead.rotateAngleX), 1, 0, 0);
armourBiped.render(null, 0, 0, 0, 0, 0, scale);
} catch (Exception e) {
// ModLogger.log(e);
}
}
}
}
}
}
use of net.minecraft.client.model.ModelBiped in project Armourers-Workshop by RiskyKen.
the class RenderBlockMannequinItems method renderFeetStack.
public void renderFeetStack(MannequinFakePlayer fakePlayer, ItemStack stack, ModelBiped targetBiped, RenderManager rm, byte[] extraColours, double distance) {
Item targetItem = stack.getItem();
if (SkinNBTHelper.stackHasSkinData(stack)) {
SkinModelRenderer.INSTANCE.renderEquipmentPartFromStack(stack, targetBiped, extraColours, distance, true);
return;
}
if (targetItem instanceof ItemArmor) {
int passes = targetItem.getRenderPasses(stack.getItemDamage());
for (int i = 0; i < passes; i++) {
ModelBiped armourBiped = ForgeHooksClient.getArmorModel(fakePlayer, stack, 3, renderPlayer.modelArmorChestplate);
if (i == 0) {
bindTexture(RenderBiped.getArmorResource(fakePlayer, stack, 3, null));
} else {
bindTexture(RenderBiped.getArmorResource(fakePlayer, stack, 3, "overlay"));
}
Color c = new Color(targetItem.getColorFromItemStack(stack, i));
GL11.glColor3f((float) c.getRed() / 255, (float) c.getGreen() / 255, (float) c.getBlue() / 255);
armourBiped.isChild = false;
if (armourBiped == renderPlayer.modelArmorChestplate) {
setRotations(targetBiped.bipedLeftLeg, armourBiped.bipedLeftLeg);
setRotations(targetBiped.bipedRightLeg, armourBiped.bipedRightLeg);
armourBiped.bipedLeftLeg.showModel = true;
armourBiped.bipedRightLeg.showModel = true;
armourBiped.bipedLeftLeg.render(scale);
armourBiped.bipedRightLeg.render(scale);
resetRotations(armourBiped.bipedLeftLeg);
resetRotations(armourBiped.bipedRightLeg);
} else {
try {
armourBiped.render(fakePlayer, 0, 0, 0, 0, 0, scale);
} catch (Exception e) {
// ModLogger.log(e);
}
}
}
}
}
use of net.minecraft.client.model.ModelBiped in project Armourers-Workshop by RiskyKen.
the class RenderBlockMannequinItems method renderLegsStack.
public void renderLegsStack(MannequinFakePlayer fakePlayer, ItemStack stack, ModelBiped targetBiped, RenderManager rm, byte[] extraColours, double distance) {
Item targetItem = stack.getItem();
if (SkinNBTHelper.stackHasSkinData(stack)) {
SkinModelRenderer.INSTANCE.renderEquipmentPartFromStack(stack, targetBiped, extraColours, distance, true);
return;
}
if (targetItem instanceof ItemArmor) {
int passes = targetItem.getRenderPasses(stack.getItemDamage());
for (int i = 0; i < passes; i++) {
ModelBiped armourBiped = ForgeHooksClient.getArmorModel(fakePlayer, stack, 2, renderPlayer.modelArmor);
if (i == 0) {
bindTexture(RenderBiped.getArmorResource(fakePlayer, stack, 2, null));
} else {
bindTexture(RenderBiped.getArmorResource(fakePlayer, stack, 2, "overlay"));
}
Color c = new Color(targetItem.getColorFromItemStack(stack, i));
GL11.glColor3f((float) c.getRed() / 255, (float) c.getGreen() / 255, (float) c.getBlue() / 255);
armourBiped.isChild = false;
if (armourBiped == renderPlayer.modelArmor) {
setRotations(targetBiped.bipedLeftLeg, armourBiped.bipedLeftLeg);
setRotations(targetBiped.bipedRightLeg, armourBiped.bipedRightLeg);
armourBiped.bipedBody.showModel = true;
armourBiped.bipedLeftLeg.showModel = true;
armourBiped.bipedRightLeg.showModel = true;
armourBiped.bipedBody.render(scale);
armourBiped.bipedLeftLeg.render(scale);
armourBiped.bipedRightLeg.render(scale);
resetRotations(armourBiped.bipedLeftLeg);
resetRotations(armourBiped.bipedRightLeg);
} else {
try {
armourBiped.render(fakePlayer, 0, 0, 0, 0, 0, scale);
} catch (Exception e) {
// ModLogger.log(e);
}
}
}
}
}
use of net.minecraft.client.model.ModelBiped 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;
}
use of net.minecraft.client.model.ModelBiped in project ImmersiveEngineering by BluSunrize.
the class IEBipedLayerRenderer method renderPowerpack.
private void renderPowerpack(ItemStack powerpack, EntityLivingBase living, float limbSwing, float prevLimbSwing, float partialTicks, float rotation, float yaw, float pitch, float scale) {
if (!powerpack.isEmpty()) {
GlStateManager.pushMatrix();
ModelBiped model = IEContent.itemPowerpack.getArmorModel(living, powerpack, EntityEquipmentSlot.CHEST, null);
ClientUtils.bindTexture(IEContent.itemPowerpack.getArmorTexture(powerpack, living, EntityEquipmentSlot.CHEST, null));
model.render(living, limbSwing, prevLimbSwing, rotation, yaw, pitch, scale);
GlStateManager.popMatrix();
}
}
Aggregations