This repository has been archived by the owner on Mar 10, 2021. It is now read-only.
forked from iguanaman/IguanaTweaksTConstruct
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
96 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/main/java/iguanaman/iguanatweakstconstruct/mobheads/renderers/ModelEnderManHead.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package iguanaman.iguanatweakstconstruct.mobheads.renderers; | ||
|
||
import net.minecraft.client.model.ModelBase; | ||
import net.minecraft.client.model.ModelRenderer; | ||
import net.minecraft.client.model.ModelSkeletonHead; | ||
import net.minecraft.entity.Entity; | ||
|
||
public class ModelEnderManHead extends ModelBase { | ||
|
||
public ModelRenderer endermanHead; | ||
public ModelRenderer endermanJaw; | ||
|
||
public ModelEnderManHead() | ||
{ | ||
this.textureWidth = 64; | ||
this.textureHeight = 32; | ||
this.endermanHead = new ModelRenderer(this, 0, 0); | ||
this.endermanHead.addBox(-4.0F, -10.0F, -4.0F, 8, 8, 8, 0.0F); | ||
this.endermanHead.setRotationPoint(0.0F, 0.0F, 0.0F); | ||
this.endermanJaw = new ModelRenderer(this, 0, 16); | ||
this.endermanJaw.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.3F); | ||
this.endermanJaw.setRotationPoint(0.0F, 0.0F, 0.0F); | ||
} | ||
|
||
/** | ||
* Sets the models various rotation angles then renders the model. | ||
*/ | ||
public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) | ||
{ | ||
this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); | ||
this.endermanHead.render(p_78088_7_); | ||
this.endermanJaw.render(p_78088_7_); | ||
} | ||
|
||
/** | ||
* 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 p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) | ||
{ | ||
super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_); | ||
this.endermanHead.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); | ||
this.endermanHead.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); | ||
|
||
this.endermanJaw.rotateAngleX = this.endermanHead.rotateAngleX; | ||
this.endermanJaw.rotateAngleY = this.endermanHead.rotateAngleY; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/iguanaman/iguanatweakstconstruct/mobheads/renderers/ModelHeadwear.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package iguanaman.iguanatweakstconstruct.mobheads.renderers; | ||
|
||
import net.minecraft.client.model.ModelBase; | ||
import net.minecraft.client.model.ModelRenderer; | ||
import net.minecraft.client.model.ModelSkeletonHead; | ||
import net.minecraft.entity.Entity; | ||
|
||
public class ModelHeadwear extends ModelSkeletonHead | ||
{ | ||
public ModelHeadwear(int offsetX, int offsetY, int width, int height) | ||
{ | ||
this.textureWidth = width; | ||
this.textureHeight = height; | ||
this.skeletonHead = new ModelRenderer(this, offsetX, offsetY); | ||
this.skeletonHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.4F); | ||
this.skeletonHead.setRotationPoint(0.0F, 0.0F, 0.0F); | ||
} | ||
} |