| 1 | package net.minecraft.client.model;
|
| 2 |
|
| 3 | import net.minecraft.client.renderer.GlStateManager;
|
| 4 | import net.minecraft.entity.Entity;
|
| 5 |
|
| 6 | public class ModelPlayer extends ModelBiped
|
| 7 | {
|
| 8 | public ModelRenderer bipedLeftArmwear;
|
| 9 | public ModelRenderer bipedRightArmwear;
|
| 10 | public ModelRenderer bipedLeftLegwear;
|
| 11 | public ModelRenderer bipedRightLegwear;
|
| 12 | public ModelRenderer bipedBodyWear;
|
| 13 | private ModelRenderer bipedCape;
|
| 14 | private ModelRenderer bipedDeadmau5Head;
|
| 15 | private boolean smallArms;
|
| 16 |
|
| 17 | public ModelPlayer(float p_i46304_1_, boolean p_i46304_2_)
|
| 18 | {
|
| 19 | super(p_i46304_1_, 0.0F, 64, 64);
|
| 20 | this.smallArms = p_i46304_2_;
|
| 21 | this.bipedDeadmau5Head = new ModelRenderer(this, 24, 0);
|
| 22 | this.bipedDeadmau5Head.addBox(-3.0F, -6.0F, -1.0F, 6, 6, 1, p_i46304_1_);
|
| 23 | this.bipedCape = new ModelRenderer(this, 0, 0);
|
| 24 | this.bipedCape.setTextureSize(64, 32);
|
| 25 | this.bipedCape.addBox(-5.0F, 0.0F, -1.0F, 10, 16, 1, p_i46304_1_);
|
| 26 |
|
| 27 | if (p_i46304_2_)
|
| 28 | {
|
| 29 | this.bipedLeftArm = new ModelRenderer(this, 32, 48);
|
| 30 | this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 3, 12, 4, p_i46304_1_);
|
| 31 | this.bipedLeftArm.setRotationPoint(5.0F, 2.5F, 0.0F);
|
| 32 | this.bipedRightArm = new ModelRenderer(this, 40, 16);
|
| 33 | this.bipedRightArm.addBox(-2.0F, -2.0F, -2.0F, 3, 12, 4, p_i46304_1_);
|
| 34 | this.bipedRightArm.setRotationPoint(-5.0F, 2.5F, 0.0F);
|
| 35 | this.bipedLeftArmwear = new ModelRenderer(this, 48, 48);
|
| 36 | this.bipedLeftArmwear.addBox(-1.0F, -2.0F, -2.0F, 3, 12, 4, p_i46304_1_ + 0.25F);
|
| 37 | this.bipedLeftArmwear.setRotationPoint(5.0F, 2.5F, 0.0F);
|
| 38 | this.bipedRightArmwear = new ModelRenderer(this, 40, 32);
|
| 39 | this.bipedRightArmwear.addBox(-2.0F, -2.0F, -2.0F, 3, 12, 4, p_i46304_1_ + 0.25F);
|
| 40 | this.bipedRightArmwear.setRotationPoint(-5.0F, 2.5F, 10.0F);
|
| 41 | }
|
| 42 | else
|
| 43 | {
|
| 44 | this.bipedLeftArm = new ModelRenderer(this, 32, 48);
|
| 45 | this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, p_i46304_1_);
|
| 46 | this.bipedLeftArm.setRotationPoint(5.0F, 2.0F, 0.0F);
|
| 47 | this.bipedLeftArmwear = new ModelRenderer(this, 48, 48);
|
| 48 | this.bipedLeftArmwear.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, p_i46304_1_ + 0.25F);
|
| 49 | this.bipedLeftArmwear.setRotationPoint(5.0F, 2.0F, 0.0F);
|
| 50 | this.bipedRightArmwear = new ModelRenderer(this, 40, 32);
|
| 51 | this.bipedRightArmwear.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, p_i46304_1_ + 0.25F);
|
| 52 | this.bipedRightArmwear.setRotationPoint(-5.0F, 2.0F, 10.0F);
|
| 53 | }
|
| 54 |
|
| 55 | this.bipedLeftLeg = new ModelRenderer(this, 16, 48);
|
| 56 | this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, p_i46304_1_);
|
| 57 | this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F, 0.0F);
|
| 58 | this.bipedLeftLegwear = new ModelRenderer(this, 0, 48);
|
| 59 | this.bipedLeftLegwear.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, p_i46304_1_ + 0.25F);
|
| 60 | this.bipedLeftLegwear.setRotationPoint(1.9F, 12.0F, 0.0F);
|
| 61 | this.bipedRightLegwear = new ModelRenderer(this, 0, 32);
|
| 62 | this.bipedRightLegwear.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, p_i46304_1_ + 0.25F);
|
| 63 | this.bipedRightLegwear.setRotationPoint(-1.9F, 12.0F, 0.0F);
|
| 64 | this.bipedBodyWear = new ModelRenderer(this, 16, 32);
|
| 65 | this.bipedBodyWear.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, p_i46304_1_ + 0.25F);
|
| 66 | this.bipedBodyWear.setRotationPoint(0.0F, 0.0F, 0.0F);
|
| 67 | }
|
| 68 |
|
| 69 | /**
|
| 70 | * Sets the models various rotation angles then renders the model.
|
| 71 | */
|
| 72 | public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale)
|
| 73 | {
|
| 74 | super.render(entityIn, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale);
|
| 75 | GlStateManager.pushMatrix();
|
| 76 |
|
| 77 | if (this.isChild)
|
| 78 | {
|
| 79 | float f = 2.0F;
|
| 80 | GlStateManager.scale(1.0F / f, 1.0F / f, 1.0F / f);
|
| 81 | GlStateManager.translate(0.0F, 24.0F * scale, 0.0F);
|
| 82 | this.bipedLeftLegwear.render(scale);
|
| 83 | this.bipedRightLegwear.render(scale);
|
| 84 | this.bipedLeftArmwear.render(scale);
|
| 85 | this.bipedRightArmwear.render(scale);
|
| 86 | this.bipedBodyWear.render(scale);
|
| 87 | }
|
| 88 | else
|
| 89 | {
|
| 90 | if (entityIn.isSneaking())
|
| 91 | {
|
| 92 | GlStateManager.translate(0.0F, 0.2F, 0.0F);
|
| 93 | }
|
| 94 |
|
| 95 | this.bipedLeftLegwear.render(scale);
|
| 96 | this.bipedRightLegwear.render(scale);
|
| 97 | this.bipedLeftArmwear.render(scale);
|
| 98 | this.bipedRightArmwear.render(scale);
|
| 99 | this.bipedBodyWear.render(scale);
|
| 100 | }
|
| 101 |
|
| 102 | GlStateManager.popMatrix();
|
| 103 | }
|
| 104 |
|
| 105 | public void renderDeadmau5Head(float p_178727_1_)
|
| 106 | {
|
| 107 | copyModelAngles(this.bipedHead, this.bipedDeadmau5Head);
|
| 108 | this.bipedDeadmau5Head.rotationPointX = 0.0F;
|
| 109 | this.bipedDeadmau5Head.rotationPointY = 0.0F;
|
| 110 | this.bipedDeadmau5Head.render(p_178727_1_);
|
| 111 | }
|
| 112 |
|
| 113 | public void renderCape(float p_178728_1_)
|
| 114 | {
|
| 115 | this.bipedCape.render(p_178728_1_);
|
| 116 | }
|
| 117 |
|
| 118 | /**
|
| 119 | * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
|
| 120 | * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
|
| 121 | * "far" arms and legs can swing at most.
|
| 122 | */
|
| 123 | public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
|
| 124 | {
|
| 125 | super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
|
| 126 | copyModelAngles(this.bipedLeftLeg, this.bipedLeftLegwear);
|
| 127 | copyModelAngles(this.bipedRightLeg, this.bipedRightLegwear);
|
| 128 | copyModelAngles(this.bipedLeftArm, this.bipedLeftArmwear);
|
| 129 | copyModelAngles(this.bipedRightArm, this.bipedRightArmwear);
|
| 130 | copyModelAngles(this.bipedBody, this.bipedBodyWear);
|
| 131 |
|
| 132 | if (entityIn.isSneaking())
|
| 133 | {
|
| 134 | this.bipedCape.rotationPointY = 2.0F;
|
| 135 | }
|
| 136 | else
|
| 137 | {
|
| 138 | this.bipedCape.rotationPointY = 0.0F;
|
| 139 | }
|
| 140 | }
|
| 141 |
|
| 142 | public void renderRightArm()
|
| 143 | {
|
| 144 | this.bipedRightArm.render(0.0625F);
|
| 145 | this.bipedRightArmwear.render(0.0625F);
|
| 146 | }
|
| 147 |
|
| 148 | public void renderLeftArm()
|
| 149 | {
|
| 150 | this.bipedLeftArm.render(0.0625F);
|
| 151 | this.bipedLeftArmwear.render(0.0625F);
|
| 152 | }
|
| 153 |
|
| 154 | public void setInvisible(boolean invisible)
|
| 155 | {
|
| 156 | super.setInvisible(invisible);
|
| 157 | this.bipedLeftArmwear.showModel = invisible;
|
| 158 | this.bipedRightArmwear.showModel = invisible;
|
| 159 | this.bipedLeftLegwear.showModel = invisible;
|
| 160 | this.bipedRightLegwear.showModel = invisible;
|
| 161 | this.bipedBodyWear.showModel = invisible;
|
| 162 | this.bipedCape.showModel = invisible;
|
| 163 | this.bipedDeadmau5Head.showModel = invisible;
|
| 164 | }
|
| 165 |
|
| 166 | public void postRenderArm(float scale)
|
| 167 | {
|
| 168 | if (this.smallArms)
|
| 169 | {
|
| 170 | ++this.bipedRightArm.rotationPointX;
|
| 171 | this.bipedRightArm.postRender(scale);
|
| 172 | --this.bipedRightArm.rotationPointX;
|
| 173 | }
|
| 174 | else
|
| 175 | {
|
| 176 | this.bipedRightArm.postRender(scale);
|
| 177 | }
|
| 178 | }
|
| 179 | }
|
| 180 |
|