use of net.minecraft.client.model.ModelBiped in project ClaySoldiersMod by SanAndreasP.
the class SoldierModelRenderHandler method renderGoggleStripes.
private void renderGoggleStripes(RenderClayMan clayManRender, float partTicks) {
ModelBiped model = clayManRender.modelBipedMain;
this.glassStripes.rotateAngleX = model.bipedHead.rotateAngleX;
this.glassStripes.rotateAngleY = model.bipedHead.rotateAngleY;
this.glassStripes.rotateAngleZ = model.bipedHead.rotateAngleZ;
clayManRender.bindTexture(Textures.CLAYMAN_GOGGLES);
this.glassStripes.render(partTicks);
}
use of net.minecraft.client.model.ModelBiped in project Galacticraft by micdoodle8.
the class LayerThermalPadding method renderLayerGC.
private void renderLayerGC(EntityLivingBase entitylivingbaseIn, float f2, float f3, float partialTicks, float f5, float f6, float f7, float f8, int armorSlot) {
ItemStack itemstack = this.getCurrentArmor(entitylivingbaseIn, armorSlot);
if (itemstack != null) {
ModelBiped t = this.func_177175_a(armorSlot);
t.setModelAttributes(this.renderer.getMainModel());
t.setLivingAnimations(entitylivingbaseIn, f2, f3, partialTicks);
this.func_177179_a(t, armorSlot);
this.renderer.bindTexture(itemstack.getItem() instanceof ItemThermalPaddingTier2 ? RenderPlayerGC.thermalPaddingTexture1_T2 : RenderPlayerGC.thermalPaddingTexture1);
t.render(entitylivingbaseIn, f2, f3, f5, f6, f7, f8);
// Start alpha render
GlStateManager.disableLighting();
Minecraft.getMinecraft().renderEngine.bindTexture(RenderPlayerGC.thermalPaddingTexture0);
GlStateManager.enableAlpha();
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
float time = entitylivingbaseIn.ticksExisted / 10.0F;
float sTime = (float) Math.sin(time) * 0.5F + 0.5F;
float r = 0.2F * sTime;
float g = 1.0F * sTime;
float b = 0.2F * sTime;
if (entitylivingbaseIn.worldObj.provider instanceof IGalacticraftWorldProvider) {
float modifier = ((IGalacticraftWorldProvider) entitylivingbaseIn.worldObj.provider).getThermalLevelModifier();
if (modifier > 0) {
b = g;
g = r;
} else if (modifier < 0) {
r = g;
g = b;
}
}
GlStateManager.color(r, g, b, 0.4F * sTime);
t.render(entitylivingbaseIn, f2, f3, f5, f6, f7, f8);
GlStateManager.color(1, 1, 1, 1);
GlStateManager.disableBlend();
GlStateManager.enableAlpha();
GlStateManager.enableLighting();
}
}
use of net.minecraft.client.model.ModelBiped in project Armourers-Workshop by RiskyKen.
the class RenderBlockMannequinItems method renderChestStack.
public void renderChestStack(MannequinFakePlayer fakePlayer, ItemStack stack, ModelMannequin 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, 1, renderPlayer.modelArmorChestplate);
if (i == 0) {
bindTexture(RenderBiped.getArmorResource(fakePlayer, stack, 1, null));
} else {
bindTexture(RenderBiped.getArmorResource(fakePlayer, stack, 1, "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.bipedBody, armourBiped.bipedBody);
setRotations(targetBiped.bipedLeftArm, armourBiped.bipedLeftArm);
setRotations(targetBiped.bipedRightArm, armourBiped.bipedRightArm);
armourBiped.bipedBody.showModel = true;
armourBiped.bipedLeftArm.showModel = true;
armourBiped.bipedRightArm.showModel = true;
armourBiped.bipedBody.render(scale);
armourBiped.bipedLeftArm.render(scale);
armourBiped.bipedRightArm.render(scale);
resetRotations(targetBiped.bipedBody);
resetRotations(targetBiped.bipedLeftArm);
resetRotations(targetBiped.bipedRightArm);
armourBiped = ForgeHooksClient.getArmorModel(fakePlayer, stack, 1, renderPlayer.modelArmor);
setRotations(targetBiped.bipedBody, armourBiped.bipedBody);
armourBiped.bipedBody.showModel = true;
armourBiped.bipedBody.render(scale);
resetRotations(targetBiped.bipedBody);
} else {
try {
armourBiped.render(null, 0, 0, 0, 0, 0, scale);
} catch (Exception e) {
// ModLogger.log(e);
}
}
}
}
}
use of net.minecraft.client.model.ModelBiped in project ArsMagica2 by Mithion.
the class AMClientEventHandler method onPlayerRender.
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onPlayerRender(RenderPlayerEvent.Pre event) {
ItemStack chestPlate = event.entityPlayer.inventory.armorInventory[2];
ModelBiped mainModel = ReflectionHelper.getPrivateValue(RenderPlayer.class, event.renderer, "field_77109_a", "modelBipedMain");
boolean holdingItem = false;
if (event.entityPlayer.getCurrentEquippedItem() != null)
holdingItem = true;
if (!AMCore.proxy.playerTracker.hasCLS(event.entityPlayer.getUniqueID().toString())) {
if (chestPlate != null && chestPlate.getItem() == ItemsCommonProxy.earthGuardianArmor) {
if (mainModel != null) {
mainModel.bipedLeftArm.isHidden = true;
mainModel.bipedRightArm.isHidden = !holdingItem;
}
} else {
if (mainModel != null) {
mainModel.bipedLeftArm.isHidden = false;
mainModel.bipedRightArm.isHidden = false;
}
}
}
double dX = AMCore.proxy.getLocalPlayer().posX - event.entityPlayer.posX;
double dY = AMCore.proxy.getLocalPlayer().posY - event.entityPlayer.posY;
double dZ = AMCore.proxy.getLocalPlayer().posZ - event.entityPlayer.posZ;
double dpX = AMCore.proxy.getLocalPlayer().prevPosX - event.entityPlayer.prevPosX;
double dpY = AMCore.proxy.getLocalPlayer().prevPosY - event.entityPlayer.prevPosY;
double dpZ = AMCore.proxy.getLocalPlayer().prevPosZ - event.entityPlayer.prevPosZ;
double transX = dpX + (dX - dpX) * event.partialRenderTick;
double transY = dpY + (dY - dpY) * event.partialRenderTick;
double transZ = dpZ + (dZ - dpZ) * event.partialRenderTick;
if (ExtendedProperties.For(event.entityPlayer).getFlipRotation() > 0) {
GL11.glPushMatrix();
GL11.glTranslated(-transX, -transY, -transZ);
GL11.glRotatef(ExtendedProperties.For(event.entityPlayer).getFlipRotation(), 0, 0, 1.0f);
GL11.glTranslated(transX, transY, transZ);
float offset = event.entityPlayer.height * (ExtendedProperties.For(event.entityPlayer).getFlipRotation() / 180.0f);
GL11.glTranslatef(0, -offset, 0);
}
float shrink = ExtendedProperties.For(event.entityPlayer).getShrinkPct();
if (shrink > 0) {
GL11.glPushMatrix();
GL11.glTranslatef(0, 0 - 0.5f * shrink, 0);
GL11.glScalef(1 - 0.5f * shrink, 1 - 0.5f * shrink, 1 - 0.5f * shrink);
}
}
use of net.minecraft.client.model.ModelBiped in project ArsMagica2 by Mithion.
the class AMClientEventHandler method onPlayerRender.
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onPlayerRender(RenderPlayerEvent.Post event) {
ModelBiped mainModel = ReflectionHelper.getPrivateValue(RenderPlayer.class, event.renderer, "field_77109_a", "modelBipedMain");
if (mainModel != null) {
mainModel.bipedLeftArm.isHidden = false;
mainModel.bipedRightArm.isHidden = false;
}
if (ExtendedProperties.For(event.entityPlayer).getFlipRotation() > 0) {
GL11.glPopMatrix();
}
if (ExtendedProperties.For(event.entityPlayer).getShrinkPct() > 0) {
GL11.glPopMatrix();
}
CloakUtils.renderCloakModel(event.entityPlayer, mainModel, event.partialRenderTick);
if (event.entityPlayer == AMCore.proxy.getLocalPlayer()) {
if (AMCore.proxy.getLocalPlayer().isPotionActive(BuffList.trueSight.id)) {
if (AMGuiHelper.instance.playerRunesAlpha < 1)
AMGuiHelper.instance.playerRunesAlpha += 0.01f;
} else {
if (AMGuiHelper.instance.playerRunesAlpha > 0)
AMGuiHelper.instance.playerRunesAlpha -= 0.01f;
}
if (AMGuiHelper.instance.playerRunesAlpha > 0) {
int runeCombo = EntityUtilities.getRuneCombo(event.entityPlayer);
int numRunes = 0;
for (int i = 0; i <= 16; ++i) {
int bit = 1 << i;
if ((runeCombo & bit) == bit) {
numRunes++;
}
}
double step = 0.25f;
double xOffset = -(numRunes / 2.0f) * step + ((numRunes % 2 == 0) ? step / 2f : 0);
for (int i = 0; i <= 16; ++i) {
int bit = 1 << i;
if ((runeCombo & bit) == bit) {
RenderUtilities.DrawIconInWorldAtOffset(ItemsCommonProxy.rune.getIconFromDamage(i), xOffset, 0.5f, 0, 0.25f, 0.25f);
xOffset += step;
}
}
}
}
}
Aggregations