That's one heck of a commit you've got there...
I may have got a bit behind with version control. A lot behind, in fact. Maybe I'll go back and split this sometime - then again, I probably won't. But hey, at least it's here!
This commit is contained in:
@@ -1,99 +1,110 @@
|
||||
package electroblob.wizardry.client.model;
|
||||
|
||||
import electroblob.wizardry.block.BlockStatue;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class ModelWizardArmour extends ModelArmourFixer {
|
||||
ModelRenderer Shape1;
|
||||
ModelRenderer Shape2;
|
||||
ModelRenderer Shape3;
|
||||
ModelRenderer Shape4;
|
||||
ModelRenderer Shape5;
|
||||
ModelRenderer Shape6;
|
||||
ModelRenderer Shape7;
|
||||
|
||||
ModelRenderer hatBrim;
|
||||
ModelRenderer hatSegment1;
|
||||
ModelRenderer hatSegment2;
|
||||
ModelRenderer hatSegment3;
|
||||
ModelRenderer hatSegment4;
|
||||
ModelRenderer hatSegment5;
|
||||
ModelRenderer hatSegment6;
|
||||
ModelRenderer robe;
|
||||
|
||||
public ModelWizardArmour(float scale){
|
||||
public ModelWizardArmour(float delta){
|
||||
|
||||
super(scale, 0, 64, 64);
|
||||
super(delta, 0, 64, 64);
|
||||
|
||||
// This is necessary to stop the head from scaling.
|
||||
this.bipedHead = new ModelRenderer(this, 0, 0);
|
||||
this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.1f);
|
||||
// The hat layer has an offset of 0.5, so 0.6 is about the smallest we can get away with
|
||||
this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.6f);
|
||||
this.bipedHead.setRotationPoint(0.0F, 0.0F + 0, 0.0F);
|
||||
|
||||
Shape1 = new ModelRenderer(this, -16, 32);
|
||||
Shape1.addBox(-8F, -7F, -8F, 16, 0, 16);
|
||||
Shape1.setRotationPoint(0F, 0F, 0F);
|
||||
Shape1.setTextureSize(64, 64);
|
||||
Shape1.mirror = true;
|
||||
setRotation(Shape1, 0F, 0F, 0F);
|
||||
hatBrim = new ModelRenderer(this, 0, 47);
|
||||
// Making the height 1 stops the top and bottom z-fighting when the hat is enchanted
|
||||
hatBrim.addBox(-8F, -6.85F, -8F, 16, 1, 16, 0.6f);
|
||||
hatBrim.setRotationPoint(0F, 0F, 0F);
|
||||
hatBrim.setTextureSize(64, 64);
|
||||
hatBrim.mirror = true;
|
||||
setRotation(hatBrim, 0F, 0F, 0F);
|
||||
|
||||
Shape2 = new ModelRenderer(this, 0, 48);
|
||||
Shape2.addBox(0F, 0F, 0F, 6, 2, 6);
|
||||
Shape2.setRotationPoint(-3F, -10F, -3F);
|
||||
Shape2.setTextureSize(64, 64);
|
||||
Shape2.mirror = true;
|
||||
setRotation(Shape2, -0.1396263F, 0F, 0F);
|
||||
hatSegment1 = new ModelRenderer(this, 0, 32);
|
||||
hatSegment1.addBox(0F, 0F, 0F, 6, 2, 6, 0.2f);
|
||||
hatSegment1.setRotationPoint(-3F, -10.6F, -3F);
|
||||
hatSegment1.setTextureSize(64, 64);
|
||||
hatSegment1.mirror = true;
|
||||
setRotation(hatSegment1, -0.1396263F, 0F, 0F);
|
||||
|
||||
Shape3 = new ModelRenderer(this, 0, 56);
|
||||
Shape3.addBox(0F, 0F, 0F, 5, 2, 5);
|
||||
Shape3.setRotationPoint(-2.5F, -11.53333F, -2F);
|
||||
Shape3.setTextureSize(64, 64);
|
||||
Shape3.mirror = true;
|
||||
setRotation(Shape3, -0.2443461F, 0F, 0F);
|
||||
hatSegment2 = new ModelRenderer(this, 0, 40);
|
||||
hatSegment2.addBox(0F, 0F, 0F, 5, 2, 5, 0.1f);
|
||||
hatSegment2.setRotationPoint(-2.5F, -12.13333F, -2F);
|
||||
hatSegment2.setTextureSize(64, 64);
|
||||
hatSegment2.mirror = true;
|
||||
setRotation(hatSegment2, -0.2443461F, 0F, 0F);
|
||||
|
||||
Shape4 = new ModelRenderer(this, 24, 48);
|
||||
Shape4.addBox(0F, 0F, 0F, 4, 2, 4);
|
||||
Shape4.setRotationPoint(-2F, -13F, -1F);
|
||||
Shape4.setTextureSize(64, 64);
|
||||
Shape4.mirror = true;
|
||||
setRotation(Shape4, -0.4014257F, 0F, 0F);
|
||||
hatSegment3 = new ModelRenderer(this, 24, 32);
|
||||
hatSegment3.addBox(0F, 0F, 0F, 4, 2, 4);
|
||||
hatSegment3.setRotationPoint(-2F, -13.6F, -1F);
|
||||
hatSegment3.setTextureSize(64, 64);
|
||||
hatSegment3.mirror = true;
|
||||
setRotation(hatSegment3, -0.4014257F, 0F, 0F);
|
||||
|
||||
Shape5 = new ModelRenderer(this, 24, 54);
|
||||
Shape5.addBox(0F, 0F, 0F, 3, 2, 3);
|
||||
Shape5.setRotationPoint(-1.5F, -14F, 0F);
|
||||
Shape5.setTextureSize(64, 64);
|
||||
Shape5.mirror = true;
|
||||
setRotation(Shape5, -0.5759587F, 0F, 0F);
|
||||
hatSegment4 = new ModelRenderer(this, 24, 38);
|
||||
hatSegment4.addBox(0F, 0F, 0F, 3, 2, 3);
|
||||
hatSegment4.setRotationPoint(-1.5F, -14.6F, 0F);
|
||||
hatSegment4.setTextureSize(64, 64);
|
||||
hatSegment4.mirror = true;
|
||||
setRotation(hatSegment4, -0.5759587F, 0F, 0F);
|
||||
|
||||
Shape6 = new ModelRenderer(this, 20, 59);
|
||||
Shape6.addBox(0F, 0F, 0F, 2, 2, 2);
|
||||
Shape6.setRotationPoint(-1F, -14F, 0F);
|
||||
Shape6.setTextureSize(64, 64);
|
||||
Shape6.mirror = true;
|
||||
setRotation(Shape6, 0.3316126F, 0F, 0F);
|
||||
hatSegment5 = new ModelRenderer(this, 20, 43);
|
||||
hatSegment5.addBox(0F, 0F, 0F, 2, 2, 2);
|
||||
hatSegment5.setRotationPoint(-1F, -14.6F, 0F);
|
||||
hatSegment5.setTextureSize(64, 64);
|
||||
hatSegment5.mirror = true;
|
||||
setRotation(hatSegment5, 0.3316126F, 0F, 0F);
|
||||
|
||||
Shape7 = new ModelRenderer(this, 28, 59);
|
||||
Shape7.addBox(0F, 0F, 0F, 1, 1, 3);
|
||||
Shape7.setRotationPoint(-0.5F, -14.5F, 2F);
|
||||
Shape7.setTextureSize(64, 64);
|
||||
Shape7.mirror = true;
|
||||
setRotation(Shape7, -0.5585054F, 0F, 0F);
|
||||
hatSegment6 = new ModelRenderer(this, 28, 43);
|
||||
hatSegment6.addBox(0F, 0F, 0F, 1, 1, 3);
|
||||
hatSegment6.setRotationPoint(-0.5F, -15.1F, 2F);
|
||||
hatSegment6.setTextureSize(64, 64);
|
||||
hatSegment6.mirror = true;
|
||||
setRotation(hatSegment6, -0.5585054F, 0F, 0F);
|
||||
|
||||
// The robe is now the body
|
||||
bipedBody = new ModelRenderer(this, 40, 42);
|
||||
bipedBody.addBox(-4F, 0F, -2F, 8, 18, 4, scale);
|
||||
bipedBody = new ModelRenderer(this, 16, 16);
|
||||
bipedBody.addBox(-4F, 0F, -2F, 8, 11, 4, delta);
|
||||
bipedBody.setRotationPoint(0F, 0F, 0F);
|
||||
bipedBody.setTextureSize(64, 64);
|
||||
bipedBody.mirror = true;
|
||||
setRotation(bipedBody, 0F, 0F, 0F);
|
||||
|
||||
robe = new ModelRenderer(this, 40, 32);
|
||||
robe.addBox(-4F, 0F, -2F, 8, 7, 4, delta);
|
||||
robe.setRotationPoint(0F, 12, 0F); // 12.5 accounts for the expansion of each box
|
||||
robe.setTextureSize(64, 64);
|
||||
robe.mirror = true;
|
||||
setRotation(robe, 0F, 0F, 0F);
|
||||
|
||||
// Makes the hat rotate with the head.
|
||||
bipedHead.addChild(Shape1);
|
||||
bipedHead.addChild(Shape2);
|
||||
bipedHead.addChild(Shape3);
|
||||
bipedHead.addChild(Shape4);
|
||||
bipedHead.addChild(Shape5);
|
||||
bipedHead.addChild(Shape6);
|
||||
bipedHead.addChild(Shape7);
|
||||
// Makes the robe move with the body
|
||||
// bipedBody.addChild(robe);
|
||||
bipedHead.addChild(hatBrim);
|
||||
bipedHead.addChild(hatSegment1);
|
||||
bipedHead.addChild(hatSegment2);
|
||||
bipedHead.addChild(hatSegment3);
|
||||
bipedHead.addChild(hatSegment4);
|
||||
bipedHead.addChild(hatSegment5);
|
||||
bipedHead.addChild(hatSegment6);
|
||||
}
|
||||
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){
|
||||
if(entity.isInvisible() && !entity.getEntityData().getBoolean(BlockStatue.PETRIFIED_NBT_KEY)
|
||||
&& !entity.getEntityData().getBoolean(BlockStatue.FROZEN_NBT_KEY)) return;
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
this.robe.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z){
|
||||
@@ -104,6 +115,20 @@ public class ModelWizardArmour extends ModelArmourFixer {
|
||||
|
||||
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity){
|
||||
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
this.robe.showModel = this.bipedBody.showModel;
|
||||
if(this.isSneak){
|
||||
//this.robe.rotationPointY = 10.5f;
|
||||
this.robe.rotationPointZ = 4;
|
||||
}else{
|
||||
//this.robe.rotationPointY = 12.5f;
|
||||
this.robe.rotationPointZ = 0;
|
||||
}
|
||||
|
||||
// The bottom part of the robe takes the y rotation from the rest of the robe but the x/z rotation
|
||||
// from the average of the two legs
|
||||
this.robe.rotateAngleX = (this.bipedLeftLeg.rotateAngleX + this.bipedRightLeg.rotateAngleX) / 2f;
|
||||
this.robe.rotateAngleY = this.bipedBody.rotateAngleY;
|
||||
this.robe.rotateAngleZ = (this.bipedLeftLeg.rotateAngleZ + this.bipedRightLeg.rotateAngleZ) / 2f;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user