Aww yis. Proper endermen heads!

This commit is contained in:
Bernhard Bonigl committed 2014-08-01 20:37:45 +02:00
1 parent ee6448b65d
commit 9850d334a3
4 files changed
+96 -2

No files matched your search

@@ -39,6 +39,9 @@ import java.util.List;
// todo: Unknown blocks get incorrect mining level. (just check if they're higher than the places where i added additional harvest levels and add the proper ammount to match up with the old mining level)
// todo: add hardcoded ExtraTic mining levels
// todo: add batman-hat (enderman-head without jaw and eyes)
// todo: add enderman-jaw helmet as a very rare enderman drop :D
@Mod(modid= Reference.MOD_ID, name= Reference.MOD_NAME, version="${version}",
dependencies = "required-after:" + Reference.TCON_MOD_ID + ";after:*")
public class IguanaTweaksTConstruct {
@@ -3,6 +3,7 @@ package iguanaman.iguanatweakstconstruct.mobheads.renderers;
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelSkeletonHead;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer;
@@ -22,12 +23,20 @@ public class IguanaTileEntitySkullRenderer extends TileEntitySpecialRenderer {
private ModelSkeletonHead modelSkull = new ModelSkeletonHead(0,0,64,32); // standard skull model
private ModelSkeletonHead modelZombie = new ModelSkeletonHead(0,0,64,64); // zombie skull model
private ModelHeadwear modelEnderManJaw = new ModelHeadwear(0,16,64,32);
private ModelEnderManHead modelEnderManHead = new ModelEnderManHead();
private ResourceLocation[] textures = new ResourceLocation[] {
new ResourceLocation("textures/entity/enderman/enderman.png"),
new ResourceLocation("textures/entity/zombie_pigman.png"),
new ResourceLocation("textures/entity/blaze.png")
new ResourceLocation("textures/entity/blaze.png"),
// modsupport: Thermal Expansion
new ResourceLocation("thermalfoundation","textures/entity/Blizz.png")
};
private ResourceLocation enderManEyes = new ResourceLocation("textures/entity/enderman/enderman_eyes.png");
public IguanaTileEntitySkullRenderer()
{
this.func_147497_a(TileEntityRendererDispatcher.instance);
@@ -47,8 +56,11 @@ public class IguanaTileEntitySkullRenderer extends TileEntitySpecialRenderer {
public void renderSkull(float x, float y, float z, float r, int sidePlacement, int meta)
{
ModelSkeletonHead model = modelSkull;
ModelBase model = modelSkull;
// chose model
if(meta == 0)
model = modelEnderManHead;
if(meta == 1)
model = modelZombie;
@@ -56,6 +68,10 @@ public class IguanaTileEntitySkullRenderer extends TileEntitySpecialRenderer {
this.bindTexture(textures[meta]);
// debug
//model = new ModelSkeletonHead(0,16,64,32);
//this.bindTexture(new ResourceLocation("textures/entity/enderman/enderman_eyes.png"));
// begin rendering
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_CULL_FACE);
@@ -95,6 +111,14 @@ public class IguanaTileEntitySkullRenderer extends TileEntitySpecialRenderer {
model.render(null, 0.0f, 0.0f, 0.0f, r, 0.0f, f4);
// also render endermanstuff!
if(meta == 0)
{
//modelEnderManJaw.render(null, 0.0f, 0.0f, 0.0f, r, 0.0f, f4);
this.bindTexture(enderManEyes);
model.render(null, 0.0f, 0.0f, 0.0f, r, 0.0f, f4);
}
GL11.glPopMatrix();
}
}
@@ -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;
}
}
@@ -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);
}
}