base mod created

This commit is contained in:
Mohammad-Ali Minaie
2018-10-08 09:07:47 -04:00
parent 0a7700c356
commit b86dedad2f
7848 changed files with 584664 additions and 1 deletions

View File

@@ -0,0 +1,11 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public interface IMultipassModel
{
void renderMultipass(Entity p_187054_1_, float p_187054_2_, float p_187054_3_, float p_187054_4_, float p_187054_5_, float p_187054_6_, float scale);
}

View File

@@ -0,0 +1,136 @@
package net.minecraft.client.model;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityArmorStand;
import net.minecraft.util.EnumHandSide;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelArmorStand extends ModelArmorStandArmor
{
public ModelRenderer standRightSide;
public ModelRenderer standLeftSide;
public ModelRenderer standWaist;
public ModelRenderer standBase;
public ModelArmorStand()
{
this(0.0F);
}
public ModelArmorStand(float modelSize)
{
super(modelSize, 64, 64);
this.bipedHead = new ModelRenderer(this, 0, 0);
this.bipedHead.addBox(-1.0F, -7.0F, -1.0F, 2, 7, 2, modelSize);
this.bipedHead.setRotationPoint(0.0F, 0.0F, 0.0F);
this.bipedBody = new ModelRenderer(this, 0, 26);
this.bipedBody.addBox(-6.0F, 0.0F, -1.5F, 12, 3, 3, modelSize);
this.bipedBody.setRotationPoint(0.0F, 0.0F, 0.0F);
this.bipedRightArm = new ModelRenderer(this, 24, 0);
this.bipedRightArm.addBox(-2.0F, -2.0F, -1.0F, 2, 12, 2, modelSize);
this.bipedRightArm.setRotationPoint(-5.0F, 2.0F, 0.0F);
this.bipedLeftArm = new ModelRenderer(this, 32, 16);
this.bipedLeftArm.mirror = true;
this.bipedLeftArm.addBox(0.0F, -2.0F, -1.0F, 2, 12, 2, modelSize);
this.bipedLeftArm.setRotationPoint(5.0F, 2.0F, 0.0F);
this.bipedRightLeg = new ModelRenderer(this, 8, 0);
this.bipedRightLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 11, 2, modelSize);
this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F, 0.0F);
this.bipedLeftLeg = new ModelRenderer(this, 40, 16);
this.bipedLeftLeg.mirror = true;
this.bipedLeftLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 11, 2, modelSize);
this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F, 0.0F);
this.standRightSide = new ModelRenderer(this, 16, 0);
this.standRightSide.addBox(-3.0F, 3.0F, -1.0F, 2, 7, 2, modelSize);
this.standRightSide.setRotationPoint(0.0F, 0.0F, 0.0F);
this.standRightSide.showModel = true;
this.standLeftSide = new ModelRenderer(this, 48, 16);
this.standLeftSide.addBox(1.0F, 3.0F, -1.0F, 2, 7, 2, modelSize);
this.standLeftSide.setRotationPoint(0.0F, 0.0F, 0.0F);
this.standWaist = new ModelRenderer(this, 0, 48);
this.standWaist.addBox(-4.0F, 10.0F, -1.0F, 8, 2, 2, modelSize);
this.standWaist.setRotationPoint(0.0F, 0.0F, 0.0F);
this.standBase = new ModelRenderer(this, 0, 32);
this.standBase.addBox(-6.0F, 11.0F, -6.0F, 12, 1, 12, modelSize);
this.standBase.setRotationPoint(0.0F, 12.0F, 0.0F);
this.bipedHeadwear.showModel = false;
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
if (entityIn instanceof EntityArmorStand)
{
EntityArmorStand entityarmorstand = (EntityArmorStand)entityIn;
this.bipedLeftArm.showModel = entityarmorstand.getShowArms();
this.bipedRightArm.showModel = entityarmorstand.getShowArms();
this.standBase.showModel = !entityarmorstand.hasNoBasePlate();
this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F, 0.0F);
this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F, 0.0F);
this.standRightSide.rotateAngleX = 0.017453292F * entityarmorstand.getBodyRotation().getX();
this.standRightSide.rotateAngleY = 0.017453292F * entityarmorstand.getBodyRotation().getY();
this.standRightSide.rotateAngleZ = 0.017453292F * entityarmorstand.getBodyRotation().getZ();
this.standLeftSide.rotateAngleX = 0.017453292F * entityarmorstand.getBodyRotation().getX();
this.standLeftSide.rotateAngleY = 0.017453292F * entityarmorstand.getBodyRotation().getY();
this.standLeftSide.rotateAngleZ = 0.017453292F * entityarmorstand.getBodyRotation().getZ();
this.standWaist.rotateAngleX = 0.017453292F * entityarmorstand.getBodyRotation().getX();
this.standWaist.rotateAngleY = 0.017453292F * entityarmorstand.getBodyRotation().getY();
this.standWaist.rotateAngleZ = 0.017453292F * entityarmorstand.getBodyRotation().getZ();
this.standBase.rotateAngleX = 0.0F;
this.standBase.rotateAngleY = 0.017453292F * -entityIn.rotationYaw;
this.standBase.rotateAngleZ = 0.0F;
}
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
super.render(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
GlStateManager.pushMatrix();
if (this.isChild)
{
float f = 2.0F;
GlStateManager.scale(0.5F, 0.5F, 0.5F);
GlStateManager.translate(0.0F, 24.0F * scale, 0.0F);
this.standRightSide.render(scale);
this.standLeftSide.render(scale);
this.standWaist.render(scale);
this.standBase.render(scale);
}
else
{
if (entityIn.isSneaking())
{
GlStateManager.translate(0.0F, 0.2F, 0.0F);
}
this.standRightSide.render(scale);
this.standLeftSide.render(scale);
this.standWaist.render(scale);
this.standBase.render(scale);
}
GlStateManager.popMatrix();
}
public void postRenderArm(float scale, EnumHandSide side)
{
ModelRenderer modelrenderer = this.getArmForSide(side);
boolean flag = modelrenderer.showModel;
modelrenderer.showModel = true;
super.postRenderArm(scale, side);
modelrenderer.showModel = flag;
}
}

View File

@@ -0,0 +1,60 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityArmorStand;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelArmorStandArmor extends ModelBiped
{
public ModelArmorStandArmor()
{
this(0.0F);
}
public ModelArmorStandArmor(float modelSize)
{
this(modelSize, 64, 32);
}
protected ModelArmorStandArmor(float modelSize, int textureWidthIn, int textureHeightIn)
{
super(modelSize, 0.0F, textureWidthIn, textureHeightIn);
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
if (entityIn instanceof EntityArmorStand)
{
EntityArmorStand entityarmorstand = (EntityArmorStand)entityIn;
this.bipedHead.rotateAngleX = 0.017453292F * entityarmorstand.getHeadRotation().getX();
this.bipedHead.rotateAngleY = 0.017453292F * entityarmorstand.getHeadRotation().getY();
this.bipedHead.rotateAngleZ = 0.017453292F * entityarmorstand.getHeadRotation().getZ();
this.bipedHead.setRotationPoint(0.0F, 1.0F, 0.0F);
this.bipedBody.rotateAngleX = 0.017453292F * entityarmorstand.getBodyRotation().getX();
this.bipedBody.rotateAngleY = 0.017453292F * entityarmorstand.getBodyRotation().getY();
this.bipedBody.rotateAngleZ = 0.017453292F * entityarmorstand.getBodyRotation().getZ();
this.bipedLeftArm.rotateAngleX = 0.017453292F * entityarmorstand.getLeftArmRotation().getX();
this.bipedLeftArm.rotateAngleY = 0.017453292F * entityarmorstand.getLeftArmRotation().getY();
this.bipedLeftArm.rotateAngleZ = 0.017453292F * entityarmorstand.getLeftArmRotation().getZ();
this.bipedRightArm.rotateAngleX = 0.017453292F * entityarmorstand.getRightArmRotation().getX();
this.bipedRightArm.rotateAngleY = 0.017453292F * entityarmorstand.getRightArmRotation().getY();
this.bipedRightArm.rotateAngleZ = 0.017453292F * entityarmorstand.getRightArmRotation().getZ();
this.bipedLeftLeg.rotateAngleX = 0.017453292F * entityarmorstand.getLeftLegRotation().getX();
this.bipedLeftLeg.rotateAngleY = 0.017453292F * entityarmorstand.getLeftLegRotation().getY();
this.bipedLeftLeg.rotateAngleZ = 0.017453292F * entityarmorstand.getLeftLegRotation().getZ();
this.bipedLeftLeg.setRotationPoint(1.9F, 11.0F, 0.0F);
this.bipedRightLeg.rotateAngleX = 0.017453292F * entityarmorstand.getRightLegRotation().getX();
this.bipedRightLeg.rotateAngleY = 0.017453292F * entityarmorstand.getRightLegRotation().getY();
this.bipedRightLeg.rotateAngleZ = 0.017453292F * entityarmorstand.getRightLegRotation().getZ();
this.bipedRightLeg.setRotationPoint(-1.9F, 11.0F, 0.0F);
copyModelAngles(this.bipedHead, this.bipedHeadwear);
}
}
}

View File

@@ -0,0 +1,35 @@
package net.minecraft.client.model;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelBanner extends ModelBase
{
public ModelRenderer bannerSlate;
public ModelRenderer bannerStand;
public ModelRenderer bannerTop;
public ModelBanner()
{
this.textureWidth = 64;
this.textureHeight = 64;
this.bannerSlate = new ModelRenderer(this, 0, 0);
this.bannerSlate.addBox(-10.0F, 0.0F, -2.0F, 20, 40, 1, 0.0F);
this.bannerStand = new ModelRenderer(this, 44, 0);
this.bannerStand.addBox(-1.0F, -30.0F, -1.0F, 2, 42, 2, 0.0F);
this.bannerTop = new ModelRenderer(this, 0, 42);
this.bannerTop.addBox(-10.0F, -32.0F, -1.0F, 20, 2, 2, 0.0F);
}
/**
* Renders the banner model in.
*/
public void renderBanner()
{
this.bannerSlate.rotationPointY = -32.0F;
this.bannerSlate.render(0.0625F);
this.bannerStand.render(0.0625F);
this.bannerTop.render(0.0625F);
}
}

View File

@@ -0,0 +1,84 @@
package net.minecraft.client.model;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import java.util.List;
import java.util.Map;
import java.util.Random;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public abstract class ModelBase
{
public float swingProgress;
public boolean isRiding;
public boolean isChild = true;
/** This is a list of all the boxes (ModelRenderer.class) in the current model. */
public List<ModelRenderer> boxList = Lists.<ModelRenderer>newArrayList();
/** A mapping for all texture offsets */
private final Map<String, TextureOffset> modelTextureMap = Maps.<String, TextureOffset>newHashMap();
public int textureWidth = 64;
public int textureHeight = 32;
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
}
/**
* Used for easily adding entity-dependent animations. The second and third float params here are the same second
* and third as in the setRotationAngles method.
*/
public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTickTime)
{
}
public ModelRenderer getRandomModelBox(Random rand)
{
return this.boxList.get(rand.nextInt(this.boxList.size()));
}
protected void setTextureOffset(String partName, int x, int y)
{
this.modelTextureMap.put(partName, new TextureOffset(x, y));
}
public TextureOffset getTextureOffset(String partName)
{
return this.modelTextureMap.get(partName);
}
/**
* Copies the angles from one object to another. This is used when objects should stay aligned with each other, like
* the hair over a players head.
*/
public static void copyModelAngles(ModelRenderer source, ModelRenderer dest)
{
dest.rotateAngleX = source.rotateAngleX;
dest.rotateAngleY = source.rotateAngleY;
dest.rotateAngleZ = source.rotateAngleZ;
dest.rotationPointX = source.rotationPointX;
dest.rotationPointY = source.rotationPointY;
dest.rotationPointZ = source.rotationPointZ;
}
public void setModelAttributes(ModelBase model)
{
this.swingProgress = model.swingProgress;
this.isRiding = model.isRiding;
this.isChild = model.isChild;
}
}

View File

@@ -0,0 +1,107 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraft.entity.passive.EntityBat;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelBat extends ModelBase
{
private final ModelRenderer batHead;
/** The body box of the bat model. */
private final ModelRenderer batBody;
/** The inner right wing box of the bat model. */
private final ModelRenderer batRightWing;
/** The inner left wing box of the bat model. */
private final ModelRenderer batLeftWing;
/** The outer right wing box of the bat model. */
private final ModelRenderer batOuterRightWing;
/** The outer left wing box of the bat model. */
private final ModelRenderer batOuterLeftWing;
public ModelBat()
{
this.textureWidth = 64;
this.textureHeight = 64;
this.batHead = new ModelRenderer(this, 0, 0);
this.batHead.addBox(-3.0F, -3.0F, -3.0F, 6, 6, 6);
ModelRenderer modelrenderer = new ModelRenderer(this, 24, 0);
modelrenderer.addBox(-4.0F, -6.0F, -2.0F, 3, 4, 1);
this.batHead.addChild(modelrenderer);
ModelRenderer modelrenderer1 = new ModelRenderer(this, 24, 0);
modelrenderer1.mirror = true;
modelrenderer1.addBox(1.0F, -6.0F, -2.0F, 3, 4, 1);
this.batHead.addChild(modelrenderer1);
this.batBody = new ModelRenderer(this, 0, 16);
this.batBody.addBox(-3.0F, 4.0F, -3.0F, 6, 12, 6);
this.batBody.setTextureOffset(0, 34).addBox(-5.0F, 16.0F, 0.0F, 10, 6, 1);
this.batRightWing = new ModelRenderer(this, 42, 0);
this.batRightWing.addBox(-12.0F, 1.0F, 1.5F, 10, 16, 1);
this.batOuterRightWing = new ModelRenderer(this, 24, 16);
this.batOuterRightWing.setRotationPoint(-12.0F, 1.0F, 1.5F);
this.batOuterRightWing.addBox(-8.0F, 1.0F, 0.0F, 8, 12, 1);
this.batLeftWing = new ModelRenderer(this, 42, 0);
this.batLeftWing.mirror = true;
this.batLeftWing.addBox(2.0F, 1.0F, 1.5F, 10, 16, 1);
this.batOuterLeftWing = new ModelRenderer(this, 24, 16);
this.batOuterLeftWing.mirror = true;
this.batOuterLeftWing.setRotationPoint(12.0F, 1.0F, 1.5F);
this.batOuterLeftWing.addBox(0.0F, 1.0F, 0.0F, 8, 12, 1);
this.batBody.addChild(this.batRightWing);
this.batBody.addChild(this.batLeftWing);
this.batRightWing.addChild(this.batOuterRightWing);
this.batLeftWing.addChild(this.batOuterLeftWing);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
this.batHead.render(scale);
this.batBody.render(scale);
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
if (((EntityBat)entityIn).getIsBatHanging())
{
this.batHead.rotateAngleX = headPitch * 0.017453292F;
this.batHead.rotateAngleY = (float)Math.PI - netHeadYaw * 0.017453292F;
this.batHead.rotateAngleZ = (float)Math.PI;
this.batHead.setRotationPoint(0.0F, -2.0F, 0.0F);
this.batRightWing.setRotationPoint(-3.0F, 0.0F, 3.0F);
this.batLeftWing.setRotationPoint(3.0F, 0.0F, 3.0F);
this.batBody.rotateAngleX = (float)Math.PI;
this.batRightWing.rotateAngleX = -0.15707964F;
this.batRightWing.rotateAngleY = -((float)Math.PI * 2F / 5F);
this.batOuterRightWing.rotateAngleY = -1.7278761F;
this.batLeftWing.rotateAngleX = this.batRightWing.rotateAngleX;
this.batLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY;
this.batOuterLeftWing.rotateAngleY = -this.batOuterRightWing.rotateAngleY;
}
else
{
this.batHead.rotateAngleX = headPitch * 0.017453292F;
this.batHead.rotateAngleY = netHeadYaw * 0.017453292F;
this.batHead.rotateAngleZ = 0.0F;
this.batHead.setRotationPoint(0.0F, 0.0F, 0.0F);
this.batRightWing.setRotationPoint(0.0F, 0.0F, 0.0F);
this.batLeftWing.setRotationPoint(0.0F, 0.0F, 0.0F);
this.batBody.rotateAngleX = ((float)Math.PI / 4F) + MathHelper.cos(ageInTicks * 0.1F) * 0.15F;
this.batBody.rotateAngleY = 0.0F;
this.batRightWing.rotateAngleY = MathHelper.cos(ageInTicks * 1.3F) * (float)Math.PI * 0.25F;
this.batLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY;
this.batOuterRightWing.rotateAngleY = this.batRightWing.rotateAngleY * 0.5F;
this.batOuterLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY * 0.5F;
}
}
}

View File

@@ -0,0 +1,63 @@
package net.minecraft.client.model;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelBed extends ModelBase
{
public ModelRenderer headPiece;
public ModelRenderer footPiece;
public ModelRenderer[] legs = new ModelRenderer[4];
public ModelBed()
{
this.textureWidth = 64;
this.textureHeight = 64;
this.headPiece = new ModelRenderer(this, 0, 0);
this.headPiece.addBox(0.0F, 0.0F, 0.0F, 16, 16, 6, 0.0F);
this.footPiece = new ModelRenderer(this, 0, 22);
this.footPiece.addBox(0.0F, 0.0F, 0.0F, 16, 16, 6, 0.0F);
this.legs[0] = new ModelRenderer(this, 50, 0);
this.legs[1] = new ModelRenderer(this, 50, 6);
this.legs[2] = new ModelRenderer(this, 50, 12);
this.legs[3] = new ModelRenderer(this, 50, 18);
this.legs[0].addBox(0.0F, 6.0F, -16.0F, 3, 3, 3);
this.legs[1].addBox(0.0F, 6.0F, 0.0F, 3, 3, 3);
this.legs[2].addBox(-16.0F, 6.0F, -16.0F, 3, 3, 3);
this.legs[3].addBox(-16.0F, 6.0F, 0.0F, 3, 3, 3);
this.legs[0].rotateAngleX = ((float)Math.PI / 2F);
this.legs[1].rotateAngleX = ((float)Math.PI / 2F);
this.legs[2].rotateAngleX = ((float)Math.PI / 2F);
this.legs[3].rotateAngleX = ((float)Math.PI / 2F);
this.legs[0].rotateAngleZ = 0.0F;
this.legs[1].rotateAngleZ = ((float)Math.PI / 2F);
this.legs[2].rotateAngleZ = ((float)Math.PI * 3F / 2F);
this.legs[3].rotateAngleZ = (float)Math.PI;
}
public int getModelVersion()
{
return 51;
}
public void render()
{
this.headPiece.render(0.0625F);
this.footPiece.render(0.0625F);
this.legs[0].render(0.0625F);
this.legs[1].render(0.0625F);
this.legs[2].render(0.0625F);
this.legs[3].render(0.0625F);
}
public void preparePiece(boolean p_193769_1_)
{
this.headPiece.showModel = p_193769_1_;
this.footPiece.showModel = !p_193769_1_;
this.legs[0].showModel = !p_193769_1_;
this.legs[1].showModel = p_193769_1_;
this.legs[2].showModel = !p_193769_1_;
this.legs[3].showModel = p_193769_1_;
}
}

View File

@@ -0,0 +1,339 @@
package net.minecraft.client.model;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.EnumHand;
import net.minecraft.util.EnumHandSide;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelBiped extends ModelBase
{
public ModelRenderer bipedHead;
/** The Biped's Headwear. Used for the outer layer of player skins. */
public ModelRenderer bipedHeadwear;
public ModelRenderer bipedBody;
/** The Biped's Right Arm */
public ModelRenderer bipedRightArm;
/** The Biped's Left Arm */
public ModelRenderer bipedLeftArm;
/** The Biped's Right Leg */
public ModelRenderer bipedRightLeg;
/** The Biped's Left Leg */
public ModelRenderer bipedLeftLeg;
public ModelBiped.ArmPose leftArmPose;
public ModelBiped.ArmPose rightArmPose;
public boolean isSneak;
public ModelBiped()
{
this(0.0F);
}
public ModelBiped(float modelSize)
{
this(modelSize, 0.0F, 64, 32);
}
public ModelBiped(float modelSize, float p_i1149_2_, int textureWidthIn, int textureHeightIn)
{
this.leftArmPose = ModelBiped.ArmPose.EMPTY;
this.rightArmPose = ModelBiped.ArmPose.EMPTY;
this.textureWidth = textureWidthIn;
this.textureHeight = textureHeightIn;
this.bipedHead = new ModelRenderer(this, 0, 0);
this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, modelSize);
this.bipedHead.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F);
this.bipedHeadwear = new ModelRenderer(this, 32, 0);
this.bipedHeadwear.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, modelSize + 0.5F);
this.bipedHeadwear.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F);
this.bipedBody = new ModelRenderer(this, 16, 16);
this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, modelSize);
this.bipedBody.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F);
this.bipedRightArm = new ModelRenderer(this, 40, 16);
this.bipedRightArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, modelSize);
this.bipedRightArm.setRotationPoint(-5.0F, 2.0F + p_i1149_2_, 0.0F);
this.bipedLeftArm = new ModelRenderer(this, 40, 16);
this.bipedLeftArm.mirror = true;
this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, modelSize);
this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + p_i1149_2_, 0.0F);
this.bipedRightLeg = new ModelRenderer(this, 0, 16);
this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, modelSize);
this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F + p_i1149_2_, 0.0F);
this.bipedLeftLeg = new ModelRenderer(this, 0, 16);
this.bipedLeftLeg.mirror = true;
this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, modelSize);
this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F + p_i1149_2_, 0.0F);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
GlStateManager.pushMatrix();
if (this.isChild)
{
float f = 2.0F;
GlStateManager.scale(0.75F, 0.75F, 0.75F);
GlStateManager.translate(0.0F, 16.0F * scale, 0.0F);
this.bipedHead.render(scale);
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.scale(0.5F, 0.5F, 0.5F);
GlStateManager.translate(0.0F, 24.0F * scale, 0.0F);
this.bipedBody.render(scale);
this.bipedRightArm.render(scale);
this.bipedLeftArm.render(scale);
this.bipedRightLeg.render(scale);
this.bipedLeftLeg.render(scale);
this.bipedHeadwear.render(scale);
}
else
{
if (entityIn.isSneaking())
{
GlStateManager.translate(0.0F, 0.2F, 0.0F);
}
this.bipedHead.render(scale);
this.bipedBody.render(scale);
this.bipedRightArm.render(scale);
this.bipedLeftArm.render(scale);
this.bipedRightLeg.render(scale);
this.bipedLeftLeg.render(scale);
this.bipedHeadwear.render(scale);
}
GlStateManager.popMatrix();
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
@SuppressWarnings("incomplete-switch")
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
boolean flag = entityIn instanceof EntityLivingBase && ((EntityLivingBase)entityIn).getTicksElytraFlying() > 4;
this.bipedHead.rotateAngleY = netHeadYaw * 0.017453292F;
if (flag)
{
this.bipedHead.rotateAngleX = -((float)Math.PI / 4F);
}
else
{
this.bipedHead.rotateAngleX = headPitch * 0.017453292F;
}
this.bipedBody.rotateAngleY = 0.0F;
this.bipedRightArm.rotationPointZ = 0.0F;
this.bipedRightArm.rotationPointX = -5.0F;
this.bipedLeftArm.rotationPointZ = 0.0F;
this.bipedLeftArm.rotationPointX = 5.0F;
float f = 1.0F;
if (flag)
{
f = (float)(entityIn.motionX * entityIn.motionX + entityIn.motionY * entityIn.motionY + entityIn.motionZ * entityIn.motionZ);
f = f / 0.2F;
f = f * f * f;
}
if (f < 1.0F)
{
f = 1.0F;
}
this.bipedRightArm.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 2.0F * limbSwingAmount * 0.5F / f;
this.bipedLeftArm.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 2.0F * limbSwingAmount * 0.5F / f;
this.bipedRightArm.rotateAngleZ = 0.0F;
this.bipedLeftArm.rotateAngleZ = 0.0F;
this.bipedRightLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount / f;
this.bipedLeftLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.4F * limbSwingAmount / f;
this.bipedRightLeg.rotateAngleY = 0.0F;
this.bipedLeftLeg.rotateAngleY = 0.0F;
this.bipedRightLeg.rotateAngleZ = 0.0F;
this.bipedLeftLeg.rotateAngleZ = 0.0F;
if (this.isRiding)
{
this.bipedRightArm.rotateAngleX += -((float)Math.PI / 5F);
this.bipedLeftArm.rotateAngleX += -((float)Math.PI / 5F);
this.bipedRightLeg.rotateAngleX = -1.4137167F;
this.bipedRightLeg.rotateAngleY = ((float)Math.PI / 10F);
this.bipedRightLeg.rotateAngleZ = 0.07853982F;
this.bipedLeftLeg.rotateAngleX = -1.4137167F;
this.bipedLeftLeg.rotateAngleY = -((float)Math.PI / 10F);
this.bipedLeftLeg.rotateAngleZ = -0.07853982F;
}
this.bipedRightArm.rotateAngleY = 0.0F;
this.bipedRightArm.rotateAngleZ = 0.0F;
switch (this.leftArmPose)
{
case EMPTY:
this.bipedLeftArm.rotateAngleY = 0.0F;
break;
case BLOCK:
this.bipedLeftArm.rotateAngleX = this.bipedLeftArm.rotateAngleX * 0.5F - 0.9424779F;
this.bipedLeftArm.rotateAngleY = 0.5235988F;
break;
case ITEM:
this.bipedLeftArm.rotateAngleX = this.bipedLeftArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F);
this.bipedLeftArm.rotateAngleY = 0.0F;
}
switch (this.rightArmPose)
{
case EMPTY:
this.bipedRightArm.rotateAngleY = 0.0F;
break;
case BLOCK:
this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - 0.9424779F;
this.bipedRightArm.rotateAngleY = -0.5235988F;
break;
case ITEM:
this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F);
this.bipedRightArm.rotateAngleY = 0.0F;
}
if (this.swingProgress > 0.0F)
{
EnumHandSide enumhandside = this.getMainHand(entityIn);
ModelRenderer modelrenderer = this.getArmForSide(enumhandside);
float f1 = this.swingProgress;
this.bipedBody.rotateAngleY = MathHelper.sin(MathHelper.sqrt(f1) * ((float)Math.PI * 2F)) * 0.2F;
if (enumhandside == EnumHandSide.LEFT)
{
this.bipedBody.rotateAngleY *= -1.0F;
}
this.bipedRightArm.rotationPointZ = MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F;
this.bipedRightArm.rotationPointX = -MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F;
this.bipedLeftArm.rotationPointZ = -MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F;
this.bipedLeftArm.rotationPointX = MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F;
this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY;
this.bipedLeftArm.rotateAngleY += this.bipedBody.rotateAngleY;
this.bipedLeftArm.rotateAngleX += this.bipedBody.rotateAngleY;
f1 = 1.0F - this.swingProgress;
f1 = f1 * f1;
f1 = f1 * f1;
f1 = 1.0F - f1;
float f2 = MathHelper.sin(f1 * (float)Math.PI);
float f3 = MathHelper.sin(this.swingProgress * (float)Math.PI) * -(this.bipedHead.rotateAngleX - 0.7F) * 0.75F;
modelrenderer.rotateAngleX = (float)((double)modelrenderer.rotateAngleX - ((double)f2 * 1.2D + (double)f3));
modelrenderer.rotateAngleY += this.bipedBody.rotateAngleY * 2.0F;
modelrenderer.rotateAngleZ += MathHelper.sin(this.swingProgress * (float)Math.PI) * -0.4F;
}
if (this.isSneak)
{
this.bipedBody.rotateAngleX = 0.5F;
this.bipedRightArm.rotateAngleX += 0.4F;
this.bipedLeftArm.rotateAngleX += 0.4F;
this.bipedRightLeg.rotationPointZ = 4.0F;
this.bipedLeftLeg.rotationPointZ = 4.0F;
this.bipedRightLeg.rotationPointY = 9.0F;
this.bipedLeftLeg.rotationPointY = 9.0F;
this.bipedHead.rotationPointY = 1.0F;
}
else
{
this.bipedBody.rotateAngleX = 0.0F;
this.bipedRightLeg.rotationPointZ = 0.1F;
this.bipedLeftLeg.rotationPointZ = 0.1F;
this.bipedRightLeg.rotationPointY = 12.0F;
this.bipedLeftLeg.rotationPointY = 12.0F;
this.bipedHead.rotationPointY = 0.0F;
}
this.bipedRightArm.rotateAngleZ += MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
this.bipedRightArm.rotateAngleX += MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
this.bipedLeftArm.rotateAngleX -= MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
if (this.rightArmPose == ModelBiped.ArmPose.BOW_AND_ARROW)
{
this.bipedRightArm.rotateAngleY = -0.1F + this.bipedHead.rotateAngleY;
this.bipedLeftArm.rotateAngleY = 0.1F + this.bipedHead.rotateAngleY + 0.4F;
this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F) + this.bipedHead.rotateAngleX;
this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F) + this.bipedHead.rotateAngleX;
}
else if (this.leftArmPose == ModelBiped.ArmPose.BOW_AND_ARROW)
{
this.bipedRightArm.rotateAngleY = -0.1F + this.bipedHead.rotateAngleY - 0.4F;
this.bipedLeftArm.rotateAngleY = 0.1F + this.bipedHead.rotateAngleY;
this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F) + this.bipedHead.rotateAngleX;
this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F) + this.bipedHead.rotateAngleX;
}
copyModelAngles(this.bipedHead, this.bipedHeadwear);
}
public void setModelAttributes(ModelBase model)
{
super.setModelAttributes(model);
if (model instanceof ModelBiped)
{
ModelBiped modelbiped = (ModelBiped)model;
this.leftArmPose = modelbiped.leftArmPose;
this.rightArmPose = modelbiped.rightArmPose;
this.isSneak = modelbiped.isSneak;
}
}
public void setVisible(boolean visible)
{
this.bipedHead.showModel = visible;
this.bipedHeadwear.showModel = visible;
this.bipedBody.showModel = visible;
this.bipedRightArm.showModel = visible;
this.bipedLeftArm.showModel = visible;
this.bipedRightLeg.showModel = visible;
this.bipedLeftLeg.showModel = visible;
}
public void postRenderArm(float scale, EnumHandSide side)
{
this.getArmForSide(side).postRender(scale);
}
protected ModelRenderer getArmForSide(EnumHandSide side)
{
return side == EnumHandSide.LEFT ? this.bipedLeftArm : this.bipedRightArm;
}
protected EnumHandSide getMainHand(Entity entityIn)
{
if (entityIn instanceof EntityLivingBase)
{
EntityLivingBase entitylivingbase = (EntityLivingBase)entityIn;
EnumHandSide enumhandside = entitylivingbase.getPrimaryHand();
return entitylivingbase.swingingHand == EnumHand.MAIN_HAND ? enumhandside : enumhandside.opposite();
}
else
{
return EnumHandSide.RIGHT;
}
}
@SideOnly(Side.CLIENT)
public static enum ArmPose
{
EMPTY,
ITEM,
BLOCK,
BOW_AND_ARROW;
}
}

View File

@@ -0,0 +1,81 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelBlaze extends ModelBase
{
/** The sticks that fly around the Blaze. */
private final ModelRenderer[] blazeSticks = new ModelRenderer[12];
private final ModelRenderer blazeHead;
public ModelBlaze()
{
for (int i = 0; i < this.blazeSticks.length; ++i)
{
this.blazeSticks[i] = new ModelRenderer(this, 0, 16);
this.blazeSticks[i].addBox(0.0F, 0.0F, 0.0F, 2, 8, 2);
}
this.blazeHead = new ModelRenderer(this, 0, 0);
this.blazeHead.addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
this.blazeHead.render(scale);
for (ModelRenderer modelrenderer : this.blazeSticks)
{
modelrenderer.render(scale);
}
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
float f = ageInTicks * (float)Math.PI * -0.1F;
for (int i = 0; i < 4; ++i)
{
this.blazeSticks[i].rotationPointY = -2.0F + MathHelper.cos(((float)(i * 2) + ageInTicks) * 0.25F);
this.blazeSticks[i].rotationPointX = MathHelper.cos(f) * 9.0F;
this.blazeSticks[i].rotationPointZ = MathHelper.sin(f) * 9.0F;
++f;
}
f = ((float)Math.PI / 4F) + ageInTicks * (float)Math.PI * 0.03F;
for (int j = 4; j < 8; ++j)
{
this.blazeSticks[j].rotationPointY = 2.0F + MathHelper.cos(((float)(j * 2) + ageInTicks) * 0.25F);
this.blazeSticks[j].rotationPointX = MathHelper.cos(f) * 7.0F;
this.blazeSticks[j].rotationPointZ = MathHelper.sin(f) * 7.0F;
++f;
}
f = 0.47123894F + ageInTicks * (float)Math.PI * -0.05F;
for (int k = 8; k < 12; ++k)
{
this.blazeSticks[k].rotationPointY = 11.0F + MathHelper.cos(((float)k * 1.5F + ageInTicks) * 0.5F);
this.blazeSticks[k].rotationPointX = MathHelper.cos(f) * 5.0F;
this.blazeSticks[k].rotationPointZ = MathHelper.sin(f) * 5.0F;
++f;
}
this.blazeHead.rotateAngleY = netHeadYaw * 0.017453292F;
this.blazeHead.rotateAngleX = headPitch * 0.017453292F;
}
}

View File

@@ -0,0 +1,116 @@
package net.minecraft.client.model;
import net.minecraft.client.renderer.GLAllocation;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityBoat;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelBoat extends ModelBase implements IMultipassModel
{
public ModelRenderer[] boatSides = new ModelRenderer[5];
public ModelRenderer[] paddles = new ModelRenderer[2];
/**
* An invisible layer that is rendered to make it seem like there's no water in the boat.
*
* @see https://redd.it/3qufgo
* @see https://bugs.mojang.com/browse/MC-47636
*/
public ModelRenderer noWater;
private final int patchList = GLAllocation.generateDisplayLists(1);
public ModelBoat()
{
this.boatSides[0] = (new ModelRenderer(this, 0, 0)).setTextureSize(128, 64);
this.boatSides[1] = (new ModelRenderer(this, 0, 19)).setTextureSize(128, 64);
this.boatSides[2] = (new ModelRenderer(this, 0, 27)).setTextureSize(128, 64);
this.boatSides[3] = (new ModelRenderer(this, 0, 35)).setTextureSize(128, 64);
this.boatSides[4] = (new ModelRenderer(this, 0, 43)).setTextureSize(128, 64);
int i = 32;
int j = 6;
int k = 20;
int l = 4;
int i1 = 28;
this.boatSides[0].addBox(-14.0F, -9.0F, -3.0F, 28, 16, 3, 0.0F);
this.boatSides[0].setRotationPoint(0.0F, 3.0F, 1.0F);
this.boatSides[1].addBox(-13.0F, -7.0F, -1.0F, 18, 6, 2, 0.0F);
this.boatSides[1].setRotationPoint(-15.0F, 4.0F, 4.0F);
this.boatSides[2].addBox(-8.0F, -7.0F, -1.0F, 16, 6, 2, 0.0F);
this.boatSides[2].setRotationPoint(15.0F, 4.0F, 0.0F);
this.boatSides[3].addBox(-14.0F, -7.0F, -1.0F, 28, 6, 2, 0.0F);
this.boatSides[3].setRotationPoint(0.0F, 4.0F, -9.0F);
this.boatSides[4].addBox(-14.0F, -7.0F, -1.0F, 28, 6, 2, 0.0F);
this.boatSides[4].setRotationPoint(0.0F, 4.0F, 9.0F);
this.boatSides[0].rotateAngleX = ((float)Math.PI / 2F);
this.boatSides[1].rotateAngleY = ((float)Math.PI * 3F / 2F);
this.boatSides[2].rotateAngleY = ((float)Math.PI / 2F);
this.boatSides[3].rotateAngleY = (float)Math.PI;
this.paddles[0] = this.makePaddle(true);
this.paddles[0].setRotationPoint(3.0F, -5.0F, 9.0F);
this.paddles[1] = this.makePaddle(false);
this.paddles[1].setRotationPoint(3.0F, -5.0F, -9.0F);
this.paddles[1].rotateAngleY = (float)Math.PI;
this.paddles[0].rotateAngleZ = 0.19634955F;
this.paddles[1].rotateAngleZ = 0.19634955F;
this.noWater = (new ModelRenderer(this, 0, 0)).setTextureSize(128, 64);
this.noWater.addBox(-14.0F, -9.0F, -3.0F, 28, 16, 3, 0.0F);
this.noWater.setRotationPoint(0.0F, -3.0F, 1.0F);
this.noWater.rotateAngleX = ((float)Math.PI / 2F);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F);
EntityBoat entityboat = (EntityBoat)entityIn;
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
for (int i = 0; i < 5; ++i)
{
this.boatSides[i].render(scale);
}
this.renderPaddle(entityboat, 0, scale, limbSwing);
this.renderPaddle(entityboat, 1, scale, limbSwing);
}
public void renderMultipass(Entity p_187054_1_, float p_187054_2_, float p_187054_3_, float p_187054_4_, float p_187054_5_, float p_187054_6_, float scale)
{
GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.colorMask(false, false, false, false);
this.noWater.render(scale);
GlStateManager.colorMask(true, true, true, true);
}
protected ModelRenderer makePaddle(boolean p_187056_1_)
{
ModelRenderer modelrenderer = (new ModelRenderer(this, 62, p_187056_1_ ? 0 : 20)).setTextureSize(128, 64);
int i = 20;
int j = 7;
int k = 6;
float f = -5.0F;
modelrenderer.addBox(-1.0F, 0.0F, -5.0F, 2, 2, 18);
modelrenderer.addBox(p_187056_1_ ? -1.001F : 0.001F, -3.0F, 8.0F, 1, 6, 7);
return modelrenderer;
}
protected void renderPaddle(EntityBoat boat, int paddle, float scale, float limbSwing)
{
float f = boat.getRowingTime(paddle, limbSwing);
ModelRenderer modelrenderer = this.paddles[paddle];
modelrenderer.rotateAngleX = (float)MathHelper.clampedLerp(-1.0471975803375244D, -0.2617993950843811D, (double)((MathHelper.sin(-f) + 1.0F) / 2.0F));
modelrenderer.rotateAngleY = (float)MathHelper.clampedLerp(-(Math.PI / 4D), (Math.PI / 4D), (double)((MathHelper.sin(-f + 1.0F) + 1.0F) / 2.0F));
if (paddle == 1)
{
modelrenderer.rotateAngleY = (float)Math.PI - modelrenderer.rotateAngleY;
}
modelrenderer.render(scale);
}
}

View File

@@ -0,0 +1,67 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelBook extends ModelBase
{
/** Right cover renderer (when facing the book) */
public ModelRenderer coverRight = (new ModelRenderer(this)).setTextureOffset(0, 0).addBox(-6.0F, -5.0F, 0.0F, 6, 10, 0);
/** Left cover renderer (when facing the book) */
public ModelRenderer coverLeft = (new ModelRenderer(this)).setTextureOffset(16, 0).addBox(0.0F, -5.0F, 0.0F, 6, 10, 0);
/** The right pages renderer (when facing the book) */
public ModelRenderer pagesRight = (new ModelRenderer(this)).setTextureOffset(0, 10).addBox(0.0F, -4.0F, -0.99F, 5, 8, 1);
/** The left pages renderer (when facing the book) */
public ModelRenderer pagesLeft = (new ModelRenderer(this)).setTextureOffset(12, 10).addBox(0.0F, -4.0F, -0.01F, 5, 8, 1);
/** Right cover renderer (when facing the book) */
public ModelRenderer flippingPageRight = (new ModelRenderer(this)).setTextureOffset(24, 10).addBox(0.0F, -4.0F, 0.0F, 5, 8, 0);
/** Right cover renderer (when facing the book) */
public ModelRenderer flippingPageLeft = (new ModelRenderer(this)).setTextureOffset(24, 10).addBox(0.0F, -4.0F, 0.0F, 5, 8, 0);
/** The renderer of spine of the book */
public ModelRenderer bookSpine = (new ModelRenderer(this)).setTextureOffset(12, 0).addBox(-1.0F, -5.0F, 0.0F, 2, 10, 0);
public ModelBook()
{
this.coverRight.setRotationPoint(0.0F, 0.0F, -1.0F);
this.coverLeft.setRotationPoint(0.0F, 0.0F, 1.0F);
this.bookSpine.rotateAngleY = ((float)Math.PI / 2F);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
this.coverRight.render(scale);
this.coverLeft.render(scale);
this.bookSpine.render(scale);
this.pagesRight.render(scale);
this.pagesLeft.render(scale);
this.flippingPageRight.render(scale);
this.flippingPageLeft.render(scale);
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
float f = (MathHelper.sin(limbSwing * 0.02F) * 0.1F + 1.25F) * netHeadYaw;
this.coverRight.rotateAngleY = (float)Math.PI + f;
this.coverLeft.rotateAngleY = -f;
this.pagesRight.rotateAngleY = f;
this.pagesLeft.rotateAngleY = -f;
this.flippingPageRight.rotateAngleY = f - f * 2.0F * limbSwingAmount;
this.flippingPageLeft.rotateAngleY = f - f * 2.0F * ageInTicks;
this.pagesRight.rotationPointX = MathHelper.sin(f);
this.pagesLeft.rotationPointX = MathHelper.sin(f);
this.flippingPageRight.rotationPointX = MathHelper.sin(f);
this.flippingPageLeft.rotationPointX = MathHelper.sin(f);
}
}

View File

@@ -0,0 +1,105 @@
package net.minecraft.client.model;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class ModelBox
{
/** The (x,y,z) vertex positions and (u,v) texture coordinates for each of the 8 points on a cube */
private final PositionTextureVertex[] vertexPositions;
/** An array of 6 TexturedQuads, one for each face of a cube */
private final TexturedQuad[] quadList;
/** X vertex coordinate of lower box corner */
public final float posX1;
/** Y vertex coordinate of lower box corner */
public final float posY1;
/** Z vertex coordinate of lower box corner */
public final float posZ1;
/** X vertex coordinate of upper box corner */
public final float posX2;
/** Y vertex coordinate of upper box corner */
public final float posY2;
/** Z vertex coordinate of upper box corner */
public final float posZ2;
public String boxName;
public ModelBox(ModelRenderer renderer, int texU, int texV, float x, float y, float z, int dx, int dy, int dz, float delta)
{
this(renderer, texU, texV, x, y, z, dx, dy, dz, delta, renderer.mirror);
}
public ModelBox(ModelRenderer renderer, int texU, int texV, float x, float y, float z, int dx, int dy, int dz, float delta, boolean mirror)
{
this.posX1 = x;
this.posY1 = y;
this.posZ1 = z;
this.posX2 = x + (float)dx;
this.posY2 = y + (float)dy;
this.posZ2 = z + (float)dz;
this.vertexPositions = new PositionTextureVertex[8];
this.quadList = new TexturedQuad[6];
float f = x + (float)dx;
float f1 = y + (float)dy;
float f2 = z + (float)dz;
x = x - delta;
y = y - delta;
z = z - delta;
f = f + delta;
f1 = f1 + delta;
f2 = f2 + delta;
if (mirror)
{
float f3 = f;
f = x;
x = f3;
}
PositionTextureVertex positiontexturevertex7 = new PositionTextureVertex(x, y, z, 0.0F, 0.0F);
PositionTextureVertex positiontexturevertex = new PositionTextureVertex(f, y, z, 0.0F, 8.0F);
PositionTextureVertex positiontexturevertex1 = new PositionTextureVertex(f, f1, z, 8.0F, 8.0F);
PositionTextureVertex positiontexturevertex2 = new PositionTextureVertex(x, f1, z, 8.0F, 0.0F);
PositionTextureVertex positiontexturevertex3 = new PositionTextureVertex(x, y, f2, 0.0F, 0.0F);
PositionTextureVertex positiontexturevertex4 = new PositionTextureVertex(f, y, f2, 0.0F, 8.0F);
PositionTextureVertex positiontexturevertex5 = new PositionTextureVertex(f, f1, f2, 8.0F, 8.0F);
PositionTextureVertex positiontexturevertex6 = new PositionTextureVertex(x, f1, f2, 8.0F, 0.0F);
this.vertexPositions[0] = positiontexturevertex7;
this.vertexPositions[1] = positiontexturevertex;
this.vertexPositions[2] = positiontexturevertex1;
this.vertexPositions[3] = positiontexturevertex2;
this.vertexPositions[4] = positiontexturevertex3;
this.vertexPositions[5] = positiontexturevertex4;
this.vertexPositions[6] = positiontexturevertex5;
this.vertexPositions[7] = positiontexturevertex6;
this.quadList[0] = new TexturedQuad(new PositionTextureVertex[] {positiontexturevertex4, positiontexturevertex, positiontexturevertex1, positiontexturevertex5}, texU + dz + dx, texV + dz, texU + dz + dx + dz, texV + dz + dy, renderer.textureWidth, renderer.textureHeight);
this.quadList[1] = new TexturedQuad(new PositionTextureVertex[] {positiontexturevertex7, positiontexturevertex3, positiontexturevertex6, positiontexturevertex2}, texU, texV + dz, texU + dz, texV + dz + dy, renderer.textureWidth, renderer.textureHeight);
this.quadList[2] = new TexturedQuad(new PositionTextureVertex[] {positiontexturevertex4, positiontexturevertex3, positiontexturevertex7, positiontexturevertex}, texU + dz, texV, texU + dz + dx, texV + dz, renderer.textureWidth, renderer.textureHeight);
this.quadList[3] = new TexturedQuad(new PositionTextureVertex[] {positiontexturevertex1, positiontexturevertex2, positiontexturevertex6, positiontexturevertex5}, texU + dz + dx, texV + dz, texU + dz + dx + dx, texV, renderer.textureWidth, renderer.textureHeight);
this.quadList[4] = new TexturedQuad(new PositionTextureVertex[] {positiontexturevertex, positiontexturevertex7, positiontexturevertex2, positiontexturevertex1}, texU + dz, texV + dz, texU + dz + dx, texV + dz + dy, renderer.textureWidth, renderer.textureHeight);
this.quadList[5] = new TexturedQuad(new PositionTextureVertex[] {positiontexturevertex3, positiontexturevertex4, positiontexturevertex5, positiontexturevertex6}, texU + dz + dx + dz, texV + dz, texU + dz + dx + dz + dx, texV + dz + dy, renderer.textureWidth, renderer.textureHeight);
if (mirror)
{
for (TexturedQuad texturedquad : this.quadList)
{
texturedquad.flipFace();
}
}
}
@SideOnly(Side.CLIENT)
public void render(BufferBuilder renderer, float scale)
{
for (TexturedQuad texturedquad : this.quadList)
{
texturedquad.draw(renderer, scale);
}
}
public ModelBox setBoxName(String name)
{
this.boxName = name;
return this;
}
}

View File

@@ -0,0 +1,44 @@
package net.minecraft.client.model;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelChest extends ModelBase
{
/** The chest lid in the chest's model. */
public ModelRenderer chestLid = (new ModelRenderer(this, 0, 0)).setTextureSize(64, 64);
/** The model of the bottom of the chest. */
public ModelRenderer chestBelow;
/** The chest's knob in the chest model. */
public ModelRenderer chestKnob;
public ModelChest()
{
this.chestLid.addBox(0.0F, -5.0F, -14.0F, 14, 5, 14, 0.0F);
this.chestLid.rotationPointX = 1.0F;
this.chestLid.rotationPointY = 7.0F;
this.chestLid.rotationPointZ = 15.0F;
this.chestKnob = (new ModelRenderer(this, 0, 0)).setTextureSize(64, 64);
this.chestKnob.addBox(-1.0F, -2.0F, -15.0F, 2, 4, 1, 0.0F);
this.chestKnob.rotationPointX = 8.0F;
this.chestKnob.rotationPointY = 7.0F;
this.chestKnob.rotationPointZ = 15.0F;
this.chestBelow = (new ModelRenderer(this, 0, 19)).setTextureSize(64, 64);
this.chestBelow.addBox(0.0F, 0.0F, 0.0F, 14, 10, 14, 0.0F);
this.chestBelow.rotationPointX = 1.0F;
this.chestBelow.rotationPointY = 6.0F;
this.chestBelow.rotationPointZ = 1.0F;
}
/**
* This method renders out all parts of the chest model.
*/
public void renderAll()
{
this.chestKnob.rotateAngleX = this.chestLid.rotateAngleX;
this.chestLid.render(0.0625F);
this.chestKnob.render(0.0625F);
this.chestBelow.render(0.0625F);
}
}

View File

@@ -0,0 +1,108 @@
package net.minecraft.client.model;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelChicken extends ModelBase
{
public ModelRenderer head;
public ModelRenderer body;
public ModelRenderer rightLeg;
public ModelRenderer leftLeg;
public ModelRenderer rightWing;
public ModelRenderer leftWing;
public ModelRenderer bill;
public ModelRenderer chin;
public ModelChicken()
{
int i = 16;
this.head = new ModelRenderer(this, 0, 0);
this.head.addBox(-2.0F, -6.0F, -2.0F, 4, 6, 3, 0.0F);
this.head.setRotationPoint(0.0F, 15.0F, -4.0F);
this.bill = new ModelRenderer(this, 14, 0);
this.bill.addBox(-2.0F, -4.0F, -4.0F, 4, 2, 2, 0.0F);
this.bill.setRotationPoint(0.0F, 15.0F, -4.0F);
this.chin = new ModelRenderer(this, 14, 4);
this.chin.addBox(-1.0F, -2.0F, -3.0F, 2, 2, 2, 0.0F);
this.chin.setRotationPoint(0.0F, 15.0F, -4.0F);
this.body = new ModelRenderer(this, 0, 9);
this.body.addBox(-3.0F, -4.0F, -3.0F, 6, 8, 6, 0.0F);
this.body.setRotationPoint(0.0F, 16.0F, 0.0F);
this.rightLeg = new ModelRenderer(this, 26, 0);
this.rightLeg.addBox(-1.0F, 0.0F, -3.0F, 3, 5, 3);
this.rightLeg.setRotationPoint(-2.0F, 19.0F, 1.0F);
this.leftLeg = new ModelRenderer(this, 26, 0);
this.leftLeg.addBox(-1.0F, 0.0F, -3.0F, 3, 5, 3);
this.leftLeg.setRotationPoint(1.0F, 19.0F, 1.0F);
this.rightWing = new ModelRenderer(this, 24, 13);
this.rightWing.addBox(0.0F, 0.0F, -3.0F, 1, 4, 6);
this.rightWing.setRotationPoint(-4.0F, 13.0F, 0.0F);
this.leftWing = new ModelRenderer(this, 24, 13);
this.leftWing.addBox(-1.0F, 0.0F, -3.0F, 1, 4, 6);
this.leftWing.setRotationPoint(4.0F, 13.0F, 0.0F);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
if (this.isChild)
{
float f = 2.0F;
GlStateManager.pushMatrix();
GlStateManager.translate(0.0F, 5.0F * scale, 2.0F * scale);
this.head.render(scale);
this.bill.render(scale);
this.chin.render(scale);
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.scale(0.5F, 0.5F, 0.5F);
GlStateManager.translate(0.0F, 24.0F * scale, 0.0F);
this.body.render(scale);
this.rightLeg.render(scale);
this.leftLeg.render(scale);
this.rightWing.render(scale);
this.leftWing.render(scale);
GlStateManager.popMatrix();
}
else
{
this.head.render(scale);
this.bill.render(scale);
this.chin.render(scale);
this.body.render(scale);
this.rightLeg.render(scale);
this.leftLeg.render(scale);
this.rightWing.render(scale);
this.leftWing.render(scale);
}
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
this.head.rotateAngleX = headPitch * 0.017453292F;
this.head.rotateAngleY = netHeadYaw * 0.017453292F;
this.bill.rotateAngleX = this.head.rotateAngleX;
this.bill.rotateAngleY = this.head.rotateAngleY;
this.chin.rotateAngleX = this.head.rotateAngleX;
this.chin.rotateAngleY = this.head.rotateAngleY;
this.body.rotateAngleX = ((float)Math.PI / 2F);
this.rightLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount;
this.leftLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.4F * limbSwingAmount;
this.rightWing.rotateAngleZ = ageInTicks;
this.leftWing.rotateAngleZ = -ageInTicks;
}
}

View File

@@ -0,0 +1,31 @@
package net.minecraft.client.model;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelCow extends ModelQuadruped
{
public ModelCow()
{
super(12, 0.0F);
this.head = new ModelRenderer(this, 0, 0);
this.head.addBox(-4.0F, -4.0F, -6.0F, 8, 8, 6, 0.0F);
this.head.setRotationPoint(0.0F, 4.0F, -8.0F);
this.head.setTextureOffset(22, 0).addBox(-5.0F, -5.0F, -4.0F, 1, 3, 1, 0.0F);
this.head.setTextureOffset(22, 0).addBox(4.0F, -5.0F, -4.0F, 1, 3, 1, 0.0F);
this.body = new ModelRenderer(this, 18, 4);
this.body.addBox(-6.0F, -10.0F, -7.0F, 12, 18, 10, 0.0F);
this.body.setRotationPoint(0.0F, 5.0F, 2.0F);
this.body.setTextureOffset(52, 0).addBox(-2.0F, 2.0F, -8.0F, 4, 6, 1);
--this.leg1.rotationPointX;
++this.leg2.rotationPointX;
this.leg1.rotationPointZ += 0.0F;
this.leg2.rotationPointZ += 0.0F;
--this.leg3.rotationPointX;
++this.leg4.rotationPointX;
--this.leg3.rotationPointZ;
--this.leg4.rotationPointZ;
this.childZOffset += 2.0F;
}
}

View File

@@ -0,0 +1,78 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelCreeper extends ModelBase
{
public ModelRenderer head;
public ModelRenderer creeperArmor;
public ModelRenderer body;
public ModelRenderer leg1;
public ModelRenderer leg2;
public ModelRenderer leg3;
public ModelRenderer leg4;
public ModelCreeper()
{
this(0.0F);
}
public ModelCreeper(float p_i46366_1_)
{
int i = 6;
this.head = new ModelRenderer(this, 0, 0);
this.head.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, p_i46366_1_);
this.head.setRotationPoint(0.0F, 6.0F, 0.0F);
this.creeperArmor = new ModelRenderer(this, 32, 0);
this.creeperArmor.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, p_i46366_1_ + 0.5F);
this.creeperArmor.setRotationPoint(0.0F, 6.0F, 0.0F);
this.body = new ModelRenderer(this, 16, 16);
this.body.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, p_i46366_1_);
this.body.setRotationPoint(0.0F, 6.0F, 0.0F);
this.leg1 = new ModelRenderer(this, 0, 16);
this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, p_i46366_1_);
this.leg1.setRotationPoint(-2.0F, 18.0F, 4.0F);
this.leg2 = new ModelRenderer(this, 0, 16);
this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, p_i46366_1_);
this.leg2.setRotationPoint(2.0F, 18.0F, 4.0F);
this.leg3 = new ModelRenderer(this, 0, 16);
this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, p_i46366_1_);
this.leg3.setRotationPoint(-2.0F, 18.0F, -4.0F);
this.leg4 = new ModelRenderer(this, 0, 16);
this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, p_i46366_1_);
this.leg4.setRotationPoint(2.0F, 18.0F, -4.0F);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
this.head.render(scale);
this.body.render(scale);
this.leg1.render(scale);
this.leg2.render(scale);
this.leg3.render(scale);
this.leg4.render(scale);
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
this.head.rotateAngleY = netHeadYaw * 0.017453292F;
this.head.rotateAngleX = headPitch * 0.017453292F;
this.leg1.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount;
this.leg2.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.4F * limbSwingAmount;
this.leg3.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.4F * limbSwingAmount;
this.leg4.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount;
}
}

View File

@@ -0,0 +1,254 @@
package net.minecraft.client.model;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.boss.EntityDragon;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelDragon extends ModelBase
{
/** The head Model renderer of the dragon */
private final ModelRenderer head;
/** The spine Model renderer of the dragon */
private final ModelRenderer spine;
/** The jaw Model renderer of the dragon */
private final ModelRenderer jaw;
/** The body Model renderer of the dragon */
private final ModelRenderer body;
/** The rear leg Model renderer of the dragon */
private final ModelRenderer rearLeg;
/** The front leg Model renderer of the dragon */
private final ModelRenderer frontLeg;
/** The rear leg tip Model renderer of the dragon */
private final ModelRenderer rearLegTip;
/** The front leg tip Model renderer of the dragon */
private final ModelRenderer frontLegTip;
/** The rear foot Model renderer of the dragon */
private final ModelRenderer rearFoot;
/** The front foot Model renderer of the dragon */
private final ModelRenderer frontFoot;
/** The wing Model renderer of the dragon */
private final ModelRenderer wing;
/** The wing tip Model renderer of the dragon */
private final ModelRenderer wingTip;
private float partialTicks;
public ModelDragon(float p_i46360_1_)
{
this.textureWidth = 256;
this.textureHeight = 256;
this.setTextureOffset("body.body", 0, 0);
this.setTextureOffset("wing.skin", -56, 88);
this.setTextureOffset("wingtip.skin", -56, 144);
this.setTextureOffset("rearleg.main", 0, 0);
this.setTextureOffset("rearfoot.main", 112, 0);
this.setTextureOffset("rearlegtip.main", 196, 0);
this.setTextureOffset("head.upperhead", 112, 30);
this.setTextureOffset("wing.bone", 112, 88);
this.setTextureOffset("head.upperlip", 176, 44);
this.setTextureOffset("jaw.jaw", 176, 65);
this.setTextureOffset("frontleg.main", 112, 104);
this.setTextureOffset("wingtip.bone", 112, 136);
this.setTextureOffset("frontfoot.main", 144, 104);
this.setTextureOffset("neck.box", 192, 104);
this.setTextureOffset("frontlegtip.main", 226, 138);
this.setTextureOffset("body.scale", 220, 53);
this.setTextureOffset("head.scale", 0, 0);
this.setTextureOffset("neck.scale", 48, 0);
this.setTextureOffset("head.nostril", 112, 0);
float f = -16.0F;
this.head = new ModelRenderer(this, "head");
this.head.addBox("upperlip", -6.0F, -1.0F, -24.0F, 12, 5, 16);
this.head.addBox("upperhead", -8.0F, -8.0F, -10.0F, 16, 16, 16);
this.head.mirror = true;
this.head.addBox("scale", -5.0F, -12.0F, -4.0F, 2, 4, 6);
this.head.addBox("nostril", -5.0F, -3.0F, -22.0F, 2, 2, 4);
this.head.mirror = false;
this.head.addBox("scale", 3.0F, -12.0F, -4.0F, 2, 4, 6);
this.head.addBox("nostril", 3.0F, -3.0F, -22.0F, 2, 2, 4);
this.jaw = new ModelRenderer(this, "jaw");
this.jaw.setRotationPoint(0.0F, 4.0F, -8.0F);
this.jaw.addBox("jaw", -6.0F, 0.0F, -16.0F, 12, 4, 16);
this.head.addChild(this.jaw);
this.spine = new ModelRenderer(this, "neck");
this.spine.addBox("box", -5.0F, -5.0F, -5.0F, 10, 10, 10);
this.spine.addBox("scale", -1.0F, -9.0F, -3.0F, 2, 4, 6);
this.body = new ModelRenderer(this, "body");
this.body.setRotationPoint(0.0F, 4.0F, 8.0F);
this.body.addBox("body", -12.0F, 0.0F, -16.0F, 24, 24, 64);
this.body.addBox("scale", -1.0F, -6.0F, -10.0F, 2, 6, 12);
this.body.addBox("scale", -1.0F, -6.0F, 10.0F, 2, 6, 12);
this.body.addBox("scale", -1.0F, -6.0F, 30.0F, 2, 6, 12);
this.wing = new ModelRenderer(this, "wing");
this.wing.setRotationPoint(-12.0F, 5.0F, 2.0F);
this.wing.addBox("bone", -56.0F, -4.0F, -4.0F, 56, 8, 8);
this.wing.addBox("skin", -56.0F, 0.0F, 2.0F, 56, 0, 56);
this.wingTip = new ModelRenderer(this, "wingtip");
this.wingTip.setRotationPoint(-56.0F, 0.0F, 0.0F);
this.wingTip.addBox("bone", -56.0F, -2.0F, -2.0F, 56, 4, 4);
this.wingTip.addBox("skin", -56.0F, 0.0F, 2.0F, 56, 0, 56);
this.wing.addChild(this.wingTip);
this.frontLeg = new ModelRenderer(this, "frontleg");
this.frontLeg.setRotationPoint(-12.0F, 20.0F, 2.0F);
this.frontLeg.addBox("main", -4.0F, -4.0F, -4.0F, 8, 24, 8);
this.frontLegTip = new ModelRenderer(this, "frontlegtip");
this.frontLegTip.setRotationPoint(0.0F, 20.0F, -1.0F);
this.frontLegTip.addBox("main", -3.0F, -1.0F, -3.0F, 6, 24, 6);
this.frontLeg.addChild(this.frontLegTip);
this.frontFoot = new ModelRenderer(this, "frontfoot");
this.frontFoot.setRotationPoint(0.0F, 23.0F, 0.0F);
this.frontFoot.addBox("main", -4.0F, 0.0F, -12.0F, 8, 4, 16);
this.frontLegTip.addChild(this.frontFoot);
this.rearLeg = new ModelRenderer(this, "rearleg");
this.rearLeg.setRotationPoint(-16.0F, 16.0F, 42.0F);
this.rearLeg.addBox("main", -8.0F, -4.0F, -8.0F, 16, 32, 16);
this.rearLegTip = new ModelRenderer(this, "rearlegtip");
this.rearLegTip.setRotationPoint(0.0F, 32.0F, -4.0F);
this.rearLegTip.addBox("main", -6.0F, -2.0F, 0.0F, 12, 32, 12);
this.rearLeg.addChild(this.rearLegTip);
this.rearFoot = new ModelRenderer(this, "rearfoot");
this.rearFoot.setRotationPoint(0.0F, 31.0F, 4.0F);
this.rearFoot.addBox("main", -9.0F, 0.0F, -20.0F, 18, 6, 24);
this.rearLegTip.addChild(this.rearFoot);
}
/**
* Used for easily adding entity-dependent animations. The second and third float params here are the same second
* and third as in the setRotationAngles method.
*/
public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTickTime)
{
this.partialTicks = partialTickTime;
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
GlStateManager.pushMatrix();
EntityDragon entitydragon = (EntityDragon)entityIn;
float f = entitydragon.prevAnimTime + (entitydragon.animTime - entitydragon.prevAnimTime) * this.partialTicks;
this.jaw.rotateAngleX = (float)(Math.sin((double)(f * ((float)Math.PI * 2F))) + 1.0D) * 0.2F;
float f1 = (float)(Math.sin((double)(f * ((float)Math.PI * 2F) - 1.0F)) + 1.0D);
f1 = (f1 * f1 + f1 * 2.0F) * 0.05F;
GlStateManager.translate(0.0F, f1 - 2.0F, -3.0F);
GlStateManager.rotate(f1 * 2.0F, 1.0F, 0.0F, 0.0F);
float f2 = -30.0F;
float f4 = 0.0F;
float f5 = 1.5F;
double[] adouble = entitydragon.getMovementOffsets(6, this.partialTicks);
float f6 = this.updateRotations(entitydragon.getMovementOffsets(5, this.partialTicks)[0] - entitydragon.getMovementOffsets(10, this.partialTicks)[0]);
float f7 = this.updateRotations(entitydragon.getMovementOffsets(5, this.partialTicks)[0] + (double)(f6 / 2.0F));
float f8 = f * ((float)Math.PI * 2F);
f2 = 20.0F;
float f3 = -12.0F;
for (int i = 0; i < 5; ++i)
{
double[] adouble1 = entitydragon.getMovementOffsets(5 - i, this.partialTicks);
float f9 = (float)Math.cos((double)((float)i * 0.45F + f8)) * 0.15F;
this.spine.rotateAngleY = this.updateRotations(adouble1[0] - adouble[0]) * 0.017453292F * 1.5F;
this.spine.rotateAngleX = f9 + entitydragon.getHeadPartYOffset(i, adouble, adouble1) * 0.017453292F * 1.5F * 5.0F;
this.spine.rotateAngleZ = -this.updateRotations(adouble1[0] - (double)f7) * 0.017453292F * 1.5F;
this.spine.rotationPointY = f2;
this.spine.rotationPointZ = f3;
this.spine.rotationPointX = f4;
f2 = (float)((double)f2 + Math.sin((double)this.spine.rotateAngleX) * 10.0D);
f3 = (float)((double)f3 - Math.cos((double)this.spine.rotateAngleY) * Math.cos((double)this.spine.rotateAngleX) * 10.0D);
f4 = (float)((double)f4 - Math.sin((double)this.spine.rotateAngleY) * Math.cos((double)this.spine.rotateAngleX) * 10.0D);
this.spine.render(scale);
}
this.head.rotationPointY = f2;
this.head.rotationPointZ = f3;
this.head.rotationPointX = f4;
double[] adouble2 = entitydragon.getMovementOffsets(0, this.partialTicks);
this.head.rotateAngleY = this.updateRotations(adouble2[0] - adouble[0]) * 0.017453292F;
this.head.rotateAngleX = this.updateRotations((double)entitydragon.getHeadPartYOffset(6, adouble, adouble2)) * 0.017453292F * 1.5F * 5.0F;
this.head.rotateAngleZ = -this.updateRotations(adouble2[0] - (double)f7) * 0.017453292F;
this.head.render(scale);
GlStateManager.pushMatrix();
GlStateManager.translate(0.0F, 1.0F, 0.0F);
GlStateManager.rotate(-f6 * 1.5F, 0.0F, 0.0F, 1.0F);
GlStateManager.translate(0.0F, -1.0F, 0.0F);
this.body.rotateAngleZ = 0.0F;
this.body.render(scale);
for (int j = 0; j < 2; ++j)
{
GlStateManager.enableCull();
float f11 = f * ((float)Math.PI * 2F);
this.wing.rotateAngleX = 0.125F - (float)Math.cos((double)f11) * 0.2F;
this.wing.rotateAngleY = 0.25F;
this.wing.rotateAngleZ = (float)(Math.sin((double)f11) + 0.125D) * 0.8F;
this.wingTip.rotateAngleZ = -((float)(Math.sin((double)(f11 + 2.0F)) + 0.5D)) * 0.75F;
this.rearLeg.rotateAngleX = 1.0F + f1 * 0.1F;
this.rearLegTip.rotateAngleX = 0.5F + f1 * 0.1F;
this.rearFoot.rotateAngleX = 0.75F + f1 * 0.1F;
this.frontLeg.rotateAngleX = 1.3F + f1 * 0.1F;
this.frontLegTip.rotateAngleX = -0.5F - f1 * 0.1F;
this.frontFoot.rotateAngleX = 0.75F + f1 * 0.1F;
this.wing.render(scale);
this.frontLeg.render(scale);
this.rearLeg.render(scale);
GlStateManager.scale(-1.0F, 1.0F, 1.0F);
if (j == 0)
{
GlStateManager.cullFace(GlStateManager.CullFace.FRONT);
}
}
GlStateManager.popMatrix();
GlStateManager.cullFace(GlStateManager.CullFace.BACK);
GlStateManager.disableCull();
float f10 = -((float)Math.sin((double)(f * ((float)Math.PI * 2F)))) * 0.0F;
f8 = f * ((float)Math.PI * 2F);
f2 = 10.0F;
f3 = 60.0F;
f4 = 0.0F;
adouble = entitydragon.getMovementOffsets(11, this.partialTicks);
for (int k = 0; k < 12; ++k)
{
adouble2 = entitydragon.getMovementOffsets(12 + k, this.partialTicks);
f10 = (float)((double)f10 + Math.sin((double)((float)k * 0.45F + f8)) * 0.05000000074505806D);
this.spine.rotateAngleY = (this.updateRotations(adouble2[0] - adouble[0]) * 1.5F + 180.0F) * 0.017453292F;
this.spine.rotateAngleX = f10 + (float)(adouble2[1] - adouble[1]) * 0.017453292F * 1.5F * 5.0F;
this.spine.rotateAngleZ = this.updateRotations(adouble2[0] - (double)f7) * 0.017453292F * 1.5F;
this.spine.rotationPointY = f2;
this.spine.rotationPointZ = f3;
this.spine.rotationPointX = f4;
f2 = (float)((double)f2 + Math.sin((double)this.spine.rotateAngleX) * 10.0D);
f3 = (float)((double)f3 - Math.cos((double)this.spine.rotateAngleY) * Math.cos((double)this.spine.rotateAngleX) * 10.0D);
f4 = (float)((double)f4 - Math.sin((double)this.spine.rotateAngleY) * Math.cos((double)this.spine.rotateAngleX) * 10.0D);
this.spine.render(scale);
}
GlStateManager.popMatrix();
}
/**
* Updates the rotations in the parameters for rotations greater than 180 degrees or less than -180 degrees. It adds
* or subtracts 360 degrees, so that the appearance is the same, although the numbers are then simplified to range -
* 180 to 180
*/
private float updateRotations(double p_78214_1_)
{
while (p_78214_1_ >= 180.0D)
{
p_78214_1_ -= 360.0D;
}
while (p_78214_1_ < -180.0D)
{
p_78214_1_ += 360.0D;
}
return (float)p_78214_1_;
}
}

View File

@@ -0,0 +1,65 @@
package net.minecraft.client.model;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelDragonHead extends ModelBase
{
private final ModelRenderer head;
private final ModelRenderer jaw;
public ModelDragonHead(float p_i46588_1_)
{
this.textureWidth = 256;
this.textureHeight = 256;
this.setTextureOffset("body.body", 0, 0);
this.setTextureOffset("wing.skin", -56, 88);
this.setTextureOffset("wingtip.skin", -56, 144);
this.setTextureOffset("rearleg.main", 0, 0);
this.setTextureOffset("rearfoot.main", 112, 0);
this.setTextureOffset("rearlegtip.main", 196, 0);
this.setTextureOffset("head.upperhead", 112, 30);
this.setTextureOffset("wing.bone", 112, 88);
this.setTextureOffset("head.upperlip", 176, 44);
this.setTextureOffset("jaw.jaw", 176, 65);
this.setTextureOffset("frontleg.main", 112, 104);
this.setTextureOffset("wingtip.bone", 112, 136);
this.setTextureOffset("frontfoot.main", 144, 104);
this.setTextureOffset("neck.box", 192, 104);
this.setTextureOffset("frontlegtip.main", 226, 138);
this.setTextureOffset("body.scale", 220, 53);
this.setTextureOffset("head.scale", 0, 0);
this.setTextureOffset("neck.scale", 48, 0);
this.setTextureOffset("head.nostril", 112, 0);
float f = -16.0F;
this.head = new ModelRenderer(this, "head");
this.head.addBox("upperlip", -6.0F, -1.0F, -24.0F, 12, 5, 16);
this.head.addBox("upperhead", -8.0F, -8.0F, -10.0F, 16, 16, 16);
this.head.mirror = true;
this.head.addBox("scale", -5.0F, -12.0F, -4.0F, 2, 4, 6);
this.head.addBox("nostril", -5.0F, -3.0F, -22.0F, 2, 2, 4);
this.head.mirror = false;
this.head.addBox("scale", 3.0F, -12.0F, -4.0F, 2, 4, 6);
this.head.addBox("nostril", 3.0F, -3.0F, -22.0F, 2, 2, 4);
this.jaw = new ModelRenderer(this, "jaw");
this.jaw.setRotationPoint(0.0F, 4.0F, -8.0F);
this.jaw.addBox("jaw", -6.0F, 0.0F, -16.0F, 12, 4, 16);
this.head.addChild(this.jaw);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.jaw.rotateAngleX = (float)(Math.sin((double)(limbSwing * (float)Math.PI * 0.2F)) + 1.0D) * 0.2F;
this.head.rotateAngleY = netHeadYaw * 0.017453292F;
this.head.rotateAngleX = headPitch * 0.017453292F;
GlStateManager.translate(0.0F, -0.374375F, 0.0F);
GlStateManager.scale(0.75F, 0.75F, 0.75F);
this.head.render(scale);
}
}

View File

@@ -0,0 +1,109 @@
package net.minecraft.client.model;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.math.Vec3d;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelElytra extends ModelBase
{
private final ModelRenderer rightWing;
private final ModelRenderer leftWing = new ModelRenderer(this, 22, 0);
public ModelElytra()
{
this.leftWing.addBox(-10.0F, 0.0F, 0.0F, 10, 20, 2, 1.0F);
this.rightWing = new ModelRenderer(this, 22, 0);
this.rightWing.mirror = true;
this.rightWing.addBox(0.0F, 0.0F, 0.0F, 10, 20, 2, 1.0F);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
GlStateManager.disableRescaleNormal();
GlStateManager.disableCull();
if (entityIn instanceof EntityLivingBase && ((EntityLivingBase)entityIn).isChild())
{
GlStateManager.pushMatrix();
GlStateManager.scale(0.5F, 0.5F, 0.5F);
GlStateManager.translate(0.0F, 1.5F, -0.1F);
this.leftWing.render(scale);
this.rightWing.render(scale);
GlStateManager.popMatrix();
}
else
{
this.leftWing.render(scale);
this.rightWing.render(scale);
}
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
float f = 0.2617994F;
float f1 = -0.2617994F;
float f2 = 0.0F;
float f3 = 0.0F;
if (entityIn instanceof EntityLivingBase && ((EntityLivingBase)entityIn).isElytraFlying())
{
float f4 = 1.0F;
if (entityIn.motionY < 0.0D)
{
Vec3d vec3d = (new Vec3d(entityIn.motionX, entityIn.motionY, entityIn.motionZ)).normalize();
f4 = 1.0F - (float)Math.pow(-vec3d.y, 1.5D);
}
f = f4 * 0.34906584F + (1.0F - f4) * f;
f1 = f4 * -((float)Math.PI / 2F) + (1.0F - f4) * f1;
}
else if (entityIn.isSneaking())
{
f = ((float)Math.PI * 2F / 9F);
f1 = -((float)Math.PI / 4F);
f2 = 3.0F;
f3 = 0.08726646F;
}
this.leftWing.rotationPointX = 5.0F;
this.leftWing.rotationPointY = f2;
if (entityIn instanceof AbstractClientPlayer)
{
AbstractClientPlayer abstractclientplayer = (AbstractClientPlayer)entityIn;
abstractclientplayer.rotateElytraX = (float)((double)abstractclientplayer.rotateElytraX + (double)(f - abstractclientplayer.rotateElytraX) * 0.1D);
abstractclientplayer.rotateElytraY = (float)((double)abstractclientplayer.rotateElytraY + (double)(f3 - abstractclientplayer.rotateElytraY) * 0.1D);
abstractclientplayer.rotateElytraZ = (float)((double)abstractclientplayer.rotateElytraZ + (double)(f1 - abstractclientplayer.rotateElytraZ) * 0.1D);
this.leftWing.rotateAngleX = abstractclientplayer.rotateElytraX;
this.leftWing.rotateAngleY = abstractclientplayer.rotateElytraY;
this.leftWing.rotateAngleZ = abstractclientplayer.rotateElytraZ;
}
else
{
this.leftWing.rotateAngleX = f;
this.leftWing.rotateAngleZ = f1;
this.leftWing.rotateAngleY = f3;
}
this.rightWing.rotationPointX = -this.leftWing.rotationPointX;
this.rightWing.rotateAngleY = -this.leftWing.rotateAngleY;
this.rightWing.rotationPointY = this.leftWing.rotationPointY;
this.rightWing.rotateAngleX = this.leftWing.rotateAngleX;
this.rightWing.rotateAngleZ = -this.leftWing.rotateAngleZ;
}
}

View File

@@ -0,0 +1,60 @@
package net.minecraft.client.model;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelEnderCrystal extends ModelBase
{
/** The cube model for the Ender Crystal. */
private final ModelRenderer cube;
/** The glass model for the Ender Crystal. */
private final ModelRenderer glass = new ModelRenderer(this, "glass");
/** The base model for the Ender Crystal. */
private ModelRenderer base;
public ModelEnderCrystal(float p_i1170_1_, boolean renderBase)
{
this.glass.setTextureOffset(0, 0).addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8);
this.cube = new ModelRenderer(this, "cube");
this.cube.setTextureOffset(32, 0).addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8);
if (renderBase)
{
this.base = new ModelRenderer(this, "base");
this.base.setTextureOffset(0, 16).addBox(-6.0F, 0.0F, -6.0F, 12, 4, 12);
}
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
GlStateManager.pushMatrix();
GlStateManager.scale(2.0F, 2.0F, 2.0F);
GlStateManager.translate(0.0F, -0.5F, 0.0F);
if (this.base != null)
{
this.base.render(scale);
}
GlStateManager.rotate(limbSwingAmount, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(0.0F, 0.8F + ageInTicks, 0.0F);
GlStateManager.rotate(60.0F, 0.7071F, 0.0F, 0.7071F);
this.glass.render(scale);
float f = 0.875F;
GlStateManager.scale(0.875F, 0.875F, 0.875F);
GlStateManager.rotate(60.0F, 0.7071F, 0.0F, 0.7071F);
GlStateManager.rotate(limbSwingAmount, 0.0F, 1.0F, 0.0F);
this.glass.render(scale);
GlStateManager.scale(0.875F, 0.875F, 0.875F);
GlStateManager.rotate(60.0F, 0.7071F, 0.0F, 0.7071F);
GlStateManager.rotate(limbSwingAmount, 0.0F, 1.0F, 0.0F);
this.cube.render(scale);
GlStateManager.popMatrix();
}
}

View File

@@ -0,0 +1,60 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelEnderMite extends ModelBase
{
private static final int[][] BODY_SIZES = new int[][] {{4, 3, 2}, {6, 4, 5}, {3, 3, 1}, {1, 2, 1}};
private static final int[][] BODY_TEXS = new int[][] {{0, 0}, {0, 5}, {0, 14}, {0, 18}};
private static final int BODY_COUNT = BODY_SIZES.length;
private final ModelRenderer[] bodyParts;
public ModelEnderMite()
{
this.bodyParts = new ModelRenderer[BODY_COUNT];
float f = -3.5F;
for (int i = 0; i < this.bodyParts.length; ++i)
{
this.bodyParts[i] = new ModelRenderer(this, BODY_TEXS[i][0], BODY_TEXS[i][1]);
this.bodyParts[i].addBox((float)BODY_SIZES[i][0] * -0.5F, 0.0F, (float)BODY_SIZES[i][2] * -0.5F, BODY_SIZES[i][0], BODY_SIZES[i][1], BODY_SIZES[i][2]);
this.bodyParts[i].setRotationPoint(0.0F, (float)(24 - BODY_SIZES[i][1]), f);
if (i < this.bodyParts.length - 1)
{
f += (float)(BODY_SIZES[i][2] + BODY_SIZES[i + 1][2]) * 0.5F;
}
}
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
for (ModelRenderer modelrenderer : this.bodyParts)
{
modelrenderer.render(scale);
}
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
for (int i = 0; i < this.bodyParts.length; ++i)
{
this.bodyParts[i].rotateAngleY = MathHelper.cos(ageInTicks * 0.9F + (float)i * 0.15F * (float)Math.PI) * (float)Math.PI * 0.01F * (float)(1 + Math.abs(i - 2));
this.bodyParts[i].rotationPointX = MathHelper.sin(ageInTicks * 0.9F + (float)i * 0.15F * (float)Math.PI) * (float)Math.PI * 0.1F * (float)Math.abs(i - 2);
}
}
}

View File

@@ -0,0 +1,131 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelEnderman extends ModelBiped
{
/** Is the enderman carrying a block? */
public boolean isCarrying;
/** Is the enderman attacking an entity? */
public boolean isAttacking;
public ModelEnderman(float scale)
{
super(0.0F, -14.0F, 64, 32);
float f = -14.0F;
this.bipedHeadwear = new ModelRenderer(this, 0, 16);
this.bipedHeadwear.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, scale - 0.5F);
this.bipedHeadwear.setRotationPoint(0.0F, -14.0F, 0.0F);
this.bipedBody = new ModelRenderer(this, 32, 16);
this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, scale);
this.bipedBody.setRotationPoint(0.0F, -14.0F, 0.0F);
this.bipedRightArm = new ModelRenderer(this, 56, 0);
this.bipedRightArm.addBox(-1.0F, -2.0F, -1.0F, 2, 30, 2, scale);
this.bipedRightArm.setRotationPoint(-3.0F, -12.0F, 0.0F);
this.bipedLeftArm = new ModelRenderer(this, 56, 0);
this.bipedLeftArm.mirror = true;
this.bipedLeftArm.addBox(-1.0F, -2.0F, -1.0F, 2, 30, 2, scale);
this.bipedLeftArm.setRotationPoint(5.0F, -12.0F, 0.0F);
this.bipedRightLeg = new ModelRenderer(this, 56, 0);
this.bipedRightLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 30, 2, scale);
this.bipedRightLeg.setRotationPoint(-2.0F, -2.0F, 0.0F);
this.bipedLeftLeg = new ModelRenderer(this, 56, 0);
this.bipedLeftLeg.mirror = true;
this.bipedLeftLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 30, 2, scale);
this.bipedLeftLeg.setRotationPoint(2.0F, -2.0F, 0.0F);
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
this.bipedHead.showModel = true;
float f = -14.0F;
this.bipedBody.rotateAngleX = 0.0F;
this.bipedBody.rotationPointY = -14.0F;
this.bipedBody.rotationPointZ = -0.0F;
this.bipedRightLeg.rotateAngleX -= 0.0F;
this.bipedLeftLeg.rotateAngleX -= 0.0F;
this.bipedRightArm.rotateAngleX = (float)((double)this.bipedRightArm.rotateAngleX * 0.5D);
this.bipedLeftArm.rotateAngleX = (float)((double)this.bipedLeftArm.rotateAngleX * 0.5D);
this.bipedRightLeg.rotateAngleX = (float)((double)this.bipedRightLeg.rotateAngleX * 0.5D);
this.bipedLeftLeg.rotateAngleX = (float)((double)this.bipedLeftLeg.rotateAngleX * 0.5D);
float f1 = 0.4F;
if (this.bipedRightArm.rotateAngleX > 0.4F)
{
this.bipedRightArm.rotateAngleX = 0.4F;
}
if (this.bipedLeftArm.rotateAngleX > 0.4F)
{
this.bipedLeftArm.rotateAngleX = 0.4F;
}
if (this.bipedRightArm.rotateAngleX < -0.4F)
{
this.bipedRightArm.rotateAngleX = -0.4F;
}
if (this.bipedLeftArm.rotateAngleX < -0.4F)
{
this.bipedLeftArm.rotateAngleX = -0.4F;
}
if (this.bipedRightLeg.rotateAngleX > 0.4F)
{
this.bipedRightLeg.rotateAngleX = 0.4F;
}
if (this.bipedLeftLeg.rotateAngleX > 0.4F)
{
this.bipedLeftLeg.rotateAngleX = 0.4F;
}
if (this.bipedRightLeg.rotateAngleX < -0.4F)
{
this.bipedRightLeg.rotateAngleX = -0.4F;
}
if (this.bipedLeftLeg.rotateAngleX < -0.4F)
{
this.bipedLeftLeg.rotateAngleX = -0.4F;
}
if (this.isCarrying)
{
this.bipedRightArm.rotateAngleX = -0.5F;
this.bipedLeftArm.rotateAngleX = -0.5F;
this.bipedRightArm.rotateAngleZ = 0.05F;
this.bipedLeftArm.rotateAngleZ = -0.05F;
}
this.bipedRightArm.rotationPointZ = 0.0F;
this.bipedLeftArm.rotationPointZ = 0.0F;
this.bipedRightLeg.rotationPointZ = 0.0F;
this.bipedLeftLeg.rotationPointZ = 0.0F;
this.bipedRightLeg.rotationPointY = -5.0F;
this.bipedLeftLeg.rotationPointY = -5.0F;
this.bipedHead.rotationPointZ = -0.0F;
this.bipedHead.rotationPointY = -13.0F;
this.bipedHeadwear.rotationPointX = this.bipedHead.rotationPointX;
this.bipedHeadwear.rotationPointY = this.bipedHead.rotationPointY;
this.bipedHeadwear.rotationPointZ = this.bipedHead.rotationPointZ;
this.bipedHeadwear.rotateAngleX = this.bipedHead.rotateAngleX;
this.bipedHeadwear.rotateAngleY = this.bipedHead.rotateAngleY;
this.bipedHeadwear.rotateAngleZ = this.bipedHead.rotateAngleZ;
if (this.isAttacking)
{
float f2 = 1.0F;
this.bipedHead.rotationPointY -= 5.0F;
}
}
}

View File

@@ -0,0 +1,51 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelEvokerFangs extends ModelBase
{
private final ModelRenderer base = new ModelRenderer(this, 0, 0);
private final ModelRenderer upperJaw;
private final ModelRenderer lowerJaw;
public ModelEvokerFangs()
{
this.base.setRotationPoint(-5.0F, 22.0F, -5.0F);
this.base.addBox(0.0F, 0.0F, 0.0F, 10, 12, 10);
this.upperJaw = new ModelRenderer(this, 40, 0);
this.upperJaw.setRotationPoint(1.5F, 22.0F, -4.0F);
this.upperJaw.addBox(0.0F, 0.0F, 0.0F, 4, 14, 8);
this.lowerJaw = new ModelRenderer(this, 40, 0);
this.lowerJaw.setRotationPoint(-1.5F, 22.0F, 4.0F);
this.lowerJaw.addBox(0.0F, 0.0F, 0.0F, 4, 14, 8);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
float f = limbSwing * 2.0F;
if (f > 1.0F)
{
f = 1.0F;
}
f = 1.0F - f * f * f;
this.upperJaw.rotateAngleZ = (float)Math.PI - f * 0.35F * (float)Math.PI;
this.lowerJaw.rotateAngleZ = (float)Math.PI + f * 0.35F * (float)Math.PI;
this.lowerJaw.rotateAngleY = (float)Math.PI;
float f1 = (limbSwing + MathHelper.sin(limbSwing * 2.7F)) * 0.6F * 12.0F;
this.upperJaw.rotationPointY = 24.0F - f1;
this.lowerJaw.rotationPointY = this.upperJaw.rotationPointY;
this.base.rotationPointY = this.upperJaw.rotationPointY;
this.base.render(scale);
this.upperJaw.render(scale);
this.lowerJaw.render(scale);
}
}

View File

@@ -0,0 +1,67 @@
package net.minecraft.client.model;
import java.util.Random;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelGhast extends ModelBase
{
ModelRenderer body;
ModelRenderer[] tentacles = new ModelRenderer[9];
public ModelGhast()
{
int i = -16;
this.body = new ModelRenderer(this, 0, 0);
this.body.addBox(-8.0F, -8.0F, -8.0F, 16, 16, 16);
this.body.rotationPointY += 8.0F;
Random random = new Random(1660L);
for (int j = 0; j < this.tentacles.length; ++j)
{
this.tentacles[j] = new ModelRenderer(this, 0, 0);
float f = (((float)(j % 3) - (float)(j / 3 % 2) * 0.5F + 0.25F) / 2.0F * 2.0F - 1.0F) * 5.0F;
float f1 = ((float)(j / 3) / 2.0F * 2.0F - 1.0F) * 5.0F;
int k = random.nextInt(7) + 8;
this.tentacles[j].addBox(-1.0F, 0.0F, -1.0F, 2, k, 2);
this.tentacles[j].rotationPointX = f;
this.tentacles[j].rotationPointZ = f1;
this.tentacles[j].rotationPointY = 15.0F;
}
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
for (int i = 0; i < this.tentacles.length; ++i)
{
this.tentacles[i].rotateAngleX = 0.2F * MathHelper.sin(ageInTicks * 0.3F + (float)i) + 0.4F;
}
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
GlStateManager.pushMatrix();
GlStateManager.translate(0.0F, 0.6F, 0.0F);
this.body.render(scale);
for (ModelRenderer modelrenderer : this.tentacles)
{
modelrenderer.render(scale);
}
GlStateManager.popMatrix();
}
}

View File

@@ -0,0 +1,134 @@
package net.minecraft.client.model;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.entity.monster.EntityGuardian;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelGuardian extends ModelBase
{
private final ModelRenderer guardianBody;
private final ModelRenderer guardianEye;
private final ModelRenderer[] guardianSpines;
private final ModelRenderer[] guardianTail;
public ModelGuardian()
{
this.textureWidth = 64;
this.textureHeight = 64;
this.guardianSpines = new ModelRenderer[12];
this.guardianBody = new ModelRenderer(this);
this.guardianBody.setTextureOffset(0, 0).addBox(-6.0F, 10.0F, -8.0F, 12, 12, 16);
this.guardianBody.setTextureOffset(0, 28).addBox(-8.0F, 10.0F, -6.0F, 2, 12, 12);
this.guardianBody.setTextureOffset(0, 28).addBox(6.0F, 10.0F, -6.0F, 2, 12, 12, true);
this.guardianBody.setTextureOffset(16, 40).addBox(-6.0F, 8.0F, -6.0F, 12, 2, 12);
this.guardianBody.setTextureOffset(16, 40).addBox(-6.0F, 22.0F, -6.0F, 12, 2, 12);
for (int i = 0; i < this.guardianSpines.length; ++i)
{
this.guardianSpines[i] = new ModelRenderer(this, 0, 0);
this.guardianSpines[i].addBox(-1.0F, -4.5F, -1.0F, 2, 9, 2);
this.guardianBody.addChild(this.guardianSpines[i]);
}
this.guardianEye = new ModelRenderer(this, 8, 0);
this.guardianEye.addBox(-1.0F, 15.0F, 0.0F, 2, 2, 1);
this.guardianBody.addChild(this.guardianEye);
this.guardianTail = new ModelRenderer[3];
this.guardianTail[0] = new ModelRenderer(this, 40, 0);
this.guardianTail[0].addBox(-2.0F, 14.0F, 7.0F, 4, 4, 8);
this.guardianTail[1] = new ModelRenderer(this, 0, 54);
this.guardianTail[1].addBox(0.0F, 14.0F, 0.0F, 3, 3, 7);
this.guardianTail[2] = new ModelRenderer(this);
this.guardianTail[2].setTextureOffset(41, 32).addBox(0.0F, 14.0F, 0.0F, 2, 2, 6);
this.guardianTail[2].setTextureOffset(25, 19).addBox(1.0F, 10.5F, 3.0F, 1, 9, 9);
this.guardianBody.addChild(this.guardianTail[0]);
this.guardianTail[0].addChild(this.guardianTail[1]);
this.guardianTail[1].addChild(this.guardianTail[2]);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
this.guardianBody.render(scale);
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
EntityGuardian entityguardian = (EntityGuardian)entityIn;
float f = ageInTicks - (float)entityguardian.ticksExisted;
this.guardianBody.rotateAngleY = netHeadYaw * 0.017453292F;
this.guardianBody.rotateAngleX = headPitch * 0.017453292F;
float[] afloat = new float[] {1.75F, 0.25F, 0.0F, 0.0F, 0.5F, 0.5F, 0.5F, 0.5F, 1.25F, 0.75F, 0.0F, 0.0F};
float[] afloat1 = new float[] {0.0F, 0.0F, 0.0F, 0.0F, 0.25F, 1.75F, 1.25F, 0.75F, 0.0F, 0.0F, 0.0F, 0.0F};
float[] afloat2 = new float[] {0.0F, 0.0F, 0.25F, 1.75F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.75F, 1.25F};
float[] afloat3 = new float[] {0.0F, 0.0F, 8.0F, -8.0F, -8.0F, 8.0F, 8.0F, -8.0F, 0.0F, 0.0F, 8.0F, -8.0F};
float[] afloat4 = new float[] { -8.0F, -8.0F, -8.0F, -8.0F, 0.0F, 0.0F, 0.0F, 0.0F, 8.0F, 8.0F, 8.0F, 8.0F};
float[] afloat5 = new float[] {8.0F, -8.0F, 0.0F, 0.0F, -8.0F, -8.0F, 8.0F, 8.0F, 8.0F, -8.0F, 0.0F, 0.0F};
float f1 = (1.0F - entityguardian.getSpikesAnimation(f)) * 0.55F;
for (int i = 0; i < 12; ++i)
{
this.guardianSpines[i].rotateAngleX = (float)Math.PI * afloat[i];
this.guardianSpines[i].rotateAngleY = (float)Math.PI * afloat1[i];
this.guardianSpines[i].rotateAngleZ = (float)Math.PI * afloat2[i];
this.guardianSpines[i].rotationPointX = afloat3[i] * (1.0F + MathHelper.cos(ageInTicks * 1.5F + (float)i) * 0.01F - f1);
this.guardianSpines[i].rotationPointY = 16.0F + afloat4[i] * (1.0F + MathHelper.cos(ageInTicks * 1.5F + (float)i) * 0.01F - f1);
this.guardianSpines[i].rotationPointZ = afloat5[i] * (1.0F + MathHelper.cos(ageInTicks * 1.5F + (float)i) * 0.01F - f1);
}
this.guardianEye.rotationPointZ = -8.25F;
Entity entity = Minecraft.getMinecraft().getRenderViewEntity();
if (entityguardian.hasTargetedEntity())
{
entity = entityguardian.getTargetedEntity();
}
if (entity != null)
{
Vec3d vec3d = entity.getPositionEyes(0.0F);
Vec3d vec3d1 = entityIn.getPositionEyes(0.0F);
double d0 = vec3d.y - vec3d1.y;
if (d0 > 0.0D)
{
this.guardianEye.rotationPointY = 0.0F;
}
else
{
this.guardianEye.rotationPointY = 1.0F;
}
Vec3d vec3d2 = entityIn.getLook(0.0F);
vec3d2 = new Vec3d(vec3d2.x, 0.0D, vec3d2.z);
Vec3d vec3d3 = (new Vec3d(vec3d1.x - vec3d.x, 0.0D, vec3d1.z - vec3d.z)).normalize().rotateYaw(((float)Math.PI / 2F));
double d1 = vec3d2.dotProduct(vec3d3);
this.guardianEye.rotationPointX = MathHelper.sqrt((float)Math.abs(d1)) * 2.0F * (float)Math.signum(d1);
}
this.guardianEye.showModel = true;
float f2 = entityguardian.getTailAnimation(f);
this.guardianTail[0].rotateAngleY = MathHelper.sin(f2) * (float)Math.PI * 0.05F;
this.guardianTail[1].rotateAngleY = MathHelper.sin(f2) * (float)Math.PI * 0.1F;
this.guardianTail[1].rotationPointX = -1.5F;
this.guardianTail[1].rotationPointY = 0.5F;
this.guardianTail[1].rotationPointZ = 14.0F;
this.guardianTail[2].rotateAngleY = MathHelper.sin(f2) * (float)Math.PI * 0.15F;
this.guardianTail[2].rotationPointX = 0.5F;
this.guardianTail[2].rotationPointY = 0.5F;
this.guardianTail[2].rotationPointZ = 6.0F;
}
}

View File

@@ -0,0 +1,558 @@
package net.minecraft.client.model;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.passive.AbstractChestHorse;
import net.minecraft.entity.passive.AbstractHorse;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelHorse extends ModelBase
{
private final ModelRenderer head;
private final ModelRenderer upperMouth;
private final ModelRenderer lowerMouth;
private final ModelRenderer horseLeftEar;
private final ModelRenderer horseRightEar;
/** The left ear box for the mule model. */
private final ModelRenderer muleLeftEar;
/** The right ear box for the mule model. */
private final ModelRenderer muleRightEar;
private final ModelRenderer neck;
/** The box for the horse's ropes on its face. */
private final ModelRenderer horseFaceRopes;
private final ModelRenderer mane;
private final ModelRenderer body;
private final ModelRenderer tailBase;
private final ModelRenderer tailMiddle;
private final ModelRenderer tailTip;
private final ModelRenderer backLeftLeg;
private final ModelRenderer backLeftShin;
private final ModelRenderer backLeftHoof;
private final ModelRenderer backRightLeg;
private final ModelRenderer backRightShin;
private final ModelRenderer backRightHoof;
private final ModelRenderer frontLeftLeg;
private final ModelRenderer frontLeftShin;
private final ModelRenderer frontLeftHoof;
private final ModelRenderer frontRightLeg;
private final ModelRenderer frontRightShin;
private final ModelRenderer frontRightHoof;
/** The left chest box on the mule model. */
private final ModelRenderer muleLeftChest;
/** The right chest box on the mule model. */
private final ModelRenderer muleRightChest;
private final ModelRenderer horseSaddleBottom;
private final ModelRenderer horseSaddleFront;
private final ModelRenderer horseSaddleBack;
private final ModelRenderer horseLeftSaddleRope;
private final ModelRenderer horseLeftSaddleMetal;
private final ModelRenderer horseRightSaddleRope;
private final ModelRenderer horseRightSaddleMetal;
/** The left metal connected to the horse's face ropes. */
private final ModelRenderer horseLeftFaceMetal;
/** The right metal connected to the horse's face ropes. */
private final ModelRenderer horseRightFaceMetal;
private final ModelRenderer horseLeftRein;
private final ModelRenderer horseRightRein;
public ModelHorse()
{
this.textureWidth = 128;
this.textureHeight = 128;
this.body = new ModelRenderer(this, 0, 34);
this.body.addBox(-5.0F, -8.0F, -19.0F, 10, 10, 24);
this.body.setRotationPoint(0.0F, 11.0F, 9.0F);
this.tailBase = new ModelRenderer(this, 44, 0);
this.tailBase.addBox(-1.0F, -1.0F, 0.0F, 2, 2, 3);
this.tailBase.setRotationPoint(0.0F, 3.0F, 14.0F);
this.tailBase.rotateAngleX = -1.134464F;
this.tailMiddle = new ModelRenderer(this, 38, 7);
this.tailMiddle.addBox(-1.5F, -2.0F, 3.0F, 3, 4, 7);
this.tailMiddle.setRotationPoint(0.0F, 3.0F, 14.0F);
this.tailMiddle.rotateAngleX = -1.134464F;
this.tailTip = new ModelRenderer(this, 24, 3);
this.tailTip.addBox(-1.5F, -4.5F, 9.0F, 3, 4, 7);
this.tailTip.setRotationPoint(0.0F, 3.0F, 14.0F);
this.tailTip.rotateAngleX = -1.3962634F;
this.backLeftLeg = new ModelRenderer(this, 78, 29);
this.backLeftLeg.addBox(-2.5F, -2.0F, -2.5F, 4, 9, 5);
this.backLeftLeg.setRotationPoint(4.0F, 9.0F, 11.0F);
this.backLeftShin = new ModelRenderer(this, 78, 43);
this.backLeftShin.addBox(-2.0F, 0.0F, -1.5F, 3, 5, 3);
this.backLeftShin.setRotationPoint(4.0F, 16.0F, 11.0F);
this.backLeftHoof = new ModelRenderer(this, 78, 51);
this.backLeftHoof.addBox(-2.5F, 5.1F, -2.0F, 4, 3, 4);
this.backLeftHoof.setRotationPoint(4.0F, 16.0F, 11.0F);
this.backRightLeg = new ModelRenderer(this, 96, 29);
this.backRightLeg.addBox(-1.5F, -2.0F, -2.5F, 4, 9, 5);
this.backRightLeg.setRotationPoint(-4.0F, 9.0F, 11.0F);
this.backRightShin = new ModelRenderer(this, 96, 43);
this.backRightShin.addBox(-1.0F, 0.0F, -1.5F, 3, 5, 3);
this.backRightShin.setRotationPoint(-4.0F, 16.0F, 11.0F);
this.backRightHoof = new ModelRenderer(this, 96, 51);
this.backRightHoof.addBox(-1.5F, 5.1F, -2.0F, 4, 3, 4);
this.backRightHoof.setRotationPoint(-4.0F, 16.0F, 11.0F);
this.frontLeftLeg = new ModelRenderer(this, 44, 29);
this.frontLeftLeg.addBox(-1.9F, -1.0F, -2.1F, 3, 8, 4);
this.frontLeftLeg.setRotationPoint(4.0F, 9.0F, -8.0F);
this.frontLeftShin = new ModelRenderer(this, 44, 41);
this.frontLeftShin.addBox(-1.9F, 0.0F, -1.6F, 3, 5, 3);
this.frontLeftShin.setRotationPoint(4.0F, 16.0F, -8.0F);
this.frontLeftHoof = new ModelRenderer(this, 44, 51);
this.frontLeftHoof.addBox(-2.4F, 5.1F, -2.1F, 4, 3, 4);
this.frontLeftHoof.setRotationPoint(4.0F, 16.0F, -8.0F);
this.frontRightLeg = new ModelRenderer(this, 60, 29);
this.frontRightLeg.addBox(-1.1F, -1.0F, -2.1F, 3, 8, 4);
this.frontRightLeg.setRotationPoint(-4.0F, 9.0F, -8.0F);
this.frontRightShin = new ModelRenderer(this, 60, 41);
this.frontRightShin.addBox(-1.1F, 0.0F, -1.6F, 3, 5, 3);
this.frontRightShin.setRotationPoint(-4.0F, 16.0F, -8.0F);
this.frontRightHoof = new ModelRenderer(this, 60, 51);
this.frontRightHoof.addBox(-1.6F, 5.1F, -2.1F, 4, 3, 4);
this.frontRightHoof.setRotationPoint(-4.0F, 16.0F, -8.0F);
this.head = new ModelRenderer(this, 0, 0);
this.head.addBox(-2.5F, -10.0F, -1.5F, 5, 5, 7);
this.head.setRotationPoint(0.0F, 4.0F, -10.0F);
this.head.rotateAngleX = 0.5235988F;
this.upperMouth = new ModelRenderer(this, 24, 18);
this.upperMouth.addBox(-2.0F, -10.0F, -7.0F, 4, 3, 6);
this.upperMouth.setRotationPoint(0.0F, 3.95F, -10.0F);
this.upperMouth.rotateAngleX = 0.5235988F;
this.lowerMouth = new ModelRenderer(this, 24, 27);
this.lowerMouth.addBox(-2.0F, -7.0F, -6.5F, 4, 2, 5);
this.lowerMouth.setRotationPoint(0.0F, 4.0F, -10.0F);
this.lowerMouth.rotateAngleX = 0.5235988F;
this.head.addChild(this.upperMouth);
this.head.addChild(this.lowerMouth);
this.horseLeftEar = new ModelRenderer(this, 0, 0);
this.horseLeftEar.addBox(0.45F, -12.0F, 4.0F, 2, 3, 1);
this.horseLeftEar.setRotationPoint(0.0F, 4.0F, -10.0F);
this.horseLeftEar.rotateAngleX = 0.5235988F;
this.horseRightEar = new ModelRenderer(this, 0, 0);
this.horseRightEar.addBox(-2.45F, -12.0F, 4.0F, 2, 3, 1);
this.horseRightEar.setRotationPoint(0.0F, 4.0F, -10.0F);
this.horseRightEar.rotateAngleX = 0.5235988F;
this.muleLeftEar = new ModelRenderer(this, 0, 12);
this.muleLeftEar.addBox(-2.0F, -16.0F, 4.0F, 2, 7, 1);
this.muleLeftEar.setRotationPoint(0.0F, 4.0F, -10.0F);
this.muleLeftEar.rotateAngleX = 0.5235988F;
this.muleLeftEar.rotateAngleZ = 0.2617994F;
this.muleRightEar = new ModelRenderer(this, 0, 12);
this.muleRightEar.addBox(0.0F, -16.0F, 4.0F, 2, 7, 1);
this.muleRightEar.setRotationPoint(0.0F, 4.0F, -10.0F);
this.muleRightEar.rotateAngleX = 0.5235988F;
this.muleRightEar.rotateAngleZ = -0.2617994F;
this.neck = new ModelRenderer(this, 0, 12);
this.neck.addBox(-2.05F, -9.8F, -2.0F, 4, 14, 8);
this.neck.setRotationPoint(0.0F, 4.0F, -10.0F);
this.neck.rotateAngleX = 0.5235988F;
this.muleLeftChest = new ModelRenderer(this, 0, 34);
this.muleLeftChest.addBox(-3.0F, 0.0F, 0.0F, 8, 8, 3);
this.muleLeftChest.setRotationPoint(-7.5F, 3.0F, 10.0F);
this.muleLeftChest.rotateAngleY = ((float)Math.PI / 2F);
this.muleRightChest = new ModelRenderer(this, 0, 47);
this.muleRightChest.addBox(-3.0F, 0.0F, 0.0F, 8, 8, 3);
this.muleRightChest.setRotationPoint(4.5F, 3.0F, 10.0F);
this.muleRightChest.rotateAngleY = ((float)Math.PI / 2F);
this.horseSaddleBottom = new ModelRenderer(this, 80, 0);
this.horseSaddleBottom.addBox(-5.0F, 0.0F, -3.0F, 10, 1, 8);
this.horseSaddleBottom.setRotationPoint(0.0F, 2.0F, 2.0F);
this.horseSaddleFront = new ModelRenderer(this, 106, 9);
this.horseSaddleFront.addBox(-1.5F, -1.0F, -3.0F, 3, 1, 2);
this.horseSaddleFront.setRotationPoint(0.0F, 2.0F, 2.0F);
this.horseSaddleBack = new ModelRenderer(this, 80, 9);
this.horseSaddleBack.addBox(-4.0F, -1.0F, 3.0F, 8, 1, 2);
this.horseSaddleBack.setRotationPoint(0.0F, 2.0F, 2.0F);
this.horseLeftSaddleMetal = new ModelRenderer(this, 74, 0);
this.horseLeftSaddleMetal.addBox(-0.5F, 6.0F, -1.0F, 1, 2, 2);
this.horseLeftSaddleMetal.setRotationPoint(5.0F, 3.0F, 2.0F);
this.horseLeftSaddleRope = new ModelRenderer(this, 70, 0);
this.horseLeftSaddleRope.addBox(-0.5F, 0.0F, -0.5F, 1, 6, 1);
this.horseLeftSaddleRope.setRotationPoint(5.0F, 3.0F, 2.0F);
this.horseRightSaddleMetal = new ModelRenderer(this, 74, 4);
this.horseRightSaddleMetal.addBox(-0.5F, 6.0F, -1.0F, 1, 2, 2);
this.horseRightSaddleMetal.setRotationPoint(-5.0F, 3.0F, 2.0F);
this.horseRightSaddleRope = new ModelRenderer(this, 80, 0);
this.horseRightSaddleRope.addBox(-0.5F, 0.0F, -0.5F, 1, 6, 1);
this.horseRightSaddleRope.setRotationPoint(-5.0F, 3.0F, 2.0F);
this.horseLeftFaceMetal = new ModelRenderer(this, 74, 13);
this.horseLeftFaceMetal.addBox(1.5F, -8.0F, -4.0F, 1, 2, 2);
this.horseLeftFaceMetal.setRotationPoint(0.0F, 4.0F, -10.0F);
this.horseLeftFaceMetal.rotateAngleX = 0.5235988F;
this.horseRightFaceMetal = new ModelRenderer(this, 74, 13);
this.horseRightFaceMetal.addBox(-2.5F, -8.0F, -4.0F, 1, 2, 2);
this.horseRightFaceMetal.setRotationPoint(0.0F, 4.0F, -10.0F);
this.horseRightFaceMetal.rotateAngleX = 0.5235988F;
this.horseLeftRein = new ModelRenderer(this, 44, 10);
this.horseLeftRein.addBox(2.6F, -6.0F, -6.0F, 0, 3, 16);
this.horseLeftRein.setRotationPoint(0.0F, 4.0F, -10.0F);
this.horseRightRein = new ModelRenderer(this, 44, 5);
this.horseRightRein.addBox(-2.6F, -6.0F, -6.0F, 0, 3, 16);
this.horseRightRein.setRotationPoint(0.0F, 4.0F, -10.0F);
this.mane = new ModelRenderer(this, 58, 0);
this.mane.addBox(-1.0F, -11.5F, 5.0F, 2, 16, 4);
this.mane.setRotationPoint(0.0F, 4.0F, -10.0F);
this.mane.rotateAngleX = 0.5235988F;
this.horseFaceRopes = new ModelRenderer(this, 80, 12);
this.horseFaceRopes.addBox(-2.5F, -10.1F, -7.0F, 5, 5, 12, 0.2F);
this.horseFaceRopes.setRotationPoint(0.0F, 4.0F, -10.0F);
this.horseFaceRopes.rotateAngleX = 0.5235988F;
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
AbstractHorse abstracthorse = (AbstractHorse)entityIn;
float f = abstracthorse.getGrassEatingAmount(0.0F);
boolean flag = abstracthorse.isChild();
boolean flag1 = !flag && abstracthorse.isHorseSaddled();
boolean flag2 = abstracthorse instanceof AbstractChestHorse;
boolean flag3 = !flag && flag2 && ((AbstractChestHorse)abstracthorse).hasChest();
float f1 = abstracthorse.getHorseSize();
boolean flag4 = abstracthorse.isBeingRidden();
if (flag1)
{
this.horseFaceRopes.render(scale);
this.horseSaddleBottom.render(scale);
this.horseSaddleFront.render(scale);
this.horseSaddleBack.render(scale);
this.horseLeftSaddleRope.render(scale);
this.horseLeftSaddleMetal.render(scale);
this.horseRightSaddleRope.render(scale);
this.horseRightSaddleMetal.render(scale);
this.horseLeftFaceMetal.render(scale);
this.horseRightFaceMetal.render(scale);
if (flag4)
{
this.horseLeftRein.render(scale);
this.horseRightRein.render(scale);
}
}
if (flag)
{
GlStateManager.pushMatrix();
GlStateManager.scale(f1, 0.5F + f1 * 0.5F, f1);
GlStateManager.translate(0.0F, 0.95F * (1.0F - f1), 0.0F);
}
this.backLeftLeg.render(scale);
this.backLeftShin.render(scale);
this.backLeftHoof.render(scale);
this.backRightLeg.render(scale);
this.backRightShin.render(scale);
this.backRightHoof.render(scale);
this.frontLeftLeg.render(scale);
this.frontLeftShin.render(scale);
this.frontLeftHoof.render(scale);
this.frontRightLeg.render(scale);
this.frontRightShin.render(scale);
this.frontRightHoof.render(scale);
if (flag)
{
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.scale(f1, f1, f1);
GlStateManager.translate(0.0F, 1.35F * (1.0F - f1), 0.0F);
}
this.body.render(scale);
this.tailBase.render(scale);
this.tailMiddle.render(scale);
this.tailTip.render(scale);
this.neck.render(scale);
this.mane.render(scale);
if (flag)
{
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
float f2 = 0.5F + f1 * f1 * 0.5F;
GlStateManager.scale(f2, f2, f2);
if (f <= 0.0F)
{
GlStateManager.translate(0.0F, 1.35F * (1.0F - f1), 0.0F);
}
else
{
GlStateManager.translate(0.0F, 0.9F * (1.0F - f1) * f + 1.35F * (1.0F - f1) * (1.0F - f), 0.15F * (1.0F - f1) * f);
}
}
if (flag2)
{
this.muleLeftEar.render(scale);
this.muleRightEar.render(scale);
}
else
{
this.horseLeftEar.render(scale);
this.horseRightEar.render(scale);
}
this.head.render(scale);
if (flag)
{
GlStateManager.popMatrix();
}
if (flag3)
{
this.muleLeftChest.render(scale);
this.muleRightChest.render(scale);
}
}
/**
* Fixes and offsets a rotation in the ModelHorse class.
*/
private float updateHorseRotation(float p_110683_1_, float p_110683_2_, float p_110683_3_)
{
float f;
for (f = p_110683_2_ - p_110683_1_; f < -180.0F; f += 360.0F)
{
;
}
while (f >= 180.0F)
{
f -= 360.0F;
}
return p_110683_1_ + p_110683_3_ * f;
}
/**
* Used for easily adding entity-dependent animations. The second and third float params here are the same second
* and third as in the setRotationAngles method.
*/
public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTickTime)
{
super.setLivingAnimations(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTickTime);
float f = this.updateHorseRotation(entitylivingbaseIn.prevRenderYawOffset, entitylivingbaseIn.renderYawOffset, partialTickTime);
float f1 = this.updateHorseRotation(entitylivingbaseIn.prevRotationYawHead, entitylivingbaseIn.rotationYawHead, partialTickTime);
float f2 = entitylivingbaseIn.prevRotationPitch + (entitylivingbaseIn.rotationPitch - entitylivingbaseIn.prevRotationPitch) * partialTickTime;
float f3 = f1 - f;
float f4 = f2 * 0.017453292F;
if (f3 > 20.0F)
{
f3 = 20.0F;
}
if (f3 < -20.0F)
{
f3 = -20.0F;
}
if (limbSwingAmount > 0.2F)
{
f4 += MathHelper.cos(limbSwing * 0.4F) * 0.15F * limbSwingAmount;
}
AbstractHorse abstracthorse = (AbstractHorse)entitylivingbaseIn;
float f5 = abstracthorse.getGrassEatingAmount(partialTickTime);
float f6 = abstracthorse.getRearingAmount(partialTickTime);
float f7 = 1.0F - f6;
float f8 = abstracthorse.getMouthOpennessAngle(partialTickTime);
boolean flag = abstracthorse.tailCounter != 0;
boolean flag1 = abstracthorse.isHorseSaddled();
boolean flag2 = abstracthorse.isBeingRidden();
float f9 = (float)entitylivingbaseIn.ticksExisted + partialTickTime;
float f10 = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI);
float f11 = f10 * 0.8F * limbSwingAmount;
this.head.rotationPointY = 4.0F;
this.head.rotationPointZ = -10.0F;
this.tailBase.rotationPointY = 3.0F;
this.tailMiddle.rotationPointZ = 14.0F;
this.muleRightChest.rotationPointY = 3.0F;
this.muleRightChest.rotationPointZ = 10.0F;
this.body.rotateAngleX = 0.0F;
this.head.rotateAngleX = 0.5235988F + f4;
this.head.rotateAngleY = f3 * 0.017453292F;
this.head.rotateAngleX = f6 * (0.2617994F + f4) + f5 * 2.1816616F + (1.0F - Math.max(f6, f5)) * this.head.rotateAngleX;
this.head.rotateAngleY = f6 * f3 * 0.017453292F + (1.0F - Math.max(f6, f5)) * this.head.rotateAngleY;
this.head.rotationPointY = f6 * -6.0F + f5 * 11.0F + (1.0F - Math.max(f6, f5)) * this.head.rotationPointY;
this.head.rotationPointZ = f6 * -1.0F + f5 * -10.0F + (1.0F - Math.max(f6, f5)) * this.head.rotationPointZ;
this.tailBase.rotationPointY = f6 * 9.0F + f7 * this.tailBase.rotationPointY;
this.tailMiddle.rotationPointZ = f6 * 18.0F + f7 * this.tailMiddle.rotationPointZ;
this.muleRightChest.rotationPointY = f6 * 5.5F + f7 * this.muleRightChest.rotationPointY;
this.muleRightChest.rotationPointZ = f6 * 15.0F + f7 * this.muleRightChest.rotationPointZ;
this.body.rotateAngleX = f6 * -((float)Math.PI / 4F) + f7 * this.body.rotateAngleX;
this.horseLeftEar.rotationPointY = this.head.rotationPointY;
this.horseRightEar.rotationPointY = this.head.rotationPointY;
this.muleLeftEar.rotationPointY = this.head.rotationPointY;
this.muleRightEar.rotationPointY = this.head.rotationPointY;
this.neck.rotationPointY = this.head.rotationPointY;
this.upperMouth.rotationPointY = 0.02F;
this.lowerMouth.rotationPointY = 0.0F;
this.mane.rotationPointY = this.head.rotationPointY;
this.horseLeftEar.rotationPointZ = this.head.rotationPointZ;
this.horseRightEar.rotationPointZ = this.head.rotationPointZ;
this.muleLeftEar.rotationPointZ = this.head.rotationPointZ;
this.muleRightEar.rotationPointZ = this.head.rotationPointZ;
this.neck.rotationPointZ = this.head.rotationPointZ;
this.upperMouth.rotationPointZ = 0.02F - f8;
this.lowerMouth.rotationPointZ = f8;
this.mane.rotationPointZ = this.head.rotationPointZ;
this.horseLeftEar.rotateAngleX = this.head.rotateAngleX;
this.horseRightEar.rotateAngleX = this.head.rotateAngleX;
this.muleLeftEar.rotateAngleX = this.head.rotateAngleX;
this.muleRightEar.rotateAngleX = this.head.rotateAngleX;
this.neck.rotateAngleX = this.head.rotateAngleX;
this.upperMouth.rotateAngleX = -0.09424778F * f8;
this.lowerMouth.rotateAngleX = 0.15707964F * f8;
this.mane.rotateAngleX = this.head.rotateAngleX;
this.horseLeftEar.rotateAngleY = this.head.rotateAngleY;
this.horseRightEar.rotateAngleY = this.head.rotateAngleY;
this.muleLeftEar.rotateAngleY = this.head.rotateAngleY;
this.muleRightEar.rotateAngleY = this.head.rotateAngleY;
this.neck.rotateAngleY = this.head.rotateAngleY;
this.upperMouth.rotateAngleY = 0.0F;
this.lowerMouth.rotateAngleY = 0.0F;
this.mane.rotateAngleY = this.head.rotateAngleY;
this.muleLeftChest.rotateAngleX = f11 / 5.0F;
this.muleRightChest.rotateAngleX = -f11 / 5.0F;
float f12 = 0.2617994F * f6;
float f13 = MathHelper.cos(f9 * 0.6F + (float)Math.PI);
this.frontLeftLeg.rotationPointY = -2.0F * f6 + 9.0F * f7;
this.frontLeftLeg.rotationPointZ = -2.0F * f6 + -8.0F * f7;
this.frontRightLeg.rotationPointY = this.frontLeftLeg.rotationPointY;
this.frontRightLeg.rotationPointZ = this.frontLeftLeg.rotationPointZ;
this.backLeftShin.rotationPointY = this.backLeftLeg.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + f12 + f7 * -f10 * 0.5F * limbSwingAmount) * 7.0F;
this.backLeftShin.rotationPointZ = this.backLeftLeg.rotationPointZ + MathHelper.cos(-((float)Math.PI / 2F) + f12 + f7 * -f10 * 0.5F * limbSwingAmount) * 7.0F;
this.backRightShin.rotationPointY = this.backRightLeg.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + f12 + f7 * f10 * 0.5F * limbSwingAmount) * 7.0F;
this.backRightShin.rotationPointZ = this.backRightLeg.rotationPointZ + MathHelper.cos(-((float)Math.PI / 2F) + f12 + f7 * f10 * 0.5F * limbSwingAmount) * 7.0F;
float f14 = (-1.0471976F + f13) * f6 + f11 * f7;
float f15 = (-1.0471976F - f13) * f6 + -f11 * f7;
this.frontLeftShin.rotationPointY = this.frontLeftLeg.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + f14) * 7.0F;
this.frontLeftShin.rotationPointZ = this.frontLeftLeg.rotationPointZ + MathHelper.cos(-((float)Math.PI / 2F) + f14) * 7.0F;
this.frontRightShin.rotationPointY = this.frontRightLeg.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + f15) * 7.0F;
this.frontRightShin.rotationPointZ = this.frontRightLeg.rotationPointZ + MathHelper.cos(-((float)Math.PI / 2F) + f15) * 7.0F;
this.backLeftLeg.rotateAngleX = f12 + -f10 * 0.5F * limbSwingAmount * f7;
this.backLeftShin.rotateAngleX = -0.08726646F * f6 + (-f10 * 0.5F * limbSwingAmount - Math.max(0.0F, f10 * 0.5F * limbSwingAmount)) * f7;
this.backLeftHoof.rotateAngleX = this.backLeftShin.rotateAngleX;
this.backRightLeg.rotateAngleX = f12 + f10 * 0.5F * limbSwingAmount * f7;
this.backRightShin.rotateAngleX = -0.08726646F * f6 + (f10 * 0.5F * limbSwingAmount - Math.max(0.0F, -f10 * 0.5F * limbSwingAmount)) * f7;
this.backRightHoof.rotateAngleX = this.backRightShin.rotateAngleX;
this.frontLeftLeg.rotateAngleX = f14;
this.frontLeftShin.rotateAngleX = (this.frontLeftLeg.rotateAngleX + (float)Math.PI * Math.max(0.0F, 0.2F + f13 * 0.2F)) * f6 + (f11 + Math.max(0.0F, f10 * 0.5F * limbSwingAmount)) * f7;
this.frontLeftHoof.rotateAngleX = this.frontLeftShin.rotateAngleX;
this.frontRightLeg.rotateAngleX = f15;
this.frontRightShin.rotateAngleX = (this.frontRightLeg.rotateAngleX + (float)Math.PI * Math.max(0.0F, 0.2F - f13 * 0.2F)) * f6 + (-f11 + Math.max(0.0F, -f10 * 0.5F * limbSwingAmount)) * f7;
this.frontRightHoof.rotateAngleX = this.frontRightShin.rotateAngleX;
this.backLeftHoof.rotationPointY = this.backLeftShin.rotationPointY;
this.backLeftHoof.rotationPointZ = this.backLeftShin.rotationPointZ;
this.backRightHoof.rotationPointY = this.backRightShin.rotationPointY;
this.backRightHoof.rotationPointZ = this.backRightShin.rotationPointZ;
this.frontLeftHoof.rotationPointY = this.frontLeftShin.rotationPointY;
this.frontLeftHoof.rotationPointZ = this.frontLeftShin.rotationPointZ;
this.frontRightHoof.rotationPointY = this.frontRightShin.rotationPointY;
this.frontRightHoof.rotationPointZ = this.frontRightShin.rotationPointZ;
if (flag1)
{
this.horseSaddleBottom.rotationPointY = f6 * 0.5F + f7 * 2.0F;
this.horseSaddleBottom.rotationPointZ = f6 * 11.0F + f7 * 2.0F;
this.horseSaddleFront.rotationPointY = this.horseSaddleBottom.rotationPointY;
this.horseSaddleBack.rotationPointY = this.horseSaddleBottom.rotationPointY;
this.horseLeftSaddleRope.rotationPointY = this.horseSaddleBottom.rotationPointY;
this.horseRightSaddleRope.rotationPointY = this.horseSaddleBottom.rotationPointY;
this.horseLeftSaddleMetal.rotationPointY = this.horseSaddleBottom.rotationPointY;
this.horseRightSaddleMetal.rotationPointY = this.horseSaddleBottom.rotationPointY;
this.muleLeftChest.rotationPointY = this.muleRightChest.rotationPointY;
this.horseSaddleFront.rotationPointZ = this.horseSaddleBottom.rotationPointZ;
this.horseSaddleBack.rotationPointZ = this.horseSaddleBottom.rotationPointZ;
this.horseLeftSaddleRope.rotationPointZ = this.horseSaddleBottom.rotationPointZ;
this.horseRightSaddleRope.rotationPointZ = this.horseSaddleBottom.rotationPointZ;
this.horseLeftSaddleMetal.rotationPointZ = this.horseSaddleBottom.rotationPointZ;
this.horseRightSaddleMetal.rotationPointZ = this.horseSaddleBottom.rotationPointZ;
this.muleLeftChest.rotationPointZ = this.muleRightChest.rotationPointZ;
this.horseSaddleBottom.rotateAngleX = this.body.rotateAngleX;
this.horseSaddleFront.rotateAngleX = this.body.rotateAngleX;
this.horseSaddleBack.rotateAngleX = this.body.rotateAngleX;
this.horseLeftRein.rotationPointY = this.head.rotationPointY;
this.horseRightRein.rotationPointY = this.head.rotationPointY;
this.horseFaceRopes.rotationPointY = this.head.rotationPointY;
this.horseLeftFaceMetal.rotationPointY = this.head.rotationPointY;
this.horseRightFaceMetal.rotationPointY = this.head.rotationPointY;
this.horseLeftRein.rotationPointZ = this.head.rotationPointZ;
this.horseRightRein.rotationPointZ = this.head.rotationPointZ;
this.horseFaceRopes.rotationPointZ = this.head.rotationPointZ;
this.horseLeftFaceMetal.rotationPointZ = this.head.rotationPointZ;
this.horseRightFaceMetal.rotationPointZ = this.head.rotationPointZ;
this.horseLeftRein.rotateAngleX = f4;
this.horseRightRein.rotateAngleX = f4;
this.horseFaceRopes.rotateAngleX = this.head.rotateAngleX;
this.horseLeftFaceMetal.rotateAngleX = this.head.rotateAngleX;
this.horseRightFaceMetal.rotateAngleX = this.head.rotateAngleX;
this.horseFaceRopes.rotateAngleY = this.head.rotateAngleY;
this.horseLeftFaceMetal.rotateAngleY = this.head.rotateAngleY;
this.horseLeftRein.rotateAngleY = this.head.rotateAngleY;
this.horseRightFaceMetal.rotateAngleY = this.head.rotateAngleY;
this.horseRightRein.rotateAngleY = this.head.rotateAngleY;
if (flag2)
{
this.horseLeftSaddleRope.rotateAngleX = -1.0471976F;
this.horseLeftSaddleMetal.rotateAngleX = -1.0471976F;
this.horseRightSaddleRope.rotateAngleX = -1.0471976F;
this.horseRightSaddleMetal.rotateAngleX = -1.0471976F;
this.horseLeftSaddleRope.rotateAngleZ = 0.0F;
this.horseLeftSaddleMetal.rotateAngleZ = 0.0F;
this.horseRightSaddleRope.rotateAngleZ = 0.0F;
this.horseRightSaddleMetal.rotateAngleZ = 0.0F;
}
else
{
this.horseLeftSaddleRope.rotateAngleX = f11 / 3.0F;
this.horseLeftSaddleMetal.rotateAngleX = f11 / 3.0F;
this.horseRightSaddleRope.rotateAngleX = f11 / 3.0F;
this.horseRightSaddleMetal.rotateAngleX = f11 / 3.0F;
this.horseLeftSaddleRope.rotateAngleZ = f11 / 5.0F;
this.horseLeftSaddleMetal.rotateAngleZ = f11 / 5.0F;
this.horseRightSaddleRope.rotateAngleZ = -f11 / 5.0F;
this.horseRightSaddleMetal.rotateAngleZ = -f11 / 5.0F;
}
}
f12 = -1.3089969F + limbSwingAmount * 1.5F;
if (f12 > 0.0F)
{
f12 = 0.0F;
}
if (flag)
{
this.tailBase.rotateAngleY = MathHelper.cos(f9 * 0.7F);
f12 = 0.0F;
}
else
{
this.tailBase.rotateAngleY = 0.0F;
}
this.tailMiddle.rotateAngleY = this.tailBase.rotateAngleY;
this.tailTip.rotateAngleY = this.tailBase.rotateAngleY;
this.tailMiddle.rotationPointY = this.tailBase.rotationPointY;
this.tailTip.rotationPointY = this.tailBase.rotationPointY;
this.tailMiddle.rotationPointZ = this.tailBase.rotationPointZ;
this.tailTip.rotationPointZ = this.tailBase.rotationPointZ;
this.tailBase.rotateAngleX = f12;
this.tailMiddle.rotateAngleX = f12;
this.tailTip.rotateAngleX = -0.2617994F + f12;
}
}

View File

@@ -0,0 +1,39 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelHumanoidHead extends ModelSkeletonHead
{
private final ModelRenderer head = new ModelRenderer(this, 32, 0);
public ModelHumanoidHead()
{
super(0, 0, 64, 64);
this.head.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.25F);
this.head.setRotationPoint(0.0F, 0.0F, 0.0F);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
super.render(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
this.head.render(scale);
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
this.head.rotateAngleY = this.skeletonHead.rotateAngleY;
this.head.rotateAngleX = this.skeletonHead.rotateAngleX;
}
}

View File

@@ -0,0 +1,162 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.AbstractIllager;
import net.minecraft.util.EnumHandSide;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelIllager extends ModelBase
{
public ModelRenderer head;
public ModelRenderer hat;
public ModelRenderer body;
public ModelRenderer arms;
public ModelRenderer leg0;
public ModelRenderer leg1;
public ModelRenderer nose;
public ModelRenderer rightArm;
public ModelRenderer leftArm;
public ModelIllager(float scaleFactor, float p_i47227_2_, int textureWidthIn, int textureHeightIn)
{
this.head = (new ModelRenderer(this)).setTextureSize(textureWidthIn, textureHeightIn);
this.head.setRotationPoint(0.0F, 0.0F + p_i47227_2_, 0.0F);
this.head.setTextureOffset(0, 0).addBox(-4.0F, -10.0F, -4.0F, 8, 10, 8, scaleFactor);
this.hat = (new ModelRenderer(this, 32, 0)).setTextureSize(textureWidthIn, textureHeightIn);
this.hat.addBox(-4.0F, -10.0F, -4.0F, 8, 12, 8, scaleFactor + 0.45F);
this.head.addChild(this.hat);
this.hat.showModel = false;
this.nose = (new ModelRenderer(this)).setTextureSize(textureWidthIn, textureHeightIn);
this.nose.setRotationPoint(0.0F, p_i47227_2_ - 2.0F, 0.0F);
this.nose.setTextureOffset(24, 0).addBox(-1.0F, -1.0F, -6.0F, 2, 4, 2, scaleFactor);
this.head.addChild(this.nose);
this.body = (new ModelRenderer(this)).setTextureSize(textureWidthIn, textureHeightIn);
this.body.setRotationPoint(0.0F, 0.0F + p_i47227_2_, 0.0F);
this.body.setTextureOffset(16, 20).addBox(-4.0F, 0.0F, -3.0F, 8, 12, 6, scaleFactor);
this.body.setTextureOffset(0, 38).addBox(-4.0F, 0.0F, -3.0F, 8, 18, 6, scaleFactor + 0.5F);
this.arms = (new ModelRenderer(this)).setTextureSize(textureWidthIn, textureHeightIn);
this.arms.setRotationPoint(0.0F, 0.0F + p_i47227_2_ + 2.0F, 0.0F);
this.arms.setTextureOffset(44, 22).addBox(-8.0F, -2.0F, -2.0F, 4, 8, 4, scaleFactor);
ModelRenderer modelrenderer = (new ModelRenderer(this, 44, 22)).setTextureSize(textureWidthIn, textureHeightIn);
modelrenderer.mirror = true;
modelrenderer.addBox(4.0F, -2.0F, -2.0F, 4, 8, 4, scaleFactor);
this.arms.addChild(modelrenderer);
this.arms.setTextureOffset(40, 38).addBox(-4.0F, 2.0F, -2.0F, 8, 4, 4, scaleFactor);
this.leg0 = (new ModelRenderer(this, 0, 22)).setTextureSize(textureWidthIn, textureHeightIn);
this.leg0.setRotationPoint(-2.0F, 12.0F + p_i47227_2_, 0.0F);
this.leg0.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, scaleFactor);
this.leg1 = (new ModelRenderer(this, 0, 22)).setTextureSize(textureWidthIn, textureHeightIn);
this.leg1.mirror = true;
this.leg1.setRotationPoint(2.0F, 12.0F + p_i47227_2_, 0.0F);
this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, scaleFactor);
this.rightArm = (new ModelRenderer(this, 40, 46)).setTextureSize(textureWidthIn, textureHeightIn);
this.rightArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, scaleFactor);
this.rightArm.setRotationPoint(-5.0F, 2.0F + p_i47227_2_, 0.0F);
this.leftArm = (new ModelRenderer(this, 40, 46)).setTextureSize(textureWidthIn, textureHeightIn);
this.leftArm.mirror = true;
this.leftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, scaleFactor);
this.leftArm.setRotationPoint(5.0F, 2.0F + p_i47227_2_, 0.0F);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
this.head.render(scale);
this.body.render(scale);
this.leg0.render(scale);
this.leg1.render(scale);
AbstractIllager abstractillager = (AbstractIllager)entityIn;
if (abstractillager.getArmPose() == AbstractIllager.IllagerArmPose.CROSSED)
{
this.arms.render(scale);
}
else
{
this.rightArm.render(scale);
this.leftArm.render(scale);
}
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
this.head.rotateAngleY = netHeadYaw * 0.017453292F;
this.head.rotateAngleX = headPitch * 0.017453292F;
this.arms.rotationPointY = 3.0F;
this.arms.rotationPointZ = -1.0F;
this.arms.rotateAngleX = -0.75F;
this.leg0.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount * 0.5F;
this.leg1.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.4F * limbSwingAmount * 0.5F;
this.leg0.rotateAngleY = 0.0F;
this.leg1.rotateAngleY = 0.0F;
AbstractIllager.IllagerArmPose abstractillager$illagerarmpose = ((AbstractIllager)entityIn).getArmPose();
if (abstractillager$illagerarmpose == AbstractIllager.IllagerArmPose.ATTACKING)
{
float f = MathHelper.sin(this.swingProgress * (float)Math.PI);
float f1 = MathHelper.sin((1.0F - (1.0F - this.swingProgress) * (1.0F - this.swingProgress)) * (float)Math.PI);
this.rightArm.rotateAngleZ = 0.0F;
this.leftArm.rotateAngleZ = 0.0F;
this.rightArm.rotateAngleY = 0.15707964F;
this.leftArm.rotateAngleY = -0.15707964F;
if (((EntityLivingBase)entityIn).getPrimaryHand() == EnumHandSide.RIGHT)
{
this.rightArm.rotateAngleX = -1.8849558F + MathHelper.cos(ageInTicks * 0.09F) * 0.15F;
this.leftArm.rotateAngleX = -0.0F + MathHelper.cos(ageInTicks * 0.19F) * 0.5F;
this.rightArm.rotateAngleX += f * 2.2F - f1 * 0.4F;
this.leftArm.rotateAngleX += f * 1.2F - f1 * 0.4F;
}
else
{
this.rightArm.rotateAngleX = -0.0F + MathHelper.cos(ageInTicks * 0.19F) * 0.5F;
this.leftArm.rotateAngleX = -1.8849558F + MathHelper.cos(ageInTicks * 0.09F) * 0.15F;
this.rightArm.rotateAngleX += f * 1.2F - f1 * 0.4F;
this.leftArm.rotateAngleX += f * 2.2F - f1 * 0.4F;
}
this.rightArm.rotateAngleZ += MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
this.leftArm.rotateAngleZ -= MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
this.rightArm.rotateAngleX += MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
this.leftArm.rotateAngleX -= MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
}
else if (abstractillager$illagerarmpose == AbstractIllager.IllagerArmPose.SPELLCASTING)
{
this.rightArm.rotationPointZ = 0.0F;
this.rightArm.rotationPointX = -5.0F;
this.leftArm.rotationPointZ = 0.0F;
this.leftArm.rotationPointX = 5.0F;
this.rightArm.rotateAngleX = MathHelper.cos(ageInTicks * 0.6662F) * 0.25F;
this.leftArm.rotateAngleX = MathHelper.cos(ageInTicks * 0.6662F) * 0.25F;
this.rightArm.rotateAngleZ = 2.3561945F;
this.leftArm.rotateAngleZ = -2.3561945F;
this.rightArm.rotateAngleY = 0.0F;
this.leftArm.rotateAngleY = 0.0F;
}
else if (abstractillager$illagerarmpose == AbstractIllager.IllagerArmPose.BOW_AND_ARROW)
{
this.rightArm.rotateAngleY = -0.1F + this.head.rotateAngleY;
this.rightArm.rotateAngleX = -((float)Math.PI / 2F) + this.head.rotateAngleX;
this.leftArm.rotateAngleX = -0.9424779F + this.head.rotateAngleX;
this.leftArm.rotateAngleY = this.head.rotateAngleY - 0.4F;
this.leftArm.rotateAngleZ = ((float)Math.PI / 2F);
}
}
public ModelRenderer getArm(EnumHandSide p_191216_1_)
{
return p_191216_1_ == EnumHandSide.LEFT ? this.leftArm : this.rightArm;
}
}

View File

@@ -0,0 +1,126 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityIronGolem;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelIronGolem extends ModelBase
{
/** The head model for the iron golem. */
public ModelRenderer ironGolemHead;
/** The body model for the iron golem. */
public ModelRenderer ironGolemBody;
/** The right arm model for the iron golem. */
public ModelRenderer ironGolemRightArm;
/** The left arm model for the iron golem. */
public ModelRenderer ironGolemLeftArm;
/** The left leg model for the Iron Golem. */
public ModelRenderer ironGolemLeftLeg;
/** The right leg model for the Iron Golem. */
public ModelRenderer ironGolemRightLeg;
public ModelIronGolem()
{
this(0.0F);
}
public ModelIronGolem(float p_i1161_1_)
{
this(p_i1161_1_, -7.0F);
}
public ModelIronGolem(float p_i46362_1_, float p_i46362_2_)
{
int i = 128;
int j = 128;
this.ironGolemHead = (new ModelRenderer(this)).setTextureSize(128, 128);
this.ironGolemHead.setRotationPoint(0.0F, 0.0F + p_i46362_2_, -2.0F);
this.ironGolemHead.setTextureOffset(0, 0).addBox(-4.0F, -12.0F, -5.5F, 8, 10, 8, p_i46362_1_);
this.ironGolemHead.setTextureOffset(24, 0).addBox(-1.0F, -5.0F, -7.5F, 2, 4, 2, p_i46362_1_);
this.ironGolemBody = (new ModelRenderer(this)).setTextureSize(128, 128);
this.ironGolemBody.setRotationPoint(0.0F, 0.0F + p_i46362_2_, 0.0F);
this.ironGolemBody.setTextureOffset(0, 40).addBox(-9.0F, -2.0F, -6.0F, 18, 12, 11, p_i46362_1_);
this.ironGolemBody.setTextureOffset(0, 70).addBox(-4.5F, 10.0F, -3.0F, 9, 5, 6, p_i46362_1_ + 0.5F);
this.ironGolemRightArm = (new ModelRenderer(this)).setTextureSize(128, 128);
this.ironGolemRightArm.setRotationPoint(0.0F, -7.0F, 0.0F);
this.ironGolemRightArm.setTextureOffset(60, 21).addBox(-13.0F, -2.5F, -3.0F, 4, 30, 6, p_i46362_1_);
this.ironGolemLeftArm = (new ModelRenderer(this)).setTextureSize(128, 128);
this.ironGolemLeftArm.setRotationPoint(0.0F, -7.0F, 0.0F);
this.ironGolemLeftArm.setTextureOffset(60, 58).addBox(9.0F, -2.5F, -3.0F, 4, 30, 6, p_i46362_1_);
this.ironGolemLeftLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(128, 128);
this.ironGolemLeftLeg.setRotationPoint(-4.0F, 18.0F + p_i46362_2_, 0.0F);
this.ironGolemLeftLeg.setTextureOffset(37, 0).addBox(-3.5F, -3.0F, -3.0F, 6, 16, 5, p_i46362_1_);
this.ironGolemRightLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(128, 128);
this.ironGolemRightLeg.mirror = true;
this.ironGolemRightLeg.setTextureOffset(60, 0).setRotationPoint(5.0F, 18.0F + p_i46362_2_, 0.0F);
this.ironGolemRightLeg.addBox(-3.5F, -3.0F, -3.0F, 6, 16, 5, p_i46362_1_);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
this.ironGolemHead.render(scale);
this.ironGolemBody.render(scale);
this.ironGolemLeftLeg.render(scale);
this.ironGolemRightLeg.render(scale);
this.ironGolemRightArm.render(scale);
this.ironGolemLeftArm.render(scale);
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
this.ironGolemHead.rotateAngleY = netHeadYaw * 0.017453292F;
this.ironGolemHead.rotateAngleX = headPitch * 0.017453292F;
this.ironGolemLeftLeg.rotateAngleX = -1.5F * this.triangleWave(limbSwing, 13.0F) * limbSwingAmount;
this.ironGolemRightLeg.rotateAngleX = 1.5F * this.triangleWave(limbSwing, 13.0F) * limbSwingAmount;
this.ironGolemLeftLeg.rotateAngleY = 0.0F;
this.ironGolemRightLeg.rotateAngleY = 0.0F;
}
/**
* Used for easily adding entity-dependent animations. The second and third float params here are the same second
* and third as in the setRotationAngles method.
*/
public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTickTime)
{
EntityIronGolem entityirongolem = (EntityIronGolem)entitylivingbaseIn;
int i = entityirongolem.getAttackTimer();
if (i > 0)
{
this.ironGolemRightArm.rotateAngleX = -2.0F + 1.5F * this.triangleWave((float)i - partialTickTime, 10.0F);
this.ironGolemLeftArm.rotateAngleX = -2.0F + 1.5F * this.triangleWave((float)i - partialTickTime, 10.0F);
}
else
{
int j = entityirongolem.getHoldRoseTick();
if (j > 0)
{
this.ironGolemRightArm.rotateAngleX = -0.8F + 0.025F * this.triangleWave((float)j, 70.0F);
this.ironGolemLeftArm.rotateAngleX = 0.0F;
}
else
{
this.ironGolemRightArm.rotateAngleX = (-0.2F + 1.5F * this.triangleWave(limbSwing, 13.0F)) * limbSwingAmount;
this.ironGolemLeftArm.rotateAngleX = (-0.2F - 1.5F * this.triangleWave(limbSwing, 13.0F)) * limbSwingAmount;
}
}
}
private float triangleWave(float p_78172_1_, float p_78172_2_)
{
return (Math.abs(p_78172_1_ % p_78172_2_ - p_78172_2_ * 0.5F) - p_78172_2_ * 0.25F) / (p_78172_2_ * 0.25F);
}
}

View File

@@ -0,0 +1,27 @@
package net.minecraft.client.model;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelLargeChest extends ModelChest
{
public ModelLargeChest()
{
this.chestLid = (new ModelRenderer(this, 0, 0)).setTextureSize(128, 64);
this.chestLid.addBox(0.0F, -5.0F, -14.0F, 30, 5, 14, 0.0F);
this.chestLid.rotationPointX = 1.0F;
this.chestLid.rotationPointY = 7.0F;
this.chestLid.rotationPointZ = 15.0F;
this.chestKnob = (new ModelRenderer(this, 0, 0)).setTextureSize(128, 64);
this.chestKnob.addBox(-1.0F, -2.0F, -15.0F, 2, 4, 1, 0.0F);
this.chestKnob.rotationPointX = 16.0F;
this.chestKnob.rotationPointY = 7.0F;
this.chestKnob.rotationPointZ = 15.0F;
this.chestBelow = (new ModelRenderer(this, 0, 19)).setTextureSize(128, 64);
this.chestBelow.addBox(0.0F, 0.0F, 0.0F, 30, 10, 14, 0.0F);
this.chestBelow.rotationPointX = 1.0F;
this.chestBelow.rotationPointY = 6.0F;
this.chestBelow.rotationPointZ = 1.0F;
}
}

View File

@@ -0,0 +1,46 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelLeashKnot extends ModelBase
{
public ModelRenderer knotRenderer;
public ModelLeashKnot()
{
this(0, 0, 32, 32);
}
public ModelLeashKnot(int p_i46365_1_, int p_i46365_2_, int p_i46365_3_, int p_i46365_4_)
{
this.textureWidth = p_i46365_3_;
this.textureHeight = p_i46365_4_;
this.knotRenderer = new ModelRenderer(this, p_i46365_1_, p_i46365_2_);
this.knotRenderer.addBox(-3.0F, -6.0F, -3.0F, 6, 8, 6, 0.0F);
this.knotRenderer.setRotationPoint(0.0F, 0.0F, 0.0F);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
this.knotRenderer.render(scale);
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
this.knotRenderer.rotateAngleY = netHeadYaw * 0.017453292F;
this.knotRenderer.rotateAngleX = headPitch * 0.017453292F;
}
}

View File

@@ -0,0 +1,114 @@
package net.minecraft.client.model;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.passive.AbstractChestHorse;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelLlama extends ModelQuadruped
{
private final ModelRenderer chest1;
private final ModelRenderer chest2;
public ModelLlama(float p_i47226_1_)
{
super(15, p_i47226_1_);
this.textureWidth = 128;
this.textureHeight = 64;
this.head = new ModelRenderer(this, 0, 0);
this.head.addBox(-2.0F, -14.0F, -10.0F, 4, 4, 9, p_i47226_1_);
this.head.setRotationPoint(0.0F, 7.0F, -6.0F);
this.head.setTextureOffset(0, 14).addBox(-4.0F, -16.0F, -6.0F, 8, 18, 6, p_i47226_1_);
this.head.setTextureOffset(17, 0).addBox(-4.0F, -19.0F, -4.0F, 3, 3, 2, p_i47226_1_);
this.head.setTextureOffset(17, 0).addBox(1.0F, -19.0F, -4.0F, 3, 3, 2, p_i47226_1_);
this.body = new ModelRenderer(this, 29, 0);
this.body.addBox(-6.0F, -10.0F, -7.0F, 12, 18, 10, p_i47226_1_);
this.body.setRotationPoint(0.0F, 5.0F, 2.0F);
this.chest1 = new ModelRenderer(this, 45, 28);
this.chest1.addBox(-3.0F, 0.0F, 0.0F, 8, 8, 3, p_i47226_1_);
this.chest1.setRotationPoint(-8.5F, 3.0F, 3.0F);
this.chest1.rotateAngleY = ((float)Math.PI / 2F);
this.chest2 = new ModelRenderer(this, 45, 41);
this.chest2.addBox(-3.0F, 0.0F, 0.0F, 8, 8, 3, p_i47226_1_);
this.chest2.setRotationPoint(5.5F, 3.0F, 3.0F);
this.chest2.rotateAngleY = ((float)Math.PI / 2F);
int i = 4;
int j = 14;
this.leg1 = new ModelRenderer(this, 29, 29);
this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, 14, 4, p_i47226_1_);
this.leg1.setRotationPoint(-2.5F, 10.0F, 6.0F);
this.leg2 = new ModelRenderer(this, 29, 29);
this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, 14, 4, p_i47226_1_);
this.leg2.setRotationPoint(2.5F, 10.0F, 6.0F);
this.leg3 = new ModelRenderer(this, 29, 29);
this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, 14, 4, p_i47226_1_);
this.leg3.setRotationPoint(-2.5F, 10.0F, -4.0F);
this.leg4 = new ModelRenderer(this, 29, 29);
this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, 14, 4, p_i47226_1_);
this.leg4.setRotationPoint(2.5F, 10.0F, -4.0F);
--this.leg1.rotationPointX;
++this.leg2.rotationPointX;
this.leg1.rotationPointZ += 0.0F;
this.leg2.rotationPointZ += 0.0F;
--this.leg3.rotationPointX;
++this.leg4.rotationPointX;
--this.leg3.rotationPointZ;
--this.leg4.rotationPointZ;
this.childZOffset += 2.0F;
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
AbstractChestHorse abstractchesthorse = (AbstractChestHorse)entityIn;
boolean flag = !abstractchesthorse.isChild() && abstractchesthorse.hasChest();
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
if (this.isChild)
{
float f = 2.0F;
GlStateManager.pushMatrix();
GlStateManager.translate(0.0F, this.childYOffset * scale, this.childZOffset * scale);
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
float f1 = 0.7F;
GlStateManager.scale(0.71428573F, 0.64935064F, 0.7936508F);
GlStateManager.translate(0.0F, 21.0F * scale, 0.22F);
this.head.render(scale);
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
float f2 = 1.1F;
GlStateManager.scale(0.625F, 0.45454544F, 0.45454544F);
GlStateManager.translate(0.0F, 33.0F * scale, 0.0F);
this.body.render(scale);
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.scale(0.45454544F, 0.41322312F, 0.45454544F);
GlStateManager.translate(0.0F, 33.0F * scale, 0.0F);
this.leg1.render(scale);
this.leg2.render(scale);
this.leg3.render(scale);
this.leg4.render(scale);
GlStateManager.popMatrix();
}
else
{
this.head.render(scale);
this.body.render(scale);
this.leg1.render(scale);
this.leg2.render(scale);
this.leg3.render(scale);
this.leg4.render(scale);
}
if (flag)
{
this.chest1.render(scale);
this.chest2.render(scale);
}
}
}

View File

@@ -0,0 +1,39 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelLlamaSpit extends ModelBase
{
private final ModelRenderer main;
public ModelLlamaSpit()
{
this(0.0F);
}
public ModelLlamaSpit(float p_i47225_1_)
{
this.main = new ModelRenderer(this);
int i = 2;
this.main.setTextureOffset(0, 0).addBox(-4.0F, 0.0F, 0.0F, 2, 2, 2, p_i47225_1_);
this.main.setTextureOffset(0, 0).addBox(0.0F, -4.0F, 0.0F, 2, 2, 2, p_i47225_1_);
this.main.setTextureOffset(0, 0).addBox(0.0F, 0.0F, -4.0F, 2, 2, 2, p_i47225_1_);
this.main.setTextureOffset(0, 0).addBox(0.0F, 0.0F, 0.0F, 2, 2, 2, p_i47225_1_);
this.main.setTextureOffset(0, 0).addBox(2.0F, 0.0F, 0.0F, 2, 2, 2, p_i47225_1_);
this.main.setTextureOffset(0, 0).addBox(0.0F, 2.0F, 0.0F, 2, 2, 2, p_i47225_1_);
this.main.setTextureOffset(0, 0).addBox(0.0F, 0.0F, 2.0F, 2, 2, 2, p_i47225_1_);
this.main.setRotationPoint(0.0F, 0.0F, 0.0F);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
this.main.render(scale);
}
}

View File

@@ -0,0 +1,74 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityMagmaCube;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelMagmaCube extends ModelBase
{
ModelRenderer[] segments = new ModelRenderer[8];
ModelRenderer core;
public ModelMagmaCube()
{
for (int i = 0; i < this.segments.length; ++i)
{
int j = 0;
int k = i;
if (i == 2)
{
j = 24;
k = 10;
}
else if (i == 3)
{
j = 24;
k = 19;
}
this.segments[i] = new ModelRenderer(this, j, k);
this.segments[i].addBox(-4.0F, (float)(16 + i), -4.0F, 8, 1, 8);
}
this.core = new ModelRenderer(this, 0, 16);
this.core.addBox(-2.0F, 18.0F, -2.0F, 4, 4, 4);
}
/**
* Used for easily adding entity-dependent animations. The second and third float params here are the same second
* and third as in the setRotationAngles method.
*/
public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTickTime)
{
EntityMagmaCube entitymagmacube = (EntityMagmaCube)entitylivingbaseIn;
float f = entitymagmacube.prevSquishFactor + (entitymagmacube.squishFactor - entitymagmacube.prevSquishFactor) * partialTickTime;
if (f < 0.0F)
{
f = 0.0F;
}
for (int i = 0; i < this.segments.length; ++i)
{
this.segments[i].rotationPointY = (float)(-(4 - i)) * f * 1.7F;
}
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
this.core.render(scale);
for (ModelRenderer modelrenderer : this.segments)
{
modelrenderer.render(scale);
}
}
}

View File

@@ -0,0 +1,55 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelMinecart extends ModelBase
{
public ModelRenderer[] sideModels = new ModelRenderer[7];
public ModelMinecart()
{
this.sideModels[0] = new ModelRenderer(this, 0, 10);
this.sideModels[1] = new ModelRenderer(this, 0, 0);
this.sideModels[2] = new ModelRenderer(this, 0, 0);
this.sideModels[3] = new ModelRenderer(this, 0, 0);
this.sideModels[4] = new ModelRenderer(this, 0, 0);
this.sideModels[5] = new ModelRenderer(this, 44, 10);
int i = 20;
int j = 8;
int k = 16;
int l = 4;
this.sideModels[0].addBox(-10.0F, -8.0F, -1.0F, 20, 16, 2, 0.0F);
this.sideModels[0].setRotationPoint(0.0F, 4.0F, 0.0F);
this.sideModels[5].addBox(-9.0F, -7.0F, -1.0F, 18, 14, 1, 0.0F);
this.sideModels[5].setRotationPoint(0.0F, 4.0F, 0.0F);
this.sideModels[1].addBox(-8.0F, -9.0F, -1.0F, 16, 8, 2, 0.0F);
this.sideModels[1].setRotationPoint(-9.0F, 4.0F, 0.0F);
this.sideModels[2].addBox(-8.0F, -9.0F, -1.0F, 16, 8, 2, 0.0F);
this.sideModels[2].setRotationPoint(9.0F, 4.0F, 0.0F);
this.sideModels[3].addBox(-8.0F, -9.0F, -1.0F, 16, 8, 2, 0.0F);
this.sideModels[3].setRotationPoint(0.0F, 4.0F, -7.0F);
this.sideModels[4].addBox(-8.0F, -9.0F, -1.0F, 16, 8, 2, 0.0F);
this.sideModels[4].setRotationPoint(0.0F, 4.0F, 7.0F);
this.sideModels[0].rotateAngleX = ((float)Math.PI / 2F);
this.sideModels[1].rotateAngleY = ((float)Math.PI * 3F / 2F);
this.sideModels[2].rotateAngleY = ((float)Math.PI / 2F);
this.sideModels[3].rotateAngleY = (float)Math.PI;
this.sideModels[5].rotateAngleX = -((float)Math.PI / 2F);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.sideModels[5].rotationPointY = 4.0F - ageInTicks;
for (int i = 0; i < 6; ++i)
{
this.sideModels[i].render(scale);
}
}
}

View File

@@ -0,0 +1,225 @@
package net.minecraft.client.model;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.passive.EntityOcelot;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelOcelot extends ModelBase
{
/** The back left leg model for the Ocelot. */
private final ModelRenderer ocelotBackLeftLeg;
/** The back right leg model for the Ocelot. */
private final ModelRenderer ocelotBackRightLeg;
/** The front left leg model for the Ocelot. */
private final ModelRenderer ocelotFrontLeftLeg;
/** The front right leg model for the Ocelot. */
private final ModelRenderer ocelotFrontRightLeg;
/** The tail model for the Ocelot. */
private final ModelRenderer ocelotTail;
/** The second part of tail model for the Ocelot. */
private final ModelRenderer ocelotTail2;
/** The head model for the Ocelot. */
private final ModelRenderer ocelotHead;
/** The body model for the Ocelot. */
private final ModelRenderer ocelotBody;
private int state = 1;
public ModelOcelot()
{
this.setTextureOffset("head.main", 0, 0);
this.setTextureOffset("head.nose", 0, 24);
this.setTextureOffset("head.ear1", 0, 10);
this.setTextureOffset("head.ear2", 6, 10);
this.ocelotHead = new ModelRenderer(this, "head");
this.ocelotHead.addBox("main", -2.5F, -2.0F, -3.0F, 5, 4, 5);
this.ocelotHead.addBox("nose", -1.5F, 0.0F, -4.0F, 3, 2, 2);
this.ocelotHead.addBox("ear1", -2.0F, -3.0F, 0.0F, 1, 1, 2);
this.ocelotHead.addBox("ear2", 1.0F, -3.0F, 0.0F, 1, 1, 2);
this.ocelotHead.setRotationPoint(0.0F, 15.0F, -9.0F);
this.ocelotBody = new ModelRenderer(this, 20, 0);
this.ocelotBody.addBox(-2.0F, 3.0F, -8.0F, 4, 16, 6, 0.0F);
this.ocelotBody.setRotationPoint(0.0F, 12.0F, -10.0F);
this.ocelotTail = new ModelRenderer(this, 0, 15);
this.ocelotTail.addBox(-0.5F, 0.0F, 0.0F, 1, 8, 1);
this.ocelotTail.rotateAngleX = 0.9F;
this.ocelotTail.setRotationPoint(0.0F, 15.0F, 8.0F);
this.ocelotTail2 = new ModelRenderer(this, 4, 15);
this.ocelotTail2.addBox(-0.5F, 0.0F, 0.0F, 1, 8, 1);
this.ocelotTail2.setRotationPoint(0.0F, 20.0F, 14.0F);
this.ocelotBackLeftLeg = new ModelRenderer(this, 8, 13);
this.ocelotBackLeftLeg.addBox(-1.0F, 0.0F, 1.0F, 2, 6, 2);
this.ocelotBackLeftLeg.setRotationPoint(1.1F, 18.0F, 5.0F);
this.ocelotBackRightLeg = new ModelRenderer(this, 8, 13);
this.ocelotBackRightLeg.addBox(-1.0F, 0.0F, 1.0F, 2, 6, 2);
this.ocelotBackRightLeg.setRotationPoint(-1.1F, 18.0F, 5.0F);
this.ocelotFrontLeftLeg = new ModelRenderer(this, 40, 0);
this.ocelotFrontLeftLeg.addBox(-1.0F, 0.0F, 0.0F, 2, 10, 2);
this.ocelotFrontLeftLeg.setRotationPoint(1.2F, 13.8F, -5.0F);
this.ocelotFrontRightLeg = new ModelRenderer(this, 40, 0);
this.ocelotFrontRightLeg.addBox(-1.0F, 0.0F, 0.0F, 2, 10, 2);
this.ocelotFrontRightLeg.setRotationPoint(-1.2F, 13.8F, -5.0F);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
if (this.isChild)
{
float f = 2.0F;
GlStateManager.pushMatrix();
GlStateManager.scale(0.75F, 0.75F, 0.75F);
GlStateManager.translate(0.0F, 10.0F * scale, 4.0F * scale);
this.ocelotHead.render(scale);
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.scale(0.5F, 0.5F, 0.5F);
GlStateManager.translate(0.0F, 24.0F * scale, 0.0F);
this.ocelotBody.render(scale);
this.ocelotBackLeftLeg.render(scale);
this.ocelotBackRightLeg.render(scale);
this.ocelotFrontLeftLeg.render(scale);
this.ocelotFrontRightLeg.render(scale);
this.ocelotTail.render(scale);
this.ocelotTail2.render(scale);
GlStateManager.popMatrix();
}
else
{
this.ocelotHead.render(scale);
this.ocelotBody.render(scale);
this.ocelotTail.render(scale);
this.ocelotTail2.render(scale);
this.ocelotBackLeftLeg.render(scale);
this.ocelotBackRightLeg.render(scale);
this.ocelotFrontLeftLeg.render(scale);
this.ocelotFrontRightLeg.render(scale);
}
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
this.ocelotHead.rotateAngleX = headPitch * 0.017453292F;
this.ocelotHead.rotateAngleY = netHeadYaw * 0.017453292F;
if (this.state != 3)
{
this.ocelotBody.rotateAngleX = ((float)Math.PI / 2F);
if (this.state == 2)
{
this.ocelotBackLeftLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * limbSwingAmount;
this.ocelotBackRightLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + 0.3F) * limbSwingAmount;
this.ocelotFrontLeftLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI + 0.3F) * limbSwingAmount;
this.ocelotFrontRightLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * limbSwingAmount;
this.ocelotTail2.rotateAngleX = 1.7278761F + ((float)Math.PI / 10F) * MathHelper.cos(limbSwing) * limbSwingAmount;
}
else
{
this.ocelotBackLeftLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * limbSwingAmount;
this.ocelotBackRightLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * limbSwingAmount;
this.ocelotFrontLeftLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * limbSwingAmount;
this.ocelotFrontRightLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * limbSwingAmount;
if (this.state == 1)
{
this.ocelotTail2.rotateAngleX = 1.7278761F + ((float)Math.PI / 4F) * MathHelper.cos(limbSwing) * limbSwingAmount;
}
else
{
this.ocelotTail2.rotateAngleX = 1.7278761F + 0.47123894F * MathHelper.cos(limbSwing) * limbSwingAmount;
}
}
}
}
/**
* Used for easily adding entity-dependent animations. The second and third float params here are the same second
* and third as in the setRotationAngles method.
*/
public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTickTime)
{
EntityOcelot entityocelot = (EntityOcelot)entitylivingbaseIn;
this.ocelotBody.rotationPointY = 12.0F;
this.ocelotBody.rotationPointZ = -10.0F;
this.ocelotHead.rotationPointY = 15.0F;
this.ocelotHead.rotationPointZ = -9.0F;
this.ocelotTail.rotationPointY = 15.0F;
this.ocelotTail.rotationPointZ = 8.0F;
this.ocelotTail2.rotationPointY = 20.0F;
this.ocelotTail2.rotationPointZ = 14.0F;
this.ocelotFrontLeftLeg.rotationPointY = 13.8F;
this.ocelotFrontLeftLeg.rotationPointZ = -5.0F;
this.ocelotFrontRightLeg.rotationPointY = 13.8F;
this.ocelotFrontRightLeg.rotationPointZ = -5.0F;
this.ocelotBackLeftLeg.rotationPointY = 18.0F;
this.ocelotBackLeftLeg.rotationPointZ = 5.0F;
this.ocelotBackRightLeg.rotationPointY = 18.0F;
this.ocelotBackRightLeg.rotationPointZ = 5.0F;
this.ocelotTail.rotateAngleX = 0.9F;
if (entityocelot.isSneaking())
{
++this.ocelotBody.rotationPointY;
this.ocelotHead.rotationPointY += 2.0F;
++this.ocelotTail.rotationPointY;
this.ocelotTail2.rotationPointY += -4.0F;
this.ocelotTail2.rotationPointZ += 2.0F;
this.ocelotTail.rotateAngleX = ((float)Math.PI / 2F);
this.ocelotTail2.rotateAngleX = ((float)Math.PI / 2F);
this.state = 0;
}
else if (entityocelot.isSprinting())
{
this.ocelotTail2.rotationPointY = this.ocelotTail.rotationPointY;
this.ocelotTail2.rotationPointZ += 2.0F;
this.ocelotTail.rotateAngleX = ((float)Math.PI / 2F);
this.ocelotTail2.rotateAngleX = ((float)Math.PI / 2F);
this.state = 2;
}
else if (entityocelot.isSitting())
{
this.ocelotBody.rotateAngleX = ((float)Math.PI / 4F);
this.ocelotBody.rotationPointY += -4.0F;
this.ocelotBody.rotationPointZ += 5.0F;
this.ocelotHead.rotationPointY += -3.3F;
++this.ocelotHead.rotationPointZ;
this.ocelotTail.rotationPointY += 8.0F;
this.ocelotTail.rotationPointZ += -2.0F;
this.ocelotTail2.rotationPointY += 2.0F;
this.ocelotTail2.rotationPointZ += -0.8F;
this.ocelotTail.rotateAngleX = 1.7278761F;
this.ocelotTail2.rotateAngleX = 2.670354F;
this.ocelotFrontLeftLeg.rotateAngleX = -0.15707964F;
this.ocelotFrontLeftLeg.rotationPointY = 15.8F;
this.ocelotFrontLeftLeg.rotationPointZ = -7.0F;
this.ocelotFrontRightLeg.rotateAngleX = -0.15707964F;
this.ocelotFrontRightLeg.rotationPointY = 15.8F;
this.ocelotFrontRightLeg.rotationPointZ = -7.0F;
this.ocelotBackLeftLeg.rotateAngleX = -((float)Math.PI / 2F);
this.ocelotBackLeftLeg.rotationPointY = 21.0F;
this.ocelotBackLeftLeg.rotationPointZ = 1.0F;
this.ocelotBackRightLeg.rotateAngleX = -((float)Math.PI / 2F);
this.ocelotBackRightLeg.rotationPointY = 21.0F;
this.ocelotBackRightLeg.rotationPointZ = 1.0F;
this.state = 3;
}
else
{
this.state = 1;
}
}
}

View File

@@ -0,0 +1,215 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.passive.EntityParrot;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelParrot extends ModelBase
{
ModelRenderer body;
ModelRenderer tail;
ModelRenderer wingLeft;
ModelRenderer wingRight;
ModelRenderer head;
ModelRenderer head2;
ModelRenderer beak1;
ModelRenderer beak2;
ModelRenderer feather;
ModelRenderer legLeft;
ModelRenderer legRight;
private ModelParrot.State state = ModelParrot.State.STANDING;
public ModelParrot()
{
this.textureWidth = 32;
this.textureHeight = 32;
this.body = new ModelRenderer(this, 2, 8);
this.body.addBox(-1.5F, 0.0F, -1.5F, 3, 6, 3);
this.body.setRotationPoint(0.0F, 16.5F, -3.0F);
this.tail = new ModelRenderer(this, 22, 1);
this.tail.addBox(-1.5F, -1.0F, -1.0F, 3, 4, 1);
this.tail.setRotationPoint(0.0F, 21.07F, 1.16F);
this.wingLeft = new ModelRenderer(this, 19, 8);
this.wingLeft.addBox(-0.5F, 0.0F, -1.5F, 1, 5, 3);
this.wingLeft.setRotationPoint(1.5F, 16.94F, -2.76F);
this.wingRight = new ModelRenderer(this, 19, 8);
this.wingRight.addBox(-0.5F, 0.0F, -1.5F, 1, 5, 3);
this.wingRight.setRotationPoint(-1.5F, 16.94F, -2.76F);
this.head = new ModelRenderer(this, 2, 2);
this.head.addBox(-1.0F, -1.5F, -1.0F, 2, 3, 2);
this.head.setRotationPoint(0.0F, 15.69F, -2.76F);
this.head2 = new ModelRenderer(this, 10, 0);
this.head2.addBox(-1.0F, -0.5F, -2.0F, 2, 1, 4);
this.head2.setRotationPoint(0.0F, -2.0F, -1.0F);
this.head.addChild(this.head2);
this.beak1 = new ModelRenderer(this, 11, 7);
this.beak1.addBox(-0.5F, -1.0F, -0.5F, 1, 2, 1);
this.beak1.setRotationPoint(0.0F, -0.5F, -1.5F);
this.head.addChild(this.beak1);
this.beak2 = new ModelRenderer(this, 16, 7);
this.beak2.addBox(-0.5F, 0.0F, -0.5F, 1, 2, 1);
this.beak2.setRotationPoint(0.0F, -1.75F, -2.45F);
this.head.addChild(this.beak2);
this.feather = new ModelRenderer(this, 2, 18);
this.feather.addBox(0.0F, -4.0F, -2.0F, 0, 5, 4);
this.feather.setRotationPoint(0.0F, -2.15F, 0.15F);
this.head.addChild(this.feather);
this.legLeft = new ModelRenderer(this, 14, 18);
this.legLeft.addBox(-0.5F, 0.0F, -0.5F, 1, 2, 1);
this.legLeft.setRotationPoint(1.0F, 22.0F, -1.05F);
this.legRight = new ModelRenderer(this, 14, 18);
this.legRight.addBox(-0.5F, 0.0F, -0.5F, 1, 2, 1);
this.legRight.setRotationPoint(-1.0F, 22.0F, -1.05F);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.body.render(scale);
this.wingLeft.render(scale);
this.wingRight.render(scale);
this.tail.render(scale);
this.head.render(scale);
this.legLeft.render(scale);
this.legRight.render(scale);
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
float f = ageInTicks * 0.3F;
this.head.rotateAngleX = headPitch * 0.017453292F;
this.head.rotateAngleY = netHeadYaw * 0.017453292F;
this.head.rotateAngleZ = 0.0F;
this.head.rotationPointX = 0.0F;
this.body.rotationPointX = 0.0F;
this.tail.rotationPointX = 0.0F;
this.wingRight.rotationPointX = -1.5F;
this.wingLeft.rotationPointX = 1.5F;
if (this.state != ModelParrot.State.FLYING)
{
if (this.state == ModelParrot.State.SITTING)
{
return;
}
if (this.state == ModelParrot.State.PARTY)
{
float f1 = MathHelper.cos((float)entityIn.ticksExisted);
float f2 = MathHelper.sin((float)entityIn.ticksExisted);
this.head.rotationPointX = f1;
this.head.rotationPointY = 15.69F + f2;
this.head.rotateAngleX = 0.0F;
this.head.rotateAngleY = 0.0F;
this.head.rotateAngleZ = MathHelper.sin((float)entityIn.ticksExisted) * 0.4F;
this.body.rotationPointX = f1;
this.body.rotationPointY = 16.5F + f2;
this.wingLeft.rotateAngleZ = -0.0873F - ageInTicks;
this.wingLeft.rotationPointX = 1.5F + f1;
this.wingLeft.rotationPointY = 16.94F + f2;
this.wingRight.rotateAngleZ = 0.0873F + ageInTicks;
this.wingRight.rotationPointX = -1.5F + f1;
this.wingRight.rotationPointY = 16.94F + f2;
this.tail.rotationPointX = f1;
this.tail.rotationPointY = 21.07F + f2;
return;
}
this.legLeft.rotateAngleX += MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount;
this.legRight.rotateAngleX += MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.4F * limbSwingAmount;
}
this.head.rotationPointY = 15.69F + f;
this.tail.rotateAngleX = 1.015F + MathHelper.cos(limbSwing * 0.6662F) * 0.3F * limbSwingAmount;
this.tail.rotationPointY = 21.07F + f;
this.body.rotationPointY = 16.5F + f;
this.wingLeft.rotateAngleZ = -0.0873F - ageInTicks;
this.wingLeft.rotationPointY = 16.94F + f;
this.wingRight.rotateAngleZ = 0.0873F + ageInTicks;
this.wingRight.rotationPointY = 16.94F + f;
this.legLeft.rotationPointY = 22.0F + f;
this.legRight.rotationPointY = 22.0F + f;
}
/**
* Used for easily adding entity-dependent animations. The second and third float params here are the same second
* and third as in the setRotationAngles method.
*/
public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTickTime)
{
this.feather.rotateAngleX = -0.2214F;
this.body.rotateAngleX = 0.4937F;
this.wingLeft.rotateAngleX = -((float)Math.PI * 2F / 9F);
this.wingLeft.rotateAngleY = -(float)Math.PI;
this.wingRight.rotateAngleX = -((float)Math.PI * 2F / 9F);
this.wingRight.rotateAngleY = -(float)Math.PI;
this.legLeft.rotateAngleX = -0.0299F;
this.legRight.rotateAngleX = -0.0299F;
this.legLeft.rotationPointY = 22.0F;
this.legRight.rotationPointY = 22.0F;
if (entitylivingbaseIn instanceof EntityParrot)
{
EntityParrot entityparrot = (EntityParrot)entitylivingbaseIn;
if (entityparrot.isPartying())
{
this.legLeft.rotateAngleZ = -0.34906584F;
this.legRight.rotateAngleZ = 0.34906584F;
this.state = ModelParrot.State.PARTY;
return;
}
if (entityparrot.isSitting())
{
float f = 1.9F;
this.head.rotationPointY = 17.59F;
this.tail.rotateAngleX = 1.5388988F;
this.tail.rotationPointY = 22.97F;
this.body.rotationPointY = 18.4F;
this.wingLeft.rotateAngleZ = -0.0873F;
this.wingLeft.rotationPointY = 18.84F;
this.wingRight.rotateAngleZ = 0.0873F;
this.wingRight.rotationPointY = 18.84F;
++this.legLeft.rotationPointY;
++this.legRight.rotationPointY;
++this.legLeft.rotateAngleX;
++this.legRight.rotateAngleX;
this.state = ModelParrot.State.SITTING;
}
else if (entityparrot.isFlying())
{
this.legLeft.rotateAngleX += ((float)Math.PI * 2F / 9F);
this.legRight.rotateAngleX += ((float)Math.PI * 2F / 9F);
this.state = ModelParrot.State.FLYING;
}
else
{
this.state = ModelParrot.State.STANDING;
}
this.legLeft.rotateAngleZ = 0.0F;
this.legRight.rotateAngleZ = 0.0F;
}
}
@SideOnly(Side.CLIENT)
static enum State
{
FLYING,
STANDING,
SITTING,
PARTY;
}
}

View File

@@ -0,0 +1,20 @@
package net.minecraft.client.model;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelPig extends ModelQuadruped
{
public ModelPig()
{
this(0.0F);
}
public ModelPig(float scale)
{
super(6, scale);
this.head.setTextureOffset(16, 16).addBox(-2.0F, 0.0F, -9.0F, 4, 3, 1, scale);
this.childYOffset = 4.0F;
}
}

View File

@@ -0,0 +1,174 @@
package net.minecraft.client.model;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.util.EnumHandSide;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelPlayer extends ModelBiped
{
public ModelRenderer bipedLeftArmwear;
public ModelRenderer bipedRightArmwear;
public ModelRenderer bipedLeftLegwear;
public ModelRenderer bipedRightLegwear;
public ModelRenderer bipedBodyWear;
private final ModelRenderer bipedCape;
private final ModelRenderer bipedDeadmau5Head;
private final boolean smallArms;
public ModelPlayer(float modelSize, boolean smallArmsIn)
{
super(modelSize, 0.0F, 64, 64);
this.smallArms = smallArmsIn;
this.bipedDeadmau5Head = new ModelRenderer(this, 24, 0);
this.bipedDeadmau5Head.addBox(-3.0F, -6.0F, -1.0F, 6, 6, 1, modelSize);
this.bipedCape = new ModelRenderer(this, 0, 0);
this.bipedCape.setTextureSize(64, 32);
this.bipedCape.addBox(-5.0F, 0.0F, -1.0F, 10, 16, 1, modelSize);
if (smallArmsIn)
{
this.bipedLeftArm = new ModelRenderer(this, 32, 48);
this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 3, 12, 4, modelSize);
this.bipedLeftArm.setRotationPoint(5.0F, 2.5F, 0.0F);
this.bipedRightArm = new ModelRenderer(this, 40, 16);
this.bipedRightArm.addBox(-2.0F, -2.0F, -2.0F, 3, 12, 4, modelSize);
this.bipedRightArm.setRotationPoint(-5.0F, 2.5F, 0.0F);
this.bipedLeftArmwear = new ModelRenderer(this, 48, 48);
this.bipedLeftArmwear.addBox(-1.0F, -2.0F, -2.0F, 3, 12, 4, modelSize + 0.25F);
this.bipedLeftArmwear.setRotationPoint(5.0F, 2.5F, 0.0F);
this.bipedRightArmwear = new ModelRenderer(this, 40, 32);
this.bipedRightArmwear.addBox(-2.0F, -2.0F, -2.0F, 3, 12, 4, modelSize + 0.25F);
this.bipedRightArmwear.setRotationPoint(-5.0F, 2.5F, 10.0F);
}
else
{
this.bipedLeftArm = new ModelRenderer(this, 32, 48);
this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, modelSize);
this.bipedLeftArm.setRotationPoint(5.0F, 2.0F, 0.0F);
this.bipedLeftArmwear = new ModelRenderer(this, 48, 48);
this.bipedLeftArmwear.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, modelSize + 0.25F);
this.bipedLeftArmwear.setRotationPoint(5.0F, 2.0F, 0.0F);
this.bipedRightArmwear = new ModelRenderer(this, 40, 32);
this.bipedRightArmwear.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, modelSize + 0.25F);
this.bipedRightArmwear.setRotationPoint(-5.0F, 2.0F, 10.0F);
}
this.bipedLeftLeg = new ModelRenderer(this, 16, 48);
this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, modelSize);
this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F, 0.0F);
this.bipedLeftLegwear = new ModelRenderer(this, 0, 48);
this.bipedLeftLegwear.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, modelSize + 0.25F);
this.bipedLeftLegwear.setRotationPoint(1.9F, 12.0F, 0.0F);
this.bipedRightLegwear = new ModelRenderer(this, 0, 32);
this.bipedRightLegwear.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, modelSize + 0.25F);
this.bipedRightLegwear.setRotationPoint(-1.9F, 12.0F, 0.0F);
this.bipedBodyWear = new ModelRenderer(this, 16, 32);
this.bipedBodyWear.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, modelSize + 0.25F);
this.bipedBodyWear.setRotationPoint(0.0F, 0.0F, 0.0F);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
super.render(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
GlStateManager.pushMatrix();
if (this.isChild)
{
float f = 2.0F;
GlStateManager.scale(0.5F, 0.5F, 0.5F);
GlStateManager.translate(0.0F, 24.0F * scale, 0.0F);
this.bipedLeftLegwear.render(scale);
this.bipedRightLegwear.render(scale);
this.bipedLeftArmwear.render(scale);
this.bipedRightArmwear.render(scale);
this.bipedBodyWear.render(scale);
}
else
{
if (entityIn.isSneaking())
{
GlStateManager.translate(0.0F, 0.2F, 0.0F);
}
this.bipedLeftLegwear.render(scale);
this.bipedRightLegwear.render(scale);
this.bipedLeftArmwear.render(scale);
this.bipedRightArmwear.render(scale);
this.bipedBodyWear.render(scale);
}
GlStateManager.popMatrix();
}
public void renderDeadmau5Head(float scale)
{
copyModelAngles(this.bipedHead, this.bipedDeadmau5Head);
this.bipedDeadmau5Head.rotationPointX = 0.0F;
this.bipedDeadmau5Head.rotationPointY = 0.0F;
this.bipedDeadmau5Head.render(scale);
}
public void renderCape(float scale)
{
this.bipedCape.render(scale);
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
copyModelAngles(this.bipedLeftLeg, this.bipedLeftLegwear);
copyModelAngles(this.bipedRightLeg, this.bipedRightLegwear);
copyModelAngles(this.bipedLeftArm, this.bipedLeftArmwear);
copyModelAngles(this.bipedRightArm, this.bipedRightArmwear);
copyModelAngles(this.bipedBody, this.bipedBodyWear);
if (entityIn.isSneaking())
{
this.bipedCape.rotationPointY = 2.0F;
}
else
{
this.bipedCape.rotationPointY = 0.0F;
}
}
public void setVisible(boolean visible)
{
super.setVisible(visible);
this.bipedLeftArmwear.showModel = visible;
this.bipedRightArmwear.showModel = visible;
this.bipedLeftLegwear.showModel = visible;
this.bipedRightLegwear.showModel = visible;
this.bipedBodyWear.showModel = visible;
this.bipedCape.showModel = visible;
this.bipedDeadmau5Head.showModel = visible;
}
public void postRenderArm(float scale, EnumHandSide side)
{
ModelRenderer modelrenderer = this.getArmForSide(side);
if (this.smallArms)
{
float f = 0.5F * (float)(side == EnumHandSide.RIGHT ? 1 : -1);
modelrenderer.rotationPointX += f;
modelrenderer.postRender(scale);
modelrenderer.rotationPointX -= f;
}
else
{
modelrenderer.postRender(scale);
}
}
}

View File

@@ -0,0 +1,115 @@
package net.minecraft.client.model;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.monster.EntityPolarBear;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelPolarBear extends ModelQuadruped
{
public ModelPolarBear()
{
super(12, 0.0F);
this.textureWidth = 128;
this.textureHeight = 64;
this.head = new ModelRenderer(this, 0, 0);
this.head.addBox(-3.5F, -3.0F, -3.0F, 7, 7, 7, 0.0F);
this.head.setRotationPoint(0.0F, 10.0F, -16.0F);
this.head.setTextureOffset(0, 44).addBox(-2.5F, 1.0F, -6.0F, 5, 3, 3, 0.0F);
this.head.setTextureOffset(26, 0).addBox(-4.5F, -4.0F, -1.0F, 2, 2, 1, 0.0F);
ModelRenderer modelrenderer = this.head.setTextureOffset(26, 0);
modelrenderer.mirror = true;
modelrenderer.addBox(2.5F, -4.0F, -1.0F, 2, 2, 1, 0.0F);
this.body = new ModelRenderer(this);
this.body.setTextureOffset(0, 19).addBox(-5.0F, -13.0F, -7.0F, 14, 14, 11, 0.0F);
this.body.setTextureOffset(39, 0).addBox(-4.0F, -25.0F, -7.0F, 12, 12, 10, 0.0F);
this.body.setRotationPoint(-2.0F, 9.0F, 12.0F);
int i = 10;
this.leg1 = new ModelRenderer(this, 50, 22);
this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, 10, 8, 0.0F);
this.leg1.setRotationPoint(-3.5F, 14.0F, 6.0F);
this.leg2 = new ModelRenderer(this, 50, 22);
this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, 10, 8, 0.0F);
this.leg2.setRotationPoint(3.5F, 14.0F, 6.0F);
this.leg3 = new ModelRenderer(this, 50, 40);
this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, 10, 6, 0.0F);
this.leg3.setRotationPoint(-2.5F, 14.0F, -7.0F);
this.leg4 = new ModelRenderer(this, 50, 40);
this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, 10, 6, 0.0F);
this.leg4.setRotationPoint(2.5F, 14.0F, -7.0F);
--this.leg1.rotationPointX;
++this.leg2.rotationPointX;
this.leg1.rotationPointZ += 0.0F;
this.leg2.rotationPointZ += 0.0F;
--this.leg3.rotationPointX;
++this.leg4.rotationPointX;
--this.leg3.rotationPointZ;
--this.leg4.rotationPointZ;
this.childZOffset += 2.0F;
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
if (this.isChild)
{
float f = 2.0F;
this.childYOffset = 16.0F;
this.childZOffset = 4.0F;
GlStateManager.pushMatrix();
GlStateManager.scale(0.6666667F, 0.6666667F, 0.6666667F);
GlStateManager.translate(0.0F, this.childYOffset * scale, this.childZOffset * scale);
this.head.render(scale);
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.scale(0.5F, 0.5F, 0.5F);
GlStateManager.translate(0.0F, 24.0F * scale, 0.0F);
this.body.render(scale);
this.leg1.render(scale);
this.leg2.render(scale);
this.leg3.render(scale);
this.leg4.render(scale);
GlStateManager.popMatrix();
}
else
{
this.head.render(scale);
this.body.render(scale);
this.leg1.render(scale);
this.leg2.render(scale);
this.leg3.render(scale);
this.leg4.render(scale);
}
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
float f = ageInTicks - (float)entityIn.ticksExisted;
float f1 = ((EntityPolarBear)entityIn).getStandingAnimationScale(f);
f1 = f1 * f1;
float f2 = 1.0F - f1;
this.body.rotateAngleX = ((float)Math.PI / 2F) - f1 * (float)Math.PI * 0.35F;
this.body.rotationPointY = 9.0F * f2 + 11.0F * f1;
this.leg3.rotationPointY = 14.0F * f2 + -6.0F * f1;
this.leg3.rotationPointZ = -8.0F * f2 + -4.0F * f1;
this.leg3.rotateAngleX -= f1 * (float)Math.PI * 0.45F;
this.leg4.rotationPointY = this.leg3.rotationPointY;
this.leg4.rotationPointZ = this.leg3.rotationPointZ;
this.leg4.rotateAngleX -= f1 * (float)Math.PI * 0.45F;
this.head.rotationPointY = 10.0F * f2 + -12.0F * f1;
this.head.rotationPointZ = -16.0F * f2 + -3.0F * f1;
this.head.rotateAngleX += f1 * (float)Math.PI * 0.15F;
}
}

View File

@@ -0,0 +1,92 @@
package net.minecraft.client.model;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelQuadruped extends ModelBase
{
public ModelRenderer head = new ModelRenderer(this, 0, 0);
public ModelRenderer body;
public ModelRenderer leg1;
public ModelRenderer leg2;
public ModelRenderer leg3;
public ModelRenderer leg4;
protected float childYOffset = 8.0F;
protected float childZOffset = 4.0F;
public ModelQuadruped(int height, float scale)
{
this.head.addBox(-4.0F, -4.0F, -8.0F, 8, 8, 8, scale);
this.head.setRotationPoint(0.0F, (float)(18 - height), -6.0F);
this.body = new ModelRenderer(this, 28, 8);
this.body.addBox(-5.0F, -10.0F, -7.0F, 10, 16, 8, scale);
this.body.setRotationPoint(0.0F, (float)(17 - height), 2.0F);
this.leg1 = new ModelRenderer(this, 0, 16);
this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, height, 4, scale);
this.leg1.setRotationPoint(-3.0F, (float)(24 - height), 7.0F);
this.leg2 = new ModelRenderer(this, 0, 16);
this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, height, 4, scale);
this.leg2.setRotationPoint(3.0F, (float)(24 - height), 7.0F);
this.leg3 = new ModelRenderer(this, 0, 16);
this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, height, 4, scale);
this.leg3.setRotationPoint(-3.0F, (float)(24 - height), -5.0F);
this.leg4 = new ModelRenderer(this, 0, 16);
this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, height, 4, scale);
this.leg4.setRotationPoint(3.0F, (float)(24 - height), -5.0F);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
if (this.isChild)
{
float f = 2.0F;
GlStateManager.pushMatrix();
GlStateManager.translate(0.0F, this.childYOffset * scale, this.childZOffset * scale);
this.head.render(scale);
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.scale(0.5F, 0.5F, 0.5F);
GlStateManager.translate(0.0F, 24.0F * scale, 0.0F);
this.body.render(scale);
this.leg1.render(scale);
this.leg2.render(scale);
this.leg3.render(scale);
this.leg4.render(scale);
GlStateManager.popMatrix();
}
else
{
this.head.render(scale);
this.body.render(scale);
this.leg1.render(scale);
this.leg2.render(scale);
this.leg3.render(scale);
this.leg4.render(scale);
}
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
this.head.rotateAngleX = headPitch * 0.017453292F;
this.head.rotateAngleY = netHeadYaw * 0.017453292F;
this.body.rotateAngleX = ((float)Math.PI / 2F);
this.leg1.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount;
this.leg2.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.4F * limbSwingAmount;
this.leg3.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.4F * limbSwingAmount;
this.leg4.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount;
}
}

View File

@@ -0,0 +1,202 @@
package net.minecraft.client.model;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.passive.EntityRabbit;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelRabbit extends ModelBase
{
/** The Rabbit's Left Foot */
private final ModelRenderer rabbitLeftFoot;
/** The Rabbit's Right Foot */
private final ModelRenderer rabbitRightFoot;
/** The Rabbit's Left Thigh */
private final ModelRenderer rabbitLeftThigh;
/** The Rabbit's Right Thigh */
private final ModelRenderer rabbitRightThigh;
/** The Rabbit's Body */
private final ModelRenderer rabbitBody;
/** The Rabbit's Left Arm */
private final ModelRenderer rabbitLeftArm;
/** The Rabbit's Right Arm */
private final ModelRenderer rabbitRightArm;
/** The Rabbit's Head */
private final ModelRenderer rabbitHead;
/** The Rabbit's Right Ear */
private final ModelRenderer rabbitRightEar;
/** The Rabbit's Left Ear */
private final ModelRenderer rabbitLeftEar;
/** The Rabbit's Tail */
private final ModelRenderer rabbitTail;
/** The Rabbit's Nose */
private final ModelRenderer rabbitNose;
private float jumpRotation;
public ModelRabbit()
{
this.setTextureOffset("head.main", 0, 0);
this.setTextureOffset("head.nose", 0, 24);
this.setTextureOffset("head.ear1", 0, 10);
this.setTextureOffset("head.ear2", 6, 10);
this.rabbitLeftFoot = new ModelRenderer(this, 26, 24);
this.rabbitLeftFoot.addBox(-1.0F, 5.5F, -3.7F, 2, 1, 7);
this.rabbitLeftFoot.setRotationPoint(3.0F, 17.5F, 3.7F);
this.rabbitLeftFoot.mirror = true;
this.setRotationOffset(this.rabbitLeftFoot, 0.0F, 0.0F, 0.0F);
this.rabbitRightFoot = new ModelRenderer(this, 8, 24);
this.rabbitRightFoot.addBox(-1.0F, 5.5F, -3.7F, 2, 1, 7);
this.rabbitRightFoot.setRotationPoint(-3.0F, 17.5F, 3.7F);
this.rabbitRightFoot.mirror = true;
this.setRotationOffset(this.rabbitRightFoot, 0.0F, 0.0F, 0.0F);
this.rabbitLeftThigh = new ModelRenderer(this, 30, 15);
this.rabbitLeftThigh.addBox(-1.0F, 0.0F, 0.0F, 2, 4, 5);
this.rabbitLeftThigh.setRotationPoint(3.0F, 17.5F, 3.7F);
this.rabbitLeftThigh.mirror = true;
this.setRotationOffset(this.rabbitLeftThigh, -0.34906584F, 0.0F, 0.0F);
this.rabbitRightThigh = new ModelRenderer(this, 16, 15);
this.rabbitRightThigh.addBox(-1.0F, 0.0F, 0.0F, 2, 4, 5);
this.rabbitRightThigh.setRotationPoint(-3.0F, 17.5F, 3.7F);
this.rabbitRightThigh.mirror = true;
this.setRotationOffset(this.rabbitRightThigh, -0.34906584F, 0.0F, 0.0F);
this.rabbitBody = new ModelRenderer(this, 0, 0);
this.rabbitBody.addBox(-3.0F, -2.0F, -10.0F, 6, 5, 10);
this.rabbitBody.setRotationPoint(0.0F, 19.0F, 8.0F);
this.rabbitBody.mirror = true;
this.setRotationOffset(this.rabbitBody, -0.34906584F, 0.0F, 0.0F);
this.rabbitLeftArm = new ModelRenderer(this, 8, 15);
this.rabbitLeftArm.addBox(-1.0F, 0.0F, -1.0F, 2, 7, 2);
this.rabbitLeftArm.setRotationPoint(3.0F, 17.0F, -1.0F);
this.rabbitLeftArm.mirror = true;
this.setRotationOffset(this.rabbitLeftArm, -0.17453292F, 0.0F, 0.0F);
this.rabbitRightArm = new ModelRenderer(this, 0, 15);
this.rabbitRightArm.addBox(-1.0F, 0.0F, -1.0F, 2, 7, 2);
this.rabbitRightArm.setRotationPoint(-3.0F, 17.0F, -1.0F);
this.rabbitRightArm.mirror = true;
this.setRotationOffset(this.rabbitRightArm, -0.17453292F, 0.0F, 0.0F);
this.rabbitHead = new ModelRenderer(this, 32, 0);
this.rabbitHead.addBox(-2.5F, -4.0F, -5.0F, 5, 4, 5);
this.rabbitHead.setRotationPoint(0.0F, 16.0F, -1.0F);
this.rabbitHead.mirror = true;
this.setRotationOffset(this.rabbitHead, 0.0F, 0.0F, 0.0F);
this.rabbitRightEar = new ModelRenderer(this, 52, 0);
this.rabbitRightEar.addBox(-2.5F, -9.0F, -1.0F, 2, 5, 1);
this.rabbitRightEar.setRotationPoint(0.0F, 16.0F, -1.0F);
this.rabbitRightEar.mirror = true;
this.setRotationOffset(this.rabbitRightEar, 0.0F, -0.2617994F, 0.0F);
this.rabbitLeftEar = new ModelRenderer(this, 58, 0);
this.rabbitLeftEar.addBox(0.5F, -9.0F, -1.0F, 2, 5, 1);
this.rabbitLeftEar.setRotationPoint(0.0F, 16.0F, -1.0F);
this.rabbitLeftEar.mirror = true;
this.setRotationOffset(this.rabbitLeftEar, 0.0F, 0.2617994F, 0.0F);
this.rabbitTail = new ModelRenderer(this, 52, 6);
this.rabbitTail.addBox(-1.5F, -1.5F, 0.0F, 3, 3, 2);
this.rabbitTail.setRotationPoint(0.0F, 20.0F, 7.0F);
this.rabbitTail.mirror = true;
this.setRotationOffset(this.rabbitTail, -0.3490659F, 0.0F, 0.0F);
this.rabbitNose = new ModelRenderer(this, 32, 9);
this.rabbitNose.addBox(-0.5F, -2.5F, -5.5F, 1, 1, 1);
this.rabbitNose.setRotationPoint(0.0F, 16.0F, -1.0F);
this.rabbitNose.mirror = true;
this.setRotationOffset(this.rabbitNose, 0.0F, 0.0F, 0.0F);
}
private void setRotationOffset(ModelRenderer renderer, float x, float y, float z)
{
renderer.rotateAngleX = x;
renderer.rotateAngleY = y;
renderer.rotateAngleZ = z;
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
if (this.isChild)
{
float f = 1.5F;
GlStateManager.pushMatrix();
GlStateManager.scale(0.56666666F, 0.56666666F, 0.56666666F);
GlStateManager.translate(0.0F, 22.0F * scale, 2.0F * scale);
this.rabbitHead.render(scale);
this.rabbitLeftEar.render(scale);
this.rabbitRightEar.render(scale);
this.rabbitNose.render(scale);
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.scale(0.4F, 0.4F, 0.4F);
GlStateManager.translate(0.0F, 36.0F * scale, 0.0F);
this.rabbitLeftFoot.render(scale);
this.rabbitRightFoot.render(scale);
this.rabbitLeftThigh.render(scale);
this.rabbitRightThigh.render(scale);
this.rabbitBody.render(scale);
this.rabbitLeftArm.render(scale);
this.rabbitRightArm.render(scale);
this.rabbitTail.render(scale);
GlStateManager.popMatrix();
}
else
{
GlStateManager.pushMatrix();
GlStateManager.scale(0.6F, 0.6F, 0.6F);
GlStateManager.translate(0.0F, 16.0F * scale, 0.0F);
this.rabbitLeftFoot.render(scale);
this.rabbitRightFoot.render(scale);
this.rabbitLeftThigh.render(scale);
this.rabbitRightThigh.render(scale);
this.rabbitBody.render(scale);
this.rabbitLeftArm.render(scale);
this.rabbitRightArm.render(scale);
this.rabbitHead.render(scale);
this.rabbitRightEar.render(scale);
this.rabbitLeftEar.render(scale);
this.rabbitTail.render(scale);
this.rabbitNose.render(scale);
GlStateManager.popMatrix();
}
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
float f = ageInTicks - (float)entityIn.ticksExisted;
EntityRabbit entityrabbit = (EntityRabbit)entityIn;
this.rabbitNose.rotateAngleX = headPitch * 0.017453292F;
this.rabbitHead.rotateAngleX = headPitch * 0.017453292F;
this.rabbitRightEar.rotateAngleX = headPitch * 0.017453292F;
this.rabbitLeftEar.rotateAngleX = headPitch * 0.017453292F;
this.rabbitNose.rotateAngleY = netHeadYaw * 0.017453292F;
this.rabbitHead.rotateAngleY = netHeadYaw * 0.017453292F;
this.rabbitRightEar.rotateAngleY = this.rabbitNose.rotateAngleY - 0.2617994F;
this.rabbitLeftEar.rotateAngleY = this.rabbitNose.rotateAngleY + 0.2617994F;
this.jumpRotation = MathHelper.sin(entityrabbit.setJumpCompletion(f) * (float)Math.PI);
this.rabbitLeftThigh.rotateAngleX = (this.jumpRotation * 50.0F - 21.0F) * 0.017453292F;
this.rabbitRightThigh.rotateAngleX = (this.jumpRotation * 50.0F - 21.0F) * 0.017453292F;
this.rabbitLeftFoot.rotateAngleX = this.jumpRotation * 50.0F * 0.017453292F;
this.rabbitRightFoot.rotateAngleX = this.jumpRotation * 50.0F * 0.017453292F;
this.rabbitLeftArm.rotateAngleX = (this.jumpRotation * -40.0F - 11.0F) * 0.017453292F;
this.rabbitRightArm.rotateAngleX = (this.jumpRotation * -40.0F - 11.0F) * 0.017453292F;
}
/**
* Used for easily adding entity-dependent animations. The second and third float params here are the same second
* and third as in the setRotationAngles method.
*/
public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTickTime)
{
super.setLivingAnimations(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTickTime);
this.jumpRotation = MathHelper.sin(((EntityRabbit)entitylivingbaseIn).setJumpCompletion(partialTickTime) * (float)Math.PI);
}
}

View File

@@ -0,0 +1,313 @@
package net.minecraft.client.model;
import com.google.common.collect.Lists;
import java.util.List;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.GLAllocation;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class ModelRenderer
{
/** The size of the texture file's width in pixels. */
public float textureWidth;
/** The size of the texture file's height in pixels. */
public float textureHeight;
/** The X offset into the texture used for displaying this model */
private int textureOffsetX;
/** The Y offset into the texture used for displaying this model */
private int textureOffsetY;
public float rotationPointX;
public float rotationPointY;
public float rotationPointZ;
public float rotateAngleX;
public float rotateAngleY;
public float rotateAngleZ;
private boolean compiled;
/** The GL display list rendered by the Tessellator for this model */
private int displayList;
public boolean mirror;
public boolean showModel;
/** Hides the model. */
public boolean isHidden;
public List<ModelBox> cubeList;
public List<ModelRenderer> childModels;
public final String boxName;
private final ModelBase baseModel;
public float offsetX;
public float offsetY;
public float offsetZ;
public ModelRenderer(ModelBase model, String boxNameIn)
{
this.textureWidth = 64.0F;
this.textureHeight = 32.0F;
this.showModel = true;
this.cubeList = Lists.<ModelBox>newArrayList();
this.baseModel = model;
model.boxList.add(this);
this.boxName = boxNameIn;
this.setTextureSize(model.textureWidth, model.textureHeight);
}
public ModelRenderer(ModelBase model)
{
this(model, (String)null);
}
public ModelRenderer(ModelBase model, int texOffX, int texOffY)
{
this(model);
this.setTextureOffset(texOffX, texOffY);
}
/**
* Sets the current box's rotation points and rotation angles to another box.
*/
public void addChild(ModelRenderer renderer)
{
if (this.childModels == null)
{
this.childModels = Lists.<ModelRenderer>newArrayList();
}
this.childModels.add(renderer);
}
public ModelRenderer setTextureOffset(int x, int y)
{
this.textureOffsetX = x;
this.textureOffsetY = y;
return this;
}
public ModelRenderer addBox(String partName, float offX, float offY, float offZ, int width, int height, int depth)
{
partName = this.boxName + "." + partName;
TextureOffset textureoffset = this.baseModel.getTextureOffset(partName);
this.setTextureOffset(textureoffset.textureOffsetX, textureoffset.textureOffsetY);
this.cubeList.add((new ModelBox(this, this.textureOffsetX, this.textureOffsetY, offX, offY, offZ, width, height, depth, 0.0F)).setBoxName(partName));
return this;
}
public ModelRenderer addBox(float offX, float offY, float offZ, int width, int height, int depth)
{
this.cubeList.add(new ModelBox(this, this.textureOffsetX, this.textureOffsetY, offX, offY, offZ, width, height, depth, 0.0F));
return this;
}
public ModelRenderer addBox(float offX, float offY, float offZ, int width, int height, int depth, boolean mirrored)
{
this.cubeList.add(new ModelBox(this, this.textureOffsetX, this.textureOffsetY, offX, offY, offZ, width, height, depth, 0.0F, mirrored));
return this;
}
/**
* Creates a textured box.
*/
public void addBox(float offX, float offY, float offZ, int width, int height, int depth, float scaleFactor)
{
this.cubeList.add(new ModelBox(this, this.textureOffsetX, this.textureOffsetY, offX, offY, offZ, width, height, depth, scaleFactor));
}
public void setRotationPoint(float rotationPointXIn, float rotationPointYIn, float rotationPointZIn)
{
this.rotationPointX = rotationPointXIn;
this.rotationPointY = rotationPointYIn;
this.rotationPointZ = rotationPointZIn;
}
@SideOnly(Side.CLIENT)
public void render(float scale)
{
if (!this.isHidden)
{
if (this.showModel)
{
if (!this.compiled)
{
this.compileDisplayList(scale);
}
GlStateManager.translate(this.offsetX, this.offsetY, this.offsetZ);
if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F)
{
if (this.rotationPointX == 0.0F && this.rotationPointY == 0.0F && this.rotationPointZ == 0.0F)
{
GlStateManager.callList(this.displayList);
if (this.childModels != null)
{
for (int k = 0; k < this.childModels.size(); ++k)
{
((ModelRenderer)this.childModels.get(k)).render(scale);
}
}
}
else
{
GlStateManager.translate(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale);
GlStateManager.callList(this.displayList);
if (this.childModels != null)
{
for (int j = 0; j < this.childModels.size(); ++j)
{
((ModelRenderer)this.childModels.get(j)).render(scale);
}
}
GlStateManager.translate(-this.rotationPointX * scale, -this.rotationPointY * scale, -this.rotationPointZ * scale);
}
}
else
{
GlStateManager.pushMatrix();
GlStateManager.translate(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale);
if (this.rotateAngleZ != 0.0F)
{
GlStateManager.rotate(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F);
}
if (this.rotateAngleY != 0.0F)
{
GlStateManager.rotate(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F);
}
if (this.rotateAngleX != 0.0F)
{
GlStateManager.rotate(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F);
}
GlStateManager.callList(this.displayList);
if (this.childModels != null)
{
for (int i = 0; i < this.childModels.size(); ++i)
{
((ModelRenderer)this.childModels.get(i)).render(scale);
}
}
GlStateManager.popMatrix();
}
GlStateManager.translate(-this.offsetX, -this.offsetY, -this.offsetZ);
}
}
}
@SideOnly(Side.CLIENT)
public void renderWithRotation(float scale)
{
if (!this.isHidden)
{
if (this.showModel)
{
if (!this.compiled)
{
this.compileDisplayList(scale);
}
GlStateManager.pushMatrix();
GlStateManager.translate(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale);
if (this.rotateAngleY != 0.0F)
{
GlStateManager.rotate(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F);
}
if (this.rotateAngleX != 0.0F)
{
GlStateManager.rotate(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F);
}
if (this.rotateAngleZ != 0.0F)
{
GlStateManager.rotate(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F);
}
GlStateManager.callList(this.displayList);
GlStateManager.popMatrix();
}
}
}
/**
* Allows the changing of Angles after a box has been rendered
*/
@SideOnly(Side.CLIENT)
public void postRender(float scale)
{
if (!this.isHidden)
{
if (this.showModel)
{
if (!this.compiled)
{
this.compileDisplayList(scale);
}
if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F)
{
if (this.rotationPointX != 0.0F || this.rotationPointY != 0.0F || this.rotationPointZ != 0.0F)
{
GlStateManager.translate(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale);
}
}
else
{
GlStateManager.translate(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale);
if (this.rotateAngleZ != 0.0F)
{
GlStateManager.rotate(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F);
}
if (this.rotateAngleY != 0.0F)
{
GlStateManager.rotate(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F);
}
if (this.rotateAngleX != 0.0F)
{
GlStateManager.rotate(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F);
}
}
}
}
}
/**
* Compiles a GL display list for this model
*/
@SideOnly(Side.CLIENT)
private void compileDisplayList(float scale)
{
this.displayList = GLAllocation.generateDisplayLists(1);
GlStateManager.glNewList(this.displayList, 4864);
BufferBuilder bufferbuilder = Tessellator.getInstance().getBuffer();
for (int i = 0; i < this.cubeList.size(); ++i)
{
((ModelBox)this.cubeList.get(i)).render(bufferbuilder, scale);
}
GlStateManager.glEndList();
this.compiled = true;
}
/**
* Returns the model renderer with the new texture parameters.
*/
public ModelRenderer setTextureSize(int textureWidthIn, int textureHeightIn)
{
this.textureWidth = (float)textureWidthIn;
this.textureHeight = (float)textureHeightIn;
return this;
}
}

View File

@@ -0,0 +1,59 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelSheep1 extends ModelQuadruped
{
private float headRotationAngleX;
public ModelSheep1()
{
super(12, 0.0F);
this.head = new ModelRenderer(this, 0, 0);
this.head.addBox(-3.0F, -4.0F, -4.0F, 6, 6, 6, 0.6F);
this.head.setRotationPoint(0.0F, 6.0F, -8.0F);
this.body = new ModelRenderer(this, 28, 8);
this.body.addBox(-4.0F, -10.0F, -7.0F, 8, 16, 6, 1.75F);
this.body.setRotationPoint(0.0F, 5.0F, 2.0F);
float f = 0.5F;
this.leg1 = new ModelRenderer(this, 0, 16);
this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, 0.5F);
this.leg1.setRotationPoint(-3.0F, 12.0F, 7.0F);
this.leg2 = new ModelRenderer(this, 0, 16);
this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, 0.5F);
this.leg2.setRotationPoint(3.0F, 12.0F, 7.0F);
this.leg3 = new ModelRenderer(this, 0, 16);
this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, 0.5F);
this.leg3.setRotationPoint(-3.0F, 12.0F, -5.0F);
this.leg4 = new ModelRenderer(this, 0, 16);
this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, 0.5F);
this.leg4.setRotationPoint(3.0F, 12.0F, -5.0F);
}
/**
* Used for easily adding entity-dependent animations. The second and third float params here are the same second
* and third as in the setRotationAngles method.
*/
public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTickTime)
{
super.setLivingAnimations(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTickTime);
this.head.rotationPointY = 6.0F + ((EntitySheep)entitylivingbaseIn).getHeadRotationPointY(partialTickTime) * 9.0F;
this.headRotationAngleX = ((EntitySheep)entitylivingbaseIn).getHeadRotationAngleX(partialTickTime);
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
this.head.rotateAngleX = this.headRotationAngleX;
}
}

View File

@@ -0,0 +1,46 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelSheep2 extends ModelQuadruped
{
private float headRotationAngleX;
public ModelSheep2()
{
super(12, 0.0F);
this.head = new ModelRenderer(this, 0, 0);
this.head.addBox(-3.0F, -4.0F, -6.0F, 6, 6, 8, 0.0F);
this.head.setRotationPoint(0.0F, 6.0F, -8.0F);
this.body = new ModelRenderer(this, 28, 8);
this.body.addBox(-4.0F, -10.0F, -7.0F, 8, 16, 6, 0.0F);
this.body.setRotationPoint(0.0F, 5.0F, 2.0F);
}
/**
* Used for easily adding entity-dependent animations. The second and third float params here are the same second
* and third as in the setRotationAngles method.
*/
public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTickTime)
{
super.setLivingAnimations(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTickTime);
this.head.rotationPointY = 6.0F + ((EntitySheep)entitylivingbaseIn).getHeadRotationPointY(partialTickTime) * 9.0F;
this.headRotationAngleX = ((EntitySheep)entitylivingbaseIn).getHeadRotationAngleX(partialTickTime);
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
this.head.rotateAngleX = this.headRotationAngleX;
}
}

View File

@@ -0,0 +1,27 @@
package net.minecraft.client.model;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelShield extends ModelBase
{
public ModelRenderer plate;
public ModelRenderer handle;
public ModelShield()
{
this.textureWidth = 64;
this.textureHeight = 64;
this.plate = new ModelRenderer(this, 0, 0);
this.plate.addBox(-6.0F, -11.0F, -2.0F, 12, 22, 1, 0.0F);
this.handle = new ModelRenderer(this, 26, 0);
this.handle.addBox(-1.0F, -3.0F, -1.0F, 2, 6, 6, 0.0F);
}
public void render()
{
this.plate.render(0.0625F);
this.handle.render(0.0625F);
}
}

View File

@@ -0,0 +1,72 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraft.entity.monster.EntityShulker;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelShulker extends ModelBase
{
public final ModelRenderer base;
public final ModelRenderer lid;
public ModelRenderer head;
public ModelShulker()
{
this.textureHeight = 64;
this.textureWidth = 64;
this.lid = new ModelRenderer(this);
this.base = new ModelRenderer(this);
this.head = new ModelRenderer(this);
this.lid.setTextureOffset(0, 0).addBox(-8.0F, -16.0F, -8.0F, 16, 12, 16);
this.lid.setRotationPoint(0.0F, 24.0F, 0.0F);
this.base.setTextureOffset(0, 28).addBox(-8.0F, -8.0F, -8.0F, 16, 8, 16);
this.base.setRotationPoint(0.0F, 24.0F, 0.0F);
this.head.setTextureOffset(0, 52).addBox(-3.0F, 0.0F, -3.0F, 6, 6, 6);
this.head.setRotationPoint(0.0F, 12.0F, 0.0F);
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
EntityShulker entityshulker = (EntityShulker)entityIn;
float f = ageInTicks - (float)entityshulker.ticksExisted;
float f1 = (0.5F + entityshulker.getClientPeekAmount(f)) * (float)Math.PI;
float f2 = -1.0F + MathHelper.sin(f1);
float f3 = 0.0F;
if (f1 > (float)Math.PI)
{
f3 = MathHelper.sin(ageInTicks * 0.1F) * 0.7F;
}
this.lid.setRotationPoint(0.0F, 16.0F + MathHelper.sin(f1) * 8.0F + f3, 0.0F);
if (entityshulker.getClientPeekAmount(f) > 0.3F)
{
this.lid.rotateAngleY = f2 * f2 * f2 * f2 * (float)Math.PI * 0.125F;
}
else
{
this.lid.rotateAngleY = 0.0F;
}
this.head.rotateAngleX = headPitch * 0.017453292F;
this.head.rotateAngleY = netHeadYaw * 0.017453292F;
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.base.render(scale);
this.lid.render(scale);
}
}

View File

@@ -0,0 +1,43 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelShulkerBullet extends ModelBase
{
public ModelRenderer renderer;
public ModelShulkerBullet()
{
this.textureWidth = 64;
this.textureHeight = 32;
this.renderer = new ModelRenderer(this);
this.renderer.setTextureOffset(0, 0).addBox(-4.0F, -4.0F, -1.0F, 8, 8, 2, 0.0F);
this.renderer.setTextureOffset(0, 10).addBox(-1.0F, -4.0F, -4.0F, 2, 8, 8, 0.0F);
this.renderer.setTextureOffset(20, 0).addBox(-4.0F, -1.0F, -4.0F, 8, 2, 8, 0.0F);
this.renderer.setRotationPoint(0.0F, 0.0F, 0.0F);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
this.renderer.render(scale);
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
this.renderer.rotateAngleY = netHeadYaw * 0.017453292F;
this.renderer.rotateAngleX = headPitch * 0.017453292F;
}
}

View File

@@ -0,0 +1,29 @@
package net.minecraft.client.model;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelSign extends ModelBase
{
/** The board on a sign that has the writing on it. */
public ModelRenderer signBoard = new ModelRenderer(this, 0, 0);
/** The stick a sign stands on. */
public ModelRenderer signStick;
public ModelSign()
{
this.signBoard.addBox(-12.0F, -14.0F, -1.0F, 24, 12, 2, 0.0F);
this.signStick = new ModelRenderer(this, 0, 14);
this.signStick.addBox(-1.0F, -2.0F, -1.0F, 2, 14, 2, 0.0F);
}
/**
* Renders the sign model through TileEntitySignRenderer
*/
public void renderSign()
{
this.signBoard.render(0.0625F);
this.signStick.render(0.0625F);
}
}

View File

@@ -0,0 +1,87 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelSilverfish extends ModelBase
{
/** The body parts of the silverfish's model. */
private final ModelRenderer[] silverfishBodyParts = new ModelRenderer[7];
/** The wings (dust-looking sprites) on the silverfish's model. */
private final ModelRenderer[] silverfishWings;
private final float[] zPlacement = new float[7];
/** The widths, heights, and lengths for the silverfish model boxes. */
private static final int[][] SILVERFISH_BOX_LENGTH = new int[][] {{3, 2, 2}, {4, 3, 2}, {6, 4, 3}, {3, 3, 3}, {2, 2, 3}, {2, 1, 2}, {1, 1, 2}};
/** The texture positions for the silverfish's model's boxes. */
private static final int[][] SILVERFISH_TEXTURE_POSITIONS = new int[][] {{0, 0}, {0, 4}, {0, 9}, {0, 16}, {0, 22}, {11, 0}, {13, 4}};
public ModelSilverfish()
{
float f = -3.5F;
for (int i = 0; i < this.silverfishBodyParts.length; ++i)
{
this.silverfishBodyParts[i] = new ModelRenderer(this, SILVERFISH_TEXTURE_POSITIONS[i][0], SILVERFISH_TEXTURE_POSITIONS[i][1]);
this.silverfishBodyParts[i].addBox((float)SILVERFISH_BOX_LENGTH[i][0] * -0.5F, 0.0F, (float)SILVERFISH_BOX_LENGTH[i][2] * -0.5F, SILVERFISH_BOX_LENGTH[i][0], SILVERFISH_BOX_LENGTH[i][1], SILVERFISH_BOX_LENGTH[i][2]);
this.silverfishBodyParts[i].setRotationPoint(0.0F, (float)(24 - SILVERFISH_BOX_LENGTH[i][1]), f);
this.zPlacement[i] = f;
if (i < this.silverfishBodyParts.length - 1)
{
f += (float)(SILVERFISH_BOX_LENGTH[i][2] + SILVERFISH_BOX_LENGTH[i + 1][2]) * 0.5F;
}
}
this.silverfishWings = new ModelRenderer[3];
this.silverfishWings[0] = new ModelRenderer(this, 20, 0);
this.silverfishWings[0].addBox(-5.0F, 0.0F, (float)SILVERFISH_BOX_LENGTH[2][2] * -0.5F, 10, 8, SILVERFISH_BOX_LENGTH[2][2]);
this.silverfishWings[0].setRotationPoint(0.0F, 16.0F, this.zPlacement[2]);
this.silverfishWings[1] = new ModelRenderer(this, 20, 11);
this.silverfishWings[1].addBox(-3.0F, 0.0F, (float)SILVERFISH_BOX_LENGTH[4][2] * -0.5F, 6, 4, SILVERFISH_BOX_LENGTH[4][2]);
this.silverfishWings[1].setRotationPoint(0.0F, 20.0F, this.zPlacement[4]);
this.silverfishWings[2] = new ModelRenderer(this, 20, 18);
this.silverfishWings[2].addBox(-3.0F, 0.0F, (float)SILVERFISH_BOX_LENGTH[4][2] * -0.5F, 6, 5, SILVERFISH_BOX_LENGTH[1][2]);
this.silverfishWings[2].setRotationPoint(0.0F, 19.0F, this.zPlacement[1]);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
for (ModelRenderer modelrenderer : this.silverfishBodyParts)
{
modelrenderer.render(scale);
}
for (ModelRenderer modelrenderer1 : this.silverfishWings)
{
modelrenderer1.render(scale);
}
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
for (int i = 0; i < this.silverfishBodyParts.length; ++i)
{
this.silverfishBodyParts[i].rotateAngleY = MathHelper.cos(ageInTicks * 0.9F + (float)i * 0.15F * (float)Math.PI) * (float)Math.PI * 0.05F * (float)(1 + Math.abs(i - 2));
this.silverfishBodyParts[i].rotationPointX = MathHelper.sin(ageInTicks * 0.9F + (float)i * 0.15F * (float)Math.PI) * (float)Math.PI * 0.2F * (float)Math.abs(i - 2);
}
this.silverfishWings[0].rotateAngleY = this.silverfishBodyParts[2].rotateAngleY;
this.silverfishWings[1].rotateAngleY = this.silverfishBodyParts[4].rotateAngleY;
this.silverfishWings[1].rotationPointX = this.silverfishBodyParts[4].rotationPointX;
this.silverfishWings[2].rotateAngleY = this.silverfishBodyParts[1].rotateAngleY;
this.silverfishWings[2].rotationPointX = this.silverfishBodyParts[1].rotationPointX;
}
}

View File

@@ -0,0 +1,108 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.AbstractSkeleton;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumHand;
import net.minecraft.util.EnumHandSide;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelSkeleton extends ModelBiped
{
public ModelSkeleton()
{
this(0.0F, false);
}
public ModelSkeleton(float modelSize, boolean p_i46303_2_)
{
super(modelSize, 0.0F, 64, 32);
if (!p_i46303_2_)
{
this.bipedRightArm = new ModelRenderer(this, 40, 16);
this.bipedRightArm.addBox(-1.0F, -2.0F, -1.0F, 2, 12, 2, modelSize);
this.bipedRightArm.setRotationPoint(-5.0F, 2.0F, 0.0F);
this.bipedLeftArm = new ModelRenderer(this, 40, 16);
this.bipedLeftArm.mirror = true;
this.bipedLeftArm.addBox(-1.0F, -2.0F, -1.0F, 2, 12, 2, modelSize);
this.bipedLeftArm.setRotationPoint(5.0F, 2.0F, 0.0F);
this.bipedRightLeg = new ModelRenderer(this, 0, 16);
this.bipedRightLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 12, 2, modelSize);
this.bipedRightLeg.setRotationPoint(-2.0F, 12.0F, 0.0F);
this.bipedLeftLeg = new ModelRenderer(this, 0, 16);
this.bipedLeftLeg.mirror = true;
this.bipedLeftLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 12, 2, modelSize);
this.bipedLeftLeg.setRotationPoint(2.0F, 12.0F, 0.0F);
}
}
/**
* Used for easily adding entity-dependent animations. The second and third float params here are the same second
* and third as in the setRotationAngles method.
*/
public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTickTime)
{
this.rightArmPose = ModelBiped.ArmPose.EMPTY;
this.leftArmPose = ModelBiped.ArmPose.EMPTY;
ItemStack itemstack = entitylivingbaseIn.getHeldItem(EnumHand.MAIN_HAND);
if (itemstack.getItem() == Items.BOW && ((AbstractSkeleton)entitylivingbaseIn).isSwingingArms())
{
if (entitylivingbaseIn.getPrimaryHand() == EnumHandSide.RIGHT)
{
this.rightArmPose = ModelBiped.ArmPose.BOW_AND_ARROW;
}
else
{
this.leftArmPose = ModelBiped.ArmPose.BOW_AND_ARROW;
}
}
super.setLivingAnimations(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTickTime);
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
ItemStack itemstack = ((EntityLivingBase)entityIn).getHeldItemMainhand();
AbstractSkeleton abstractskeleton = (AbstractSkeleton)entityIn;
if (abstractskeleton.isSwingingArms() && (itemstack.isEmpty() || itemstack.getItem() != Items.BOW))
{
float f = MathHelper.sin(this.swingProgress * (float)Math.PI);
float f1 = MathHelper.sin((1.0F - (1.0F - this.swingProgress) * (1.0F - this.swingProgress)) * (float)Math.PI);
this.bipedRightArm.rotateAngleZ = 0.0F;
this.bipedLeftArm.rotateAngleZ = 0.0F;
this.bipedRightArm.rotateAngleY = -(0.1F - f * 0.6F);
this.bipedLeftArm.rotateAngleY = 0.1F - f * 0.6F;
this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F);
this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F);
this.bipedRightArm.rotateAngleX -= f * 1.2F - f1 * 0.4F;
this.bipedLeftArm.rotateAngleX -= f * 1.2F - f1 * 0.4F;
this.bipedRightArm.rotateAngleZ += MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
this.bipedRightArm.rotateAngleX += MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
this.bipedLeftArm.rotateAngleX -= MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
}
}
public void postRenderArm(float scale, EnumHandSide side)
{
float f = side == EnumHandSide.RIGHT ? 1.0F : -1.0F;
ModelRenderer modelrenderer = this.getArmForSide(side);
modelrenderer.rotationPointX += f;
modelrenderer.postRender(scale);
modelrenderer.rotationPointX -= f;
}
}

View File

@@ -0,0 +1,46 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelSkeletonHead extends ModelBase
{
public ModelRenderer skeletonHead;
public ModelSkeletonHead()
{
this(0, 35, 64, 64);
}
public ModelSkeletonHead(int p_i1155_1_, int p_i1155_2_, int p_i1155_3_, int p_i1155_4_)
{
this.textureWidth = p_i1155_3_;
this.textureHeight = p_i1155_4_;
this.skeletonHead = new ModelRenderer(this, p_i1155_1_, p_i1155_2_);
this.skeletonHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.0F);
this.skeletonHead.setRotationPoint(0.0F, 0.0F, 0.0F);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
this.skeletonHead.render(scale);
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
this.skeletonHead.rotateAngleY = netHeadYaw * 0.017453292F;
this.skeletonHead.rotateAngleX = headPitch * 0.017453292F;
}
}

View File

@@ -0,0 +1,56 @@
package net.minecraft.client.model;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelSlime extends ModelBase
{
/** The slime's bodies, both the inside box and the outside box */
ModelRenderer slimeBodies;
/** The slime's right eye */
ModelRenderer slimeRightEye;
/** The slime's left eye */
ModelRenderer slimeLeftEye;
/** The slime's mouth */
ModelRenderer slimeMouth;
public ModelSlime(int p_i1157_1_)
{
if (p_i1157_1_ > 0)
{
this.slimeBodies = new ModelRenderer(this, 0, p_i1157_1_);
this.slimeBodies.addBox(-3.0F, 17.0F, -3.0F, 6, 6, 6);
this.slimeRightEye = new ModelRenderer(this, 32, 0);
this.slimeRightEye.addBox(-3.25F, 18.0F, -3.5F, 2, 2, 2);
this.slimeLeftEye = new ModelRenderer(this, 32, 4);
this.slimeLeftEye.addBox(1.25F, 18.0F, -3.5F, 2, 2, 2);
this.slimeMouth = new ModelRenderer(this, 32, 8);
this.slimeMouth.addBox(0.0F, 21.0F, -3.5F, 1, 1, 1);
}
else
{
this.slimeBodies = new ModelRenderer(this, 0, p_i1157_1_);
this.slimeBodies.addBox(-4.0F, 16.0F, -4.0F, 8, 8, 8);
}
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
GlStateManager.translate(0.0F, 0.001F, 0.0F);
this.slimeBodies.render(scale);
if (this.slimeRightEye != null)
{
this.slimeRightEye.render(scale);
this.slimeLeftEye.render(scale);
this.slimeMouth.render(scale);
}
}
}

View File

@@ -0,0 +1,73 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelSnowMan extends ModelBase
{
public ModelRenderer body;
public ModelRenderer bottomBody;
public ModelRenderer head;
public ModelRenderer rightHand;
public ModelRenderer leftHand;
public ModelSnowMan()
{
float f = 4.0F;
float f1 = 0.0F;
this.head = (new ModelRenderer(this, 0, 0)).setTextureSize(64, 64);
this.head.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, -0.5F);
this.head.setRotationPoint(0.0F, 4.0F, 0.0F);
this.rightHand = (new ModelRenderer(this, 32, 0)).setTextureSize(64, 64);
this.rightHand.addBox(-1.0F, 0.0F, -1.0F, 12, 2, 2, -0.5F);
this.rightHand.setRotationPoint(0.0F, 6.0F, 0.0F);
this.leftHand = (new ModelRenderer(this, 32, 0)).setTextureSize(64, 64);
this.leftHand.addBox(-1.0F, 0.0F, -1.0F, 12, 2, 2, -0.5F);
this.leftHand.setRotationPoint(0.0F, 6.0F, 0.0F);
this.body = (new ModelRenderer(this, 0, 16)).setTextureSize(64, 64);
this.body.addBox(-5.0F, -10.0F, -5.0F, 10, 10, 10, -0.5F);
this.body.setRotationPoint(0.0F, 13.0F, 0.0F);
this.bottomBody = (new ModelRenderer(this, 0, 36)).setTextureSize(64, 64);
this.bottomBody.addBox(-6.0F, -12.0F, -6.0F, 12, 12, 12, -0.5F);
this.bottomBody.setRotationPoint(0.0F, 24.0F, 0.0F);
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
this.head.rotateAngleY = netHeadYaw * 0.017453292F;
this.head.rotateAngleX = headPitch * 0.017453292F;
this.body.rotateAngleY = netHeadYaw * 0.017453292F * 0.25F;
float f = MathHelper.sin(this.body.rotateAngleY);
float f1 = MathHelper.cos(this.body.rotateAngleY);
this.rightHand.rotateAngleZ = 1.0F;
this.leftHand.rotateAngleZ = -1.0F;
this.rightHand.rotateAngleY = 0.0F + this.body.rotateAngleY;
this.leftHand.rotateAngleY = (float)Math.PI + this.body.rotateAngleY;
this.rightHand.rotationPointX = f1 * 5.0F;
this.rightHand.rotationPointZ = -f * 5.0F;
this.leftHand.rotationPointX = -f1 * 5.0F;
this.leftHand.rotationPointZ = f * 5.0F;
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
this.body.render(scale);
this.bottomBody.render(scale);
this.head.render(scale);
this.rightHand.render(scale);
this.leftHand.render(scale);
}
}

View File

@@ -0,0 +1,145 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelSpider extends ModelBase
{
/** The spider's head box */
public ModelRenderer spiderHead;
/** The spider's neck box */
public ModelRenderer spiderNeck;
/** The spider's body box */
public ModelRenderer spiderBody;
/** Spider's first leg */
public ModelRenderer spiderLeg1;
/** Spider's second leg */
public ModelRenderer spiderLeg2;
/** Spider's third leg */
public ModelRenderer spiderLeg3;
/** Spider's fourth leg */
public ModelRenderer spiderLeg4;
/** Spider's fifth leg */
public ModelRenderer spiderLeg5;
/** Spider's sixth leg */
public ModelRenderer spiderLeg6;
/** Spider's seventh leg */
public ModelRenderer spiderLeg7;
/** Spider's eight leg */
public ModelRenderer spiderLeg8;
public ModelSpider()
{
float f = 0.0F;
int i = 15;
this.spiderHead = new ModelRenderer(this, 32, 4);
this.spiderHead.addBox(-4.0F, -4.0F, -8.0F, 8, 8, 8, 0.0F);
this.spiderHead.setRotationPoint(0.0F, 15.0F, -3.0F);
this.spiderNeck = new ModelRenderer(this, 0, 0);
this.spiderNeck.addBox(-3.0F, -3.0F, -3.0F, 6, 6, 6, 0.0F);
this.spiderNeck.setRotationPoint(0.0F, 15.0F, 0.0F);
this.spiderBody = new ModelRenderer(this, 0, 12);
this.spiderBody.addBox(-5.0F, -4.0F, -6.0F, 10, 8, 12, 0.0F);
this.spiderBody.setRotationPoint(0.0F, 15.0F, 9.0F);
this.spiderLeg1 = new ModelRenderer(this, 18, 0);
this.spiderLeg1.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, 0.0F);
this.spiderLeg1.setRotationPoint(-4.0F, 15.0F, 2.0F);
this.spiderLeg2 = new ModelRenderer(this, 18, 0);
this.spiderLeg2.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, 0.0F);
this.spiderLeg2.setRotationPoint(4.0F, 15.0F, 2.0F);
this.spiderLeg3 = new ModelRenderer(this, 18, 0);
this.spiderLeg3.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, 0.0F);
this.spiderLeg3.setRotationPoint(-4.0F, 15.0F, 1.0F);
this.spiderLeg4 = new ModelRenderer(this, 18, 0);
this.spiderLeg4.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, 0.0F);
this.spiderLeg4.setRotationPoint(4.0F, 15.0F, 1.0F);
this.spiderLeg5 = new ModelRenderer(this, 18, 0);
this.spiderLeg5.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, 0.0F);
this.spiderLeg5.setRotationPoint(-4.0F, 15.0F, 0.0F);
this.spiderLeg6 = new ModelRenderer(this, 18, 0);
this.spiderLeg6.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, 0.0F);
this.spiderLeg6.setRotationPoint(4.0F, 15.0F, 0.0F);
this.spiderLeg7 = new ModelRenderer(this, 18, 0);
this.spiderLeg7.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, 0.0F);
this.spiderLeg7.setRotationPoint(-4.0F, 15.0F, -1.0F);
this.spiderLeg8 = new ModelRenderer(this, 18, 0);
this.spiderLeg8.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, 0.0F);
this.spiderLeg8.setRotationPoint(4.0F, 15.0F, -1.0F);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
this.spiderHead.render(scale);
this.spiderNeck.render(scale);
this.spiderBody.render(scale);
this.spiderLeg1.render(scale);
this.spiderLeg2.render(scale);
this.spiderLeg3.render(scale);
this.spiderLeg4.render(scale);
this.spiderLeg5.render(scale);
this.spiderLeg6.render(scale);
this.spiderLeg7.render(scale);
this.spiderLeg8.render(scale);
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
this.spiderHead.rotateAngleY = netHeadYaw * 0.017453292F;
this.spiderHead.rotateAngleX = headPitch * 0.017453292F;
float f = ((float)Math.PI / 4F);
this.spiderLeg1.rotateAngleZ = -((float)Math.PI / 4F);
this.spiderLeg2.rotateAngleZ = ((float)Math.PI / 4F);
this.spiderLeg3.rotateAngleZ = -0.58119464F;
this.spiderLeg4.rotateAngleZ = 0.58119464F;
this.spiderLeg5.rotateAngleZ = -0.58119464F;
this.spiderLeg6.rotateAngleZ = 0.58119464F;
this.spiderLeg7.rotateAngleZ = -((float)Math.PI / 4F);
this.spiderLeg8.rotateAngleZ = ((float)Math.PI / 4F);
float f1 = -0.0F;
float f2 = 0.3926991F;
this.spiderLeg1.rotateAngleY = ((float)Math.PI / 4F);
this.spiderLeg2.rotateAngleY = -((float)Math.PI / 4F);
this.spiderLeg3.rotateAngleY = 0.3926991F;
this.spiderLeg4.rotateAngleY = -0.3926991F;
this.spiderLeg5.rotateAngleY = -0.3926991F;
this.spiderLeg6.rotateAngleY = 0.3926991F;
this.spiderLeg7.rotateAngleY = -((float)Math.PI / 4F);
this.spiderLeg8.rotateAngleY = ((float)Math.PI / 4F);
float f3 = -(MathHelper.cos(limbSwing * 0.6662F * 2.0F + 0.0F) * 0.4F) * limbSwingAmount;
float f4 = -(MathHelper.cos(limbSwing * 0.6662F * 2.0F + (float)Math.PI) * 0.4F) * limbSwingAmount;
float f5 = -(MathHelper.cos(limbSwing * 0.6662F * 2.0F + ((float)Math.PI / 2F)) * 0.4F) * limbSwingAmount;
float f6 = -(MathHelper.cos(limbSwing * 0.6662F * 2.0F + ((float)Math.PI * 3F / 2F)) * 0.4F) * limbSwingAmount;
float f7 = Math.abs(MathHelper.sin(limbSwing * 0.6662F + 0.0F) * 0.4F) * limbSwingAmount;
float f8 = Math.abs(MathHelper.sin(limbSwing * 0.6662F + (float)Math.PI) * 0.4F) * limbSwingAmount;
float f9 = Math.abs(MathHelper.sin(limbSwing * 0.6662F + ((float)Math.PI / 2F)) * 0.4F) * limbSwingAmount;
float f10 = Math.abs(MathHelper.sin(limbSwing * 0.6662F + ((float)Math.PI * 3F / 2F)) * 0.4F) * limbSwingAmount;
this.spiderLeg1.rotateAngleY += f3;
this.spiderLeg2.rotateAngleY += -f3;
this.spiderLeg3.rotateAngleY += f4;
this.spiderLeg4.rotateAngleY += -f4;
this.spiderLeg5.rotateAngleY += f5;
this.spiderLeg6.rotateAngleY += -f5;
this.spiderLeg7.rotateAngleY += f6;
this.spiderLeg8.rotateAngleY += -f6;
this.spiderLeg1.rotateAngleZ += f7;
this.spiderLeg2.rotateAngleZ += -f7;
this.spiderLeg3.rotateAngleZ += f8;
this.spiderLeg4.rotateAngleZ += -f8;
this.spiderLeg5.rotateAngleZ += f9;
this.spiderLeg6.rotateAngleZ += -f9;
this.spiderLeg7.rotateAngleZ += f10;
this.spiderLeg8.rotateAngleZ += -f10;
}
}

View File

@@ -0,0 +1,63 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelSquid extends ModelBase
{
/** The squid's body */
ModelRenderer squidBody;
/** The squid's tentacles */
ModelRenderer[] squidTentacles = new ModelRenderer[8];
public ModelSquid()
{
int i = -16;
this.squidBody = new ModelRenderer(this, 0, 0);
this.squidBody.addBox(-6.0F, -8.0F, -6.0F, 12, 16, 12);
this.squidBody.rotationPointY += 8.0F;
for (int j = 0; j < this.squidTentacles.length; ++j)
{
this.squidTentacles[j] = new ModelRenderer(this, 48, 0);
double d0 = (double)j * Math.PI * 2.0D / (double)this.squidTentacles.length;
float f = (float)Math.cos(d0) * 5.0F;
float f1 = (float)Math.sin(d0) * 5.0F;
this.squidTentacles[j].addBox(-1.0F, 0.0F, -1.0F, 2, 18, 2);
this.squidTentacles[j].rotationPointX = f;
this.squidTentacles[j].rotationPointZ = f1;
this.squidTentacles[j].rotationPointY = 15.0F;
d0 = (double)j * Math.PI * -2.0D / (double)this.squidTentacles.length + (Math.PI / 2D);
this.squidTentacles[j].rotateAngleY = (float)d0;
}
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
for (ModelRenderer modelrenderer : this.squidTentacles)
{
modelrenderer.rotateAngleX = ageInTicks;
}
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
this.squidBody.render(scale);
for (ModelRenderer modelrenderer : this.squidTentacles)
{
modelrenderer.render(scale);
}
}
}

View File

@@ -0,0 +1,85 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraft.entity.monster.EntityVex;
import net.minecraft.util.EnumHandSide;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelVex extends ModelBiped
{
protected ModelRenderer leftWing;
protected ModelRenderer rightWing;
public ModelVex()
{
this(0.0F);
}
public ModelVex(float p_i47224_1_)
{
super(p_i47224_1_, 0.0F, 64, 64);
this.bipedLeftLeg.showModel = false;
this.bipedHeadwear.showModel = false;
this.bipedRightLeg = new ModelRenderer(this, 32, 0);
this.bipedRightLeg.addBox(-1.0F, -1.0F, -2.0F, 6, 10, 4, 0.0F);
this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F, 0.0F);
this.rightWing = new ModelRenderer(this, 0, 32);
this.rightWing.addBox(-20.0F, 0.0F, 0.0F, 20, 12, 1);
this.leftWing = new ModelRenderer(this, 0, 32);
this.leftWing.mirror = true;
this.leftWing.addBox(0.0F, 0.0F, 0.0F, 20, 12, 1);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
super.render(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
this.rightWing.render(scale);
this.leftWing.render(scale);
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
EntityVex entityvex = (EntityVex)entityIn;
if (entityvex.isCharging())
{
if (entityvex.getPrimaryHand() == EnumHandSide.RIGHT)
{
this.bipedRightArm.rotateAngleX = 3.7699115F;
}
else
{
this.bipedLeftArm.rotateAngleX = 3.7699115F;
}
}
this.bipedRightLeg.rotateAngleX += ((float)Math.PI / 5F);
this.rightWing.rotationPointZ = 2.0F;
this.leftWing.rotationPointZ = 2.0F;
this.rightWing.rotationPointY = 1.0F;
this.leftWing.rotationPointY = 1.0F;
this.rightWing.rotateAngleY = 0.47123894F + MathHelper.cos(ageInTicks * 0.8F) * (float)Math.PI * 0.05F;
this.leftWing.rotateAngleY = -this.rightWing.rotateAngleY;
this.leftWing.rotateAngleZ = -0.47123894F;
this.leftWing.rotateAngleX = 0.47123894F;
this.rightWing.rotateAngleX = 0.47123894F;
this.rightWing.rotateAngleZ = 0.47123894F;
}
public int getModelVersion()
{
return 23;
}
}

View File

@@ -0,0 +1,85 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelVillager extends ModelBase
{
/** The head box of the VillagerModel */
public ModelRenderer villagerHead;
/** The body of the VillagerModel */
public ModelRenderer villagerBody;
/** The arms of the VillagerModel */
public ModelRenderer villagerArms;
/** The right leg of the VillagerModel */
public ModelRenderer rightVillagerLeg;
/** The left leg of the VillagerModel */
public ModelRenderer leftVillagerLeg;
public ModelRenderer villagerNose;
public ModelVillager(float scale)
{
this(scale, 0.0F, 64, 64);
}
public ModelVillager(float scale, float p_i1164_2_, int width, int height)
{
this.villagerHead = (new ModelRenderer(this)).setTextureSize(width, height);
this.villagerHead.setRotationPoint(0.0F, 0.0F + p_i1164_2_, 0.0F);
this.villagerHead.setTextureOffset(0, 0).addBox(-4.0F, -10.0F, -4.0F, 8, 10, 8, scale);
this.villagerNose = (new ModelRenderer(this)).setTextureSize(width, height);
this.villagerNose.setRotationPoint(0.0F, p_i1164_2_ - 2.0F, 0.0F);
this.villagerNose.setTextureOffset(24, 0).addBox(-1.0F, -1.0F, -6.0F, 2, 4, 2, scale);
this.villagerHead.addChild(this.villagerNose);
this.villagerBody = (new ModelRenderer(this)).setTextureSize(width, height);
this.villagerBody.setRotationPoint(0.0F, 0.0F + p_i1164_2_, 0.0F);
this.villagerBody.setTextureOffset(16, 20).addBox(-4.0F, 0.0F, -3.0F, 8, 12, 6, scale);
this.villagerBody.setTextureOffset(0, 38).addBox(-4.0F, 0.0F, -3.0F, 8, 18, 6, scale + 0.5F);
this.villagerArms = (new ModelRenderer(this)).setTextureSize(width, height);
this.villagerArms.setRotationPoint(0.0F, 0.0F + p_i1164_2_ + 2.0F, 0.0F);
this.villagerArms.setTextureOffset(44, 22).addBox(-8.0F, -2.0F, -2.0F, 4, 8, 4, scale);
this.villagerArms.setTextureOffset(44, 22).addBox(4.0F, -2.0F, -2.0F, 4, 8, 4, scale);
this.villagerArms.setTextureOffset(40, 38).addBox(-4.0F, 2.0F, -2.0F, 8, 4, 4, scale);
this.rightVillagerLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(width, height);
this.rightVillagerLeg.setRotationPoint(-2.0F, 12.0F + p_i1164_2_, 0.0F);
this.rightVillagerLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, scale);
this.leftVillagerLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(width, height);
this.leftVillagerLeg.mirror = true;
this.leftVillagerLeg.setRotationPoint(2.0F, 12.0F + p_i1164_2_, 0.0F);
this.leftVillagerLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, scale);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
this.villagerHead.render(scale);
this.villagerBody.render(scale);
this.rightVillagerLeg.render(scale);
this.leftVillagerLeg.render(scale);
this.villagerArms.render(scale);
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
this.villagerHead.rotateAngleY = netHeadYaw * 0.017453292F;
this.villagerHead.rotateAngleX = headPitch * 0.017453292F;
this.villagerArms.rotationPointY = 3.0F;
this.villagerArms.rotationPointZ = -1.0F;
this.villagerArms.rotateAngleX = -0.75F;
this.rightVillagerLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount * 0.5F;
this.leftVillagerLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.4F * limbSwingAmount * 0.5F;
this.rightVillagerLeg.rotateAngleY = 0.0F;
this.leftVillagerLeg.rotateAngleY = 0.0F;
}
}

View File

@@ -0,0 +1,68 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelWitch extends ModelVillager
{
public boolean holdingItem;
private final ModelRenderer mole = (new ModelRenderer(this)).setTextureSize(64, 128);
private final ModelRenderer witchHat;
public ModelWitch(float scale)
{
super(scale, 0.0F, 64, 128);
this.mole.setRotationPoint(0.0F, -2.0F, 0.0F);
this.mole.setTextureOffset(0, 0).addBox(0.0F, 3.0F, -6.75F, 1, 1, 1, -0.25F);
this.villagerNose.addChild(this.mole);
this.witchHat = (new ModelRenderer(this)).setTextureSize(64, 128);
this.witchHat.setRotationPoint(-5.0F, -10.03125F, -5.0F);
this.witchHat.setTextureOffset(0, 64).addBox(0.0F, 0.0F, 0.0F, 10, 2, 10);
this.villagerHead.addChild(this.witchHat);
ModelRenderer modelrenderer = (new ModelRenderer(this)).setTextureSize(64, 128);
modelrenderer.setRotationPoint(1.75F, -4.0F, 2.0F);
modelrenderer.setTextureOffset(0, 76).addBox(0.0F, 0.0F, 0.0F, 7, 4, 7);
modelrenderer.rotateAngleX = -0.05235988F;
modelrenderer.rotateAngleZ = 0.02617994F;
this.witchHat.addChild(modelrenderer);
ModelRenderer modelrenderer1 = (new ModelRenderer(this)).setTextureSize(64, 128);
modelrenderer1.setRotationPoint(1.75F, -4.0F, 2.0F);
modelrenderer1.setTextureOffset(0, 87).addBox(0.0F, 0.0F, 0.0F, 4, 4, 4);
modelrenderer1.rotateAngleX = -0.10471976F;
modelrenderer1.rotateAngleZ = 0.05235988F;
modelrenderer.addChild(modelrenderer1);
ModelRenderer modelrenderer2 = (new ModelRenderer(this)).setTextureSize(64, 128);
modelrenderer2.setRotationPoint(1.75F, -2.0F, 2.0F);
modelrenderer2.setTextureOffset(0, 95).addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.25F);
modelrenderer2.rotateAngleX = -0.20943952F;
modelrenderer2.rotateAngleZ = 0.10471976F;
modelrenderer1.addChild(modelrenderer2);
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
this.villagerNose.offsetX = 0.0F;
this.villagerNose.offsetY = 0.0F;
this.villagerNose.offsetZ = 0.0F;
float f = 0.01F * (float)(entityIn.getEntityId() % 10);
this.villagerNose.rotateAngleX = MathHelper.sin((float)entityIn.ticksExisted * f) * 4.5F * 0.017453292F;
this.villagerNose.rotateAngleY = 0.0F;
this.villagerNose.rotateAngleZ = MathHelper.cos((float)entityIn.ticksExisted * f) * 2.5F * 0.017453292F;
if (this.holdingItem)
{
this.villagerNose.rotateAngleX = -0.9F;
this.villagerNose.offsetZ = -0.09375F;
this.villagerNose.offsetY = 0.1875F;
}
}
}

View File

@@ -0,0 +1,91 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.boss.EntityWither;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelWither extends ModelBase
{
private final ModelRenderer[] upperBodyParts;
private final ModelRenderer[] heads;
public ModelWither(float p_i46302_1_)
{
this.textureWidth = 64;
this.textureHeight = 64;
this.upperBodyParts = new ModelRenderer[3];
this.upperBodyParts[0] = new ModelRenderer(this, 0, 16);
this.upperBodyParts[0].addBox(-10.0F, 3.9F, -0.5F, 20, 3, 3, p_i46302_1_);
this.upperBodyParts[1] = (new ModelRenderer(this)).setTextureSize(this.textureWidth, this.textureHeight);
this.upperBodyParts[1].setRotationPoint(-2.0F, 6.9F, -0.5F);
this.upperBodyParts[1].setTextureOffset(0, 22).addBox(0.0F, 0.0F, 0.0F, 3, 10, 3, p_i46302_1_);
this.upperBodyParts[1].setTextureOffset(24, 22).addBox(-4.0F, 1.5F, 0.5F, 11, 2, 2, p_i46302_1_);
this.upperBodyParts[1].setTextureOffset(24, 22).addBox(-4.0F, 4.0F, 0.5F, 11, 2, 2, p_i46302_1_);
this.upperBodyParts[1].setTextureOffset(24, 22).addBox(-4.0F, 6.5F, 0.5F, 11, 2, 2, p_i46302_1_);
this.upperBodyParts[2] = new ModelRenderer(this, 12, 22);
this.upperBodyParts[2].addBox(0.0F, 0.0F, 0.0F, 3, 6, 3, p_i46302_1_);
this.heads = new ModelRenderer[3];
this.heads[0] = new ModelRenderer(this, 0, 0);
this.heads[0].addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8, p_i46302_1_);
this.heads[1] = new ModelRenderer(this, 32, 0);
this.heads[1].addBox(-4.0F, -4.0F, -4.0F, 6, 6, 6, p_i46302_1_);
this.heads[1].rotationPointX = -8.0F;
this.heads[1].rotationPointY = 4.0F;
this.heads[2] = new ModelRenderer(this, 32, 0);
this.heads[2].addBox(-4.0F, -4.0F, -4.0F, 6, 6, 6, p_i46302_1_);
this.heads[2].rotationPointX = 10.0F;
this.heads[2].rotationPointY = 4.0F;
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
for (ModelRenderer modelrenderer : this.heads)
{
modelrenderer.render(scale);
}
for (ModelRenderer modelrenderer1 : this.upperBodyParts)
{
modelrenderer1.render(scale);
}
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
float f = MathHelper.cos(ageInTicks * 0.1F);
this.upperBodyParts[1].rotateAngleX = (0.065F + 0.05F * f) * (float)Math.PI;
this.upperBodyParts[2].setRotationPoint(-2.0F, 6.9F + MathHelper.cos(this.upperBodyParts[1].rotateAngleX) * 10.0F, -0.5F + MathHelper.sin(this.upperBodyParts[1].rotateAngleX) * 10.0F);
this.upperBodyParts[2].rotateAngleX = (0.265F + 0.1F * f) * (float)Math.PI;
this.heads[0].rotateAngleY = netHeadYaw * 0.017453292F;
this.heads[0].rotateAngleX = headPitch * 0.017453292F;
}
/**
* Used for easily adding entity-dependent animations. The second and third float params here are the same second
* and third as in the setRotationAngles method.
*/
public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTickTime)
{
EntityWither entitywither = (EntityWither)entitylivingbaseIn;
for (int i = 1; i < 3; ++i)
{
this.heads[i].rotateAngleY = (entitywither.getHeadYRotation(i - 1) - entitylivingbaseIn.renderYawOffset) * 0.017453292F;
this.heads[i].rotateAngleX = entitywither.getHeadXRotation(i - 1) * 0.017453292F;
}
}
}

View File

@@ -0,0 +1,173 @@
package net.minecraft.client.model;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.passive.EntityWolf;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelWolf extends ModelBase
{
/** main box for the wolf head */
public ModelRenderer wolfHeadMain;
/** The wolf's body */
public ModelRenderer wolfBody;
/** Wolf'se first leg */
public ModelRenderer wolfLeg1;
/** Wolf's second leg */
public ModelRenderer wolfLeg2;
/** Wolf's third leg */
public ModelRenderer wolfLeg3;
/** Wolf's fourth leg */
public ModelRenderer wolfLeg4;
/** The wolf's tail */
ModelRenderer wolfTail;
/** The wolf's mane */
ModelRenderer wolfMane;
public ModelWolf()
{
float f = 0.0F;
float f1 = 13.5F;
this.wolfHeadMain = new ModelRenderer(this, 0, 0);
this.wolfHeadMain.addBox(-2.0F, -3.0F, -2.0F, 6, 6, 4, 0.0F);
this.wolfHeadMain.setRotationPoint(-1.0F, 13.5F, -7.0F);
this.wolfBody = new ModelRenderer(this, 18, 14);
this.wolfBody.addBox(-3.0F, -2.0F, -3.0F, 6, 9, 6, 0.0F);
this.wolfBody.setRotationPoint(0.0F, 14.0F, 2.0F);
this.wolfMane = new ModelRenderer(this, 21, 0);
this.wolfMane.addBox(-3.0F, -3.0F, -3.0F, 8, 6, 7, 0.0F);
this.wolfMane.setRotationPoint(-1.0F, 14.0F, 2.0F);
this.wolfLeg1 = new ModelRenderer(this, 0, 18);
this.wolfLeg1.addBox(0.0F, 0.0F, -1.0F, 2, 8, 2, 0.0F);
this.wolfLeg1.setRotationPoint(-2.5F, 16.0F, 7.0F);
this.wolfLeg2 = new ModelRenderer(this, 0, 18);
this.wolfLeg2.addBox(0.0F, 0.0F, -1.0F, 2, 8, 2, 0.0F);
this.wolfLeg2.setRotationPoint(0.5F, 16.0F, 7.0F);
this.wolfLeg3 = new ModelRenderer(this, 0, 18);
this.wolfLeg3.addBox(0.0F, 0.0F, -1.0F, 2, 8, 2, 0.0F);
this.wolfLeg3.setRotationPoint(-2.5F, 16.0F, -4.0F);
this.wolfLeg4 = new ModelRenderer(this, 0, 18);
this.wolfLeg4.addBox(0.0F, 0.0F, -1.0F, 2, 8, 2, 0.0F);
this.wolfLeg4.setRotationPoint(0.5F, 16.0F, -4.0F);
this.wolfTail = new ModelRenderer(this, 9, 18);
this.wolfTail.addBox(0.0F, 0.0F, -1.0F, 2, 8, 2, 0.0F);
this.wolfTail.setRotationPoint(-1.0F, 12.0F, 8.0F);
this.wolfHeadMain.setTextureOffset(16, 14).addBox(-2.0F, -5.0F, 0.0F, 2, 2, 1, 0.0F);
this.wolfHeadMain.setTextureOffset(16, 14).addBox(2.0F, -5.0F, 0.0F, 2, 2, 1, 0.0F);
this.wolfHeadMain.setTextureOffset(0, 10).addBox(-0.5F, 0.0F, -5.0F, 3, 3, 4, 0.0F);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
super.render(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
if (this.isChild)
{
float f = 2.0F;
GlStateManager.pushMatrix();
GlStateManager.translate(0.0F, 5.0F * scale, 2.0F * scale);
this.wolfHeadMain.renderWithRotation(scale);
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.scale(0.5F, 0.5F, 0.5F);
GlStateManager.translate(0.0F, 24.0F * scale, 0.0F);
this.wolfBody.render(scale);
this.wolfLeg1.render(scale);
this.wolfLeg2.render(scale);
this.wolfLeg3.render(scale);
this.wolfLeg4.render(scale);
this.wolfTail.renderWithRotation(scale);
this.wolfMane.render(scale);
GlStateManager.popMatrix();
}
else
{
this.wolfHeadMain.renderWithRotation(scale);
this.wolfBody.render(scale);
this.wolfLeg1.render(scale);
this.wolfLeg2.render(scale);
this.wolfLeg3.render(scale);
this.wolfLeg4.render(scale);
this.wolfTail.renderWithRotation(scale);
this.wolfMane.render(scale);
}
}
/**
* Used for easily adding entity-dependent animations. The second and third float params here are the same second
* and third as in the setRotationAngles method.
*/
public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTickTime)
{
EntityWolf entitywolf = (EntityWolf)entitylivingbaseIn;
if (entitywolf.isAngry())
{
this.wolfTail.rotateAngleY = 0.0F;
}
else
{
this.wolfTail.rotateAngleY = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount;
}
if (entitywolf.isSitting())
{
this.wolfMane.setRotationPoint(-1.0F, 16.0F, -3.0F);
this.wolfMane.rotateAngleX = ((float)Math.PI * 2F / 5F);
this.wolfMane.rotateAngleY = 0.0F;
this.wolfBody.setRotationPoint(0.0F, 18.0F, 0.0F);
this.wolfBody.rotateAngleX = ((float)Math.PI / 4F);
this.wolfTail.setRotationPoint(-1.0F, 21.0F, 6.0F);
this.wolfLeg1.setRotationPoint(-2.5F, 22.0F, 2.0F);
this.wolfLeg1.rotateAngleX = ((float)Math.PI * 3F / 2F);
this.wolfLeg2.setRotationPoint(0.5F, 22.0F, 2.0F);
this.wolfLeg2.rotateAngleX = ((float)Math.PI * 3F / 2F);
this.wolfLeg3.rotateAngleX = 5.811947F;
this.wolfLeg3.setRotationPoint(-2.49F, 17.0F, -4.0F);
this.wolfLeg4.rotateAngleX = 5.811947F;
this.wolfLeg4.setRotationPoint(0.51F, 17.0F, -4.0F);
}
else
{
this.wolfBody.setRotationPoint(0.0F, 14.0F, 2.0F);
this.wolfBody.rotateAngleX = ((float)Math.PI / 2F);
this.wolfMane.setRotationPoint(-1.0F, 14.0F, -3.0F);
this.wolfMane.rotateAngleX = this.wolfBody.rotateAngleX;
this.wolfTail.setRotationPoint(-1.0F, 12.0F, 8.0F);
this.wolfLeg1.setRotationPoint(-2.5F, 16.0F, 7.0F);
this.wolfLeg2.setRotationPoint(0.5F, 16.0F, 7.0F);
this.wolfLeg3.setRotationPoint(-2.5F, 16.0F, -4.0F);
this.wolfLeg4.setRotationPoint(0.5F, 16.0F, -4.0F);
this.wolfLeg1.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount;
this.wolfLeg2.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.4F * limbSwingAmount;
this.wolfLeg3.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.4F * limbSwingAmount;
this.wolfLeg4.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount;
}
this.wolfHeadMain.rotateAngleZ = entitywolf.getInterestedAngle(partialTickTime) + entitywolf.getShakeAngle(partialTickTime, 0.0F);
this.wolfMane.rotateAngleZ = entitywolf.getShakeAngle(partialTickTime, -0.08F);
this.wolfBody.rotateAngleZ = entitywolf.getShakeAngle(partialTickTime, -0.16F);
this.wolfTail.rotateAngleZ = entitywolf.getShakeAngle(partialTickTime, -0.2F);
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
this.wolfHeadMain.rotateAngleX = headPitch * 0.017453292F;
this.wolfHeadMain.rotateAngleY = netHeadYaw * 0.017453292F;
this.wolfTail.rotateAngleX = ageInTicks;
}
}

View File

@@ -0,0 +1,47 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelZombie extends ModelBiped
{
public ModelZombie()
{
this(0.0F, false);
}
public ModelZombie(float modelSize, boolean p_i1168_2_)
{
super(modelSize, 0.0F, 64, p_i1168_2_ ? 32 : 64);
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
boolean flag = entityIn instanceof EntityZombie && ((EntityZombie)entityIn).isArmsRaised();
float f = MathHelper.sin(this.swingProgress * (float)Math.PI);
float f1 = MathHelper.sin((1.0F - (1.0F - this.swingProgress) * (1.0F - this.swingProgress)) * (float)Math.PI);
this.bipedRightArm.rotateAngleZ = 0.0F;
this.bipedLeftArm.rotateAngleZ = 0.0F;
this.bipedRightArm.rotateAngleY = -(0.1F - f * 0.6F);
this.bipedLeftArm.rotateAngleY = 0.1F - f * 0.6F;
float f2 = -(float)Math.PI / (flag ? 1.5F : 2.25F);
this.bipedRightArm.rotateAngleX = f2;
this.bipedLeftArm.rotateAngleX = f2;
this.bipedRightArm.rotateAngleX += f * 1.2F - f1 * 0.4F;
this.bipedLeftArm.rotateAngleX += f * 1.2F - f1 * 0.4F;
this.bipedRightArm.rotateAngleZ += MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
this.bipedRightArm.rotateAngleX += MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
this.bipedLeftArm.rotateAngleX -= MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
}
}

View File

@@ -0,0 +1,89 @@
package net.minecraft.client.model;
import net.minecraft.entity.Entity;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelZombieVillager extends ModelBiped
{
public ModelZombieVillager()
{
this(0.0F, 0.0F, false);
}
public ModelZombieVillager(float p_i1165_1_, float p_i1165_2_, boolean p_i1165_3_)
{
super(p_i1165_1_, 0.0F, 64, p_i1165_3_ ? 32 : 64);
if (p_i1165_3_)
{
this.bipedHead = new ModelRenderer(this, 0, 0);
this.bipedHead.addBox(-4.0F, -10.0F, -4.0F, 8, 8, 8, p_i1165_1_);
this.bipedHead.setRotationPoint(0.0F, 0.0F + p_i1165_2_, 0.0F);
this.bipedBody = new ModelRenderer(this, 16, 16);
this.bipedBody.setRotationPoint(0.0F, 0.0F + p_i1165_2_, 0.0F);
this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, p_i1165_1_ + 0.1F);
this.bipedRightLeg = new ModelRenderer(this, 0, 16);
this.bipedRightLeg.setRotationPoint(-2.0F, 12.0F + p_i1165_2_, 0.0F);
this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, p_i1165_1_ + 0.1F);
this.bipedLeftLeg = new ModelRenderer(this, 0, 16);
this.bipedLeftLeg.mirror = true;
this.bipedLeftLeg.setRotationPoint(2.0F, 12.0F + p_i1165_2_, 0.0F);
this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, p_i1165_1_ + 0.1F);
}
else
{
this.bipedHead = new ModelRenderer(this, 0, 0);
this.bipedHead.setRotationPoint(0.0F, p_i1165_2_, 0.0F);
this.bipedHead.setTextureOffset(0, 0).addBox(-4.0F, -10.0F, -4.0F, 8, 10, 8, p_i1165_1_);
this.bipedHead.setTextureOffset(24, 0).addBox(-1.0F, -3.0F, -6.0F, 2, 4, 2, p_i1165_1_);
this.bipedBody = new ModelRenderer(this, 16, 20);
this.bipedBody.setRotationPoint(0.0F, 0.0F + p_i1165_2_, 0.0F);
this.bipedBody.addBox(-4.0F, 0.0F, -3.0F, 8, 12, 6, p_i1165_1_);
this.bipedBody.setTextureOffset(0, 38).addBox(-4.0F, 0.0F, -3.0F, 8, 18, 6, p_i1165_1_ + 0.05F);
this.bipedRightArm = new ModelRenderer(this, 44, 38);
this.bipedRightArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, p_i1165_1_);
this.bipedRightArm.setRotationPoint(-5.0F, 2.0F + p_i1165_2_, 0.0F);
this.bipedLeftArm = new ModelRenderer(this, 44, 38);
this.bipedLeftArm.mirror = true;
this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, p_i1165_1_);
this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + p_i1165_2_, 0.0F);
this.bipedRightLeg = new ModelRenderer(this, 0, 22);
this.bipedRightLeg.setRotationPoint(-2.0F, 12.0F + p_i1165_2_, 0.0F);
this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, p_i1165_1_);
this.bipedLeftLeg = new ModelRenderer(this, 0, 22);
this.bipedLeftLeg.mirror = true;
this.bipedLeftLeg.setRotationPoint(2.0F, 12.0F + p_i1165_2_, 0.0F);
this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, p_i1165_1_);
}
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
EntityZombie entityzombie = (EntityZombie)entityIn;
float f = MathHelper.sin(this.swingProgress * (float)Math.PI);
float f1 = MathHelper.sin((1.0F - (1.0F - this.swingProgress) * (1.0F - this.swingProgress)) * (float)Math.PI);
this.bipedRightArm.rotateAngleZ = 0.0F;
this.bipedLeftArm.rotateAngleZ = 0.0F;
this.bipedRightArm.rotateAngleY = -(0.1F - f * 0.6F);
this.bipedLeftArm.rotateAngleY = 0.1F - f * 0.6F;
float f2 = -(float)Math.PI / (entityzombie.isArmsRaised() ? 1.5F : 2.25F);
this.bipedRightArm.rotateAngleX = f2;
this.bipedLeftArm.rotateAngleX = f2;
this.bipedRightArm.rotateAngleX += f * 1.2F - f1 * 0.4F;
this.bipedLeftArm.rotateAngleX += f * 1.2F - f1 * 0.4F;
this.bipedRightArm.rotateAngleZ += MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
this.bipedRightArm.rotateAngleX += MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
this.bipedLeftArm.rotateAngleX -= MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
}
}

View File

@@ -0,0 +1,34 @@
package net.minecraft.client.model;
import net.minecraft.util.math.Vec3d;
public class PositionTextureVertex
{
public Vec3d vector3D;
public float texturePositionX;
public float texturePositionY;
public PositionTextureVertex(float p_i1158_1_, float p_i1158_2_, float p_i1158_3_, float p_i1158_4_, float p_i1158_5_)
{
this(new Vec3d((double)p_i1158_1_, (double)p_i1158_2_, (double)p_i1158_3_), p_i1158_4_, p_i1158_5_);
}
public PositionTextureVertex setTexturePosition(float p_78240_1_, float p_78240_2_)
{
return new PositionTextureVertex(this, p_78240_1_, p_78240_2_);
}
public PositionTextureVertex(PositionTextureVertex textureVertex, float texturePositionXIn, float texturePositionYIn)
{
this.vector3D = textureVertex.vector3D;
this.texturePositionX = texturePositionXIn;
this.texturePositionY = texturePositionYIn;
}
public PositionTextureVertex(Vec3d p_i47091_1_, float p_i47091_2_, float p_i47091_3_)
{
this.vector3D = p_i47091_1_;
this.texturePositionX = p_i47091_2_;
this.texturePositionY = p_i47091_3_;
}
}

View File

@@ -0,0 +1,19 @@
package net.minecraft.client.model;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class TextureOffset
{
/** The x coordinate offset of the texture */
public final int textureOffsetX;
/** The y coordinate offset of the texture */
public final int textureOffsetY;
public TextureOffset(int textureOffsetXIn, int textureOffsetYIn)
{
this.textureOffsetX = textureOffsetXIn;
this.textureOffsetY = textureOffsetYIn;
}
}

View File

@@ -0,0 +1,76 @@
package net.minecraft.client.model;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.util.math.Vec3d;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class TexturedQuad
{
public PositionTextureVertex[] vertexPositions;
public int nVertices;
private boolean invertNormal;
public TexturedQuad(PositionTextureVertex[] vertices)
{
this.vertexPositions = vertices;
this.nVertices = vertices.length;
}
public TexturedQuad(PositionTextureVertex[] vertices, int texcoordU1, int texcoordV1, int texcoordU2, int texcoordV2, float textureWidth, float textureHeight)
{
this(vertices);
float f = 0.0F / textureWidth;
float f1 = 0.0F / textureHeight;
vertices[0] = vertices[0].setTexturePosition((float)texcoordU2 / textureWidth - f, (float)texcoordV1 / textureHeight + f1);
vertices[1] = vertices[1].setTexturePosition((float)texcoordU1 / textureWidth + f, (float)texcoordV1 / textureHeight + f1);
vertices[2] = vertices[2].setTexturePosition((float)texcoordU1 / textureWidth + f, (float)texcoordV2 / textureHeight - f1);
vertices[3] = vertices[3].setTexturePosition((float)texcoordU2 / textureWidth - f, (float)texcoordV2 / textureHeight - f1);
}
public void flipFace()
{
PositionTextureVertex[] apositiontexturevertex = new PositionTextureVertex[this.vertexPositions.length];
for (int i = 0; i < this.vertexPositions.length; ++i)
{
apositiontexturevertex[i] = this.vertexPositions[this.vertexPositions.length - i - 1];
}
this.vertexPositions = apositiontexturevertex;
}
/**
* Draw this primitve. This is typically called only once as the generated drawing instructions are saved by the
* renderer and reused later.
*/
@SideOnly(Side.CLIENT)
public void draw(BufferBuilder renderer, float scale)
{
Vec3d vec3d = this.vertexPositions[1].vector3D.subtractReverse(this.vertexPositions[0].vector3D);
Vec3d vec3d1 = this.vertexPositions[1].vector3D.subtractReverse(this.vertexPositions[2].vector3D);
Vec3d vec3d2 = vec3d1.crossProduct(vec3d).normalize();
float f = (float)vec3d2.x;
float f1 = (float)vec3d2.y;
float f2 = (float)vec3d2.z;
if (this.invertNormal)
{
f = -f;
f1 = -f1;
f2 = -f2;
}
renderer.begin(7, DefaultVertexFormats.OLDMODEL_POSITION_TEX_NORMAL);
for (int i = 0; i < 4; ++i)
{
PositionTextureVertex positiontexturevertex = this.vertexPositions[i];
renderer.pos(positiontexturevertex.vector3D.x * (double)scale, positiontexturevertex.vector3D.y * (double)scale, positiontexturevertex.vector3D.z * (double)scale).tex((double)positiontexturevertex.texturePositionX, (double)positiontexturevertex.texturePositionY).normal(f, f1, f2).endVertex();
}
Tessellator.getInstance().draw();
}
}

View File

@@ -0,0 +1,7 @@
// Auto generated package-info by MCP
@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
package net.minecraft.client.model;
import mcp.MethodsReturnNonnullByDefault;
import javax.annotation.ParametersAreNonnullByDefault;