Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.minecraft.client.venixpll.wings;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.entity.AbstractClientPlayer;
- import net.minecraft.client.model.ModelBiped;
- import net.minecraft.client.renderer.GlStateManager;
- import net.minecraft.client.renderer.Tessellator;
- import net.minecraft.client.renderer.WorldRenderer;
- import net.minecraft.client.venixpll.FakeBP;
- import net.minecraft.client.venixpll.wings.types.WingHyper;
- import net.minecraft.client.venixpll.wings.types.WingRedbull;
- import net.minecraft.client.venixpll.wings.types.WingShark;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.util.MathHelper;
- import org.lwjgl.opengl.GL11;
- public class ModelWings
- extends ModelBiped
- {
- private WingRedbull redbull = new WingRedbull();
- private WingShark shark = new WingShark();
- private WingHyper hyper = new WingHyper();
- public ModelWings(float p_i46304_1_, boolean p_i46304_2_)
- {
- super(p_i46304_1_, 0.0F, 64, 64);
- }
- public ModelWings(float p_i46304_1_, float f, int i, int j)
- {
- this(p_i46304_1_, false);
- }
- public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale)
- {
- super.render(entityIn, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale);
- Minecraft.getMinecraft();
- if ((entityIn == Minecraft.thePlayer) && (FakeBP.showWings))
- {
- GlStateManager.pushMatrix();
- if (entityIn.isSneaking()) {
- GlStateManager.translate(0.0F, 0.2F, 0.0F);
- }
- Tessellator tessellator = Tessellator.getInstance();
- WorldRenderer worldrenderer = tessellator.getWorldRenderer();
- GL11.glTranslatef(0.0F, 0.22F, 0.0F);
- this.redbull.render(entityIn, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale);
- GlStateManager.popMatrix();
- }
- }
- public static float getFirstRotationX(AbstractClientPlayer clientPlayer, float partialTicks)
- {
- float f = interpolateRotation(clientPlayer.prevRenderYawOffset, clientPlayer.renderYawOffset, partialTicks);
- float f1 = interpolateRotation(clientPlayer.prevRotationYawHead, clientPlayer.rotationYawHead, partialTicks);
- float f2 = f1 - f;
- if ((clientPlayer.isRiding()) && ((clientPlayer.ridingEntity instanceof EntityLivingBase)))
- {
- EntityLivingBase entitylivingbase = (EntityLivingBase)clientPlayer.ridingEntity;
- f = interpolateRotation(entitylivingbase.prevRenderYawOffset, entitylivingbase.renderYawOffset, partialTicks);
- f2 = f1 - f;
- float f3 = MathHelper.wrapAngleTo180_float(f2);
- if (f3 < -85.0F) {
- f3 = -85.0F;
- }
- if (f3 >= 85.0F) {
- f3 = 85.0F;
- }
- f = f1 - f3;
- if (f3 * f3 > 2500.0F) {
- f1 = f + f3 * 0.2F;
- }
- }
- return f2;
- }
- public static float getSecondRotationX(AbstractClientPlayer clientPlayer, float partialTicks)
- {
- return clientPlayer.prevRotationPitch + (clientPlayer.rotationPitch - clientPlayer.prevRotationPitch) * partialTicks;
- }
- public static float interpolateRotation(float par1, float par2, float par3)
- {
- for (float f = par2 - par1; f < -180.0F; f += 360.0F) {
- while (f >= 180.0F) {
- f -= 360.0F;
- }
- }
- return par1 + par3 * f;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement