Initial commit
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
package electroblob.wizardry.client.model;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class ModelHammer extends ModelBase
|
||||
{
|
||||
ModelRenderer Shape1;
|
||||
ModelRenderer Shape2;
|
||||
ModelRenderer Shape3;
|
||||
ModelRenderer Shape4;
|
||||
ModelRenderer Shape5;
|
||||
ModelRenderer Shape6;
|
||||
|
||||
public ModelHammer()
|
||||
{
|
||||
textureWidth = 64;
|
||||
textureHeight = 64;
|
||||
|
||||
Shape1 = new ModelRenderer(this, 0, 0);
|
||||
Shape1.addBox(0F, 0F, 0F, 20, 12, 12);
|
||||
Shape1.setRotationPoint(-10F, 12F, -6F);
|
||||
Shape1.setTextureSize(64, 64);
|
||||
Shape1.mirror = true;
|
||||
setRotation(Shape1, 0F, 0F, 0F);
|
||||
Shape2 = new ModelRenderer(this, 0, 24);
|
||||
Shape2.addBox(0F, 0F, 0F, 4, 14, 4);
|
||||
Shape2.setRotationPoint(-2F, -2F, -2F);
|
||||
Shape2.setTextureSize(64, 64);
|
||||
Shape2.mirror = true;
|
||||
setRotation(Shape2, 0F, 0F, 0F);
|
||||
Shape3 = new ModelRenderer(this, 0, 49);
|
||||
Shape3.addBox(0F, 0F, 0F, 5, 5, 5);
|
||||
Shape3.setRotationPoint(-2.5F, -7F, -2.5F);
|
||||
Shape3.setTextureSize(64, 64);
|
||||
Shape3.mirror = true;
|
||||
setRotation(Shape3, 0F, 0F, 0F);
|
||||
Shape4 = new ModelRenderer(this, 0, 42);
|
||||
Shape4.addBox(0F, 0F, 0F, 5, 2, 5);
|
||||
Shape4.setRotationPoint(-2.5F, 10F, -2.5F);
|
||||
Shape4.setTextureSize(64, 64);
|
||||
Shape4.mirror = true;
|
||||
setRotation(Shape4, 0F, 0F, 0F);
|
||||
Shape5 = new ModelRenderer(this, 20, 24);
|
||||
Shape5.addBox(0F, 0F, 0F, 2, 14, 14);
|
||||
Shape5.setRotationPoint(-8F, 11F, -7F);
|
||||
Shape5.setTextureSize(64, 64);
|
||||
Shape5.mirror = true;
|
||||
setRotation(Shape5, 0F, 0F, 0F);
|
||||
Shape6 = new ModelRenderer(this, 20, 24);
|
||||
Shape6.addBox(0F, 0F, 0F, 2, 14, 14);
|
||||
Shape6.setRotationPoint(6F, 11F, -7F);
|
||||
Shape6.setTextureSize(64, 64);
|
||||
Shape6.mirror = true;
|
||||
setRotation(Shape6, 0F, 0F, 0F);
|
||||
}
|
||||
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
Shape1.render(f5);
|
||||
Shape2.render(f5);
|
||||
Shape3.render(f5);
|
||||
Shape4.render(f5);
|
||||
Shape5.render(f5);
|
||||
Shape6.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||
{
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,321 @@
|
||||
package electroblob.wizardry.client.model;
|
||||
|
||||
import javax.vecmath.Matrix4f;
|
||||
import javax.vecmath.Vector3f;
|
||||
|
||||
import electroblob.wizardry.entity.living.EntityIceGiant;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ModelIceGiant extends ModelBase
|
||||
{
|
||||
/** The head model for the iron golem. */
|
||||
public ModelRenderer iceGiantHead;
|
||||
|
||||
/** The body model for the iron golem. */
|
||||
public ModelRenderer iceGiantBody;
|
||||
|
||||
/** The right arm model for the iron golem. */
|
||||
public ModelRenderer iceGiantRightArm;
|
||||
|
||||
/** The left arm model for the iron golem. */
|
||||
public ModelRenderer iceGiantLeftArm;
|
||||
|
||||
/** The left leg model for the Iron Golem. */
|
||||
public ModelRenderer iceGiantLeftLeg;
|
||||
|
||||
/** The right leg model for the Iron Golem. */
|
||||
public ModelRenderer iceGiantRightLeg;
|
||||
|
||||
ModelRenderer headSpike1;
|
||||
ModelRenderer headSpike2;
|
||||
ModelRenderer headSpike3;
|
||||
ModelRenderer headSpike4;
|
||||
ModelRenderer headSpike5;
|
||||
ModelRenderer headSpike6;
|
||||
ModelRenderer headSpike7;
|
||||
ModelRenderer rightArmSpike1;
|
||||
ModelRenderer rightArmSpike2;
|
||||
ModelRenderer leftArmSpike1;
|
||||
ModelRenderer leftArmSpike2;
|
||||
ModelRenderer bodySpike1;
|
||||
ModelRenderer bodySpike2;
|
||||
ModelRenderer bodySpike3;
|
||||
ModelRenderer bodySpike4;
|
||||
ModelRenderer bodySpike5;
|
||||
|
||||
public ModelIceGiant()
|
||||
{
|
||||
this(0.0F);
|
||||
}
|
||||
|
||||
public ModelIceGiant(float par1)
|
||||
{
|
||||
this(par1, -7.0F);
|
||||
}
|
||||
|
||||
public ModelIceGiant(float par1, float par2)
|
||||
{
|
||||
short short1 = 128;
|
||||
short short2 = 128;
|
||||
|
||||
this.iceGiantHead = (new ModelRenderer(this)).setTextureSize(short1, short2);
|
||||
this.iceGiantHead.setRotationPoint(0.0F, 0.0F + par2, -1.0F);
|
||||
this.iceGiantHead.setTextureOffset(0, 10).addBox(-6.0F, -14.0F, -6.5F, 12, 12, 12, par1);
|
||||
|
||||
this.iceGiantBody = (new ModelRenderer(this)).setTextureSize(short1, short2);
|
||||
this.iceGiantBody.setRotationPoint(0.0F, 0.0F + par2, 0.0F);
|
||||
this.iceGiantBody.setTextureOffset(0, 40).addBox(-9.0F, -2.0F, -6.0F, 18, 12, 11, par1);
|
||||
this.iceGiantBody.setTextureOffset(0, 70).addBox(-4.5F, 10.0F, -3.0F, 9, 5, 6, par1 + 0.5F);
|
||||
|
||||
this.iceGiantRightArm = (new ModelRenderer(this)).setTextureSize(short1, short2);
|
||||
this.iceGiantRightArm.setRotationPoint(0.0F, -7.0F, 0.0F);
|
||||
this.iceGiantRightArm.setTextureOffset(60, 21).addBox(-13.0F, -2.5F, -3.0F, 4, 30, 6, par1);
|
||||
|
||||
this.iceGiantLeftArm = (new ModelRenderer(this)).setTextureSize(short1, short2);
|
||||
this.iceGiantLeftArm.setRotationPoint(0.0F, -7.0F, 0.0F);
|
||||
this.iceGiantLeftArm.setTextureOffset(60, 58).addBox(9.0F, -2.5F, -3.0F, 4, 30, 6, par1);
|
||||
|
||||
this.iceGiantLeftLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(short1, short2);
|
||||
this.iceGiantLeftLeg.setRotationPoint(-4.0F, 18.0F + par2, 0.0F);
|
||||
this.iceGiantLeftLeg.setTextureOffset(37, 0).addBox(-3.5F, -3.0F, -3.0F, 6, 16, 5, par1);
|
||||
|
||||
this.iceGiantRightLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(short1, short2);
|
||||
this.iceGiantRightLeg.mirror = true;
|
||||
this.iceGiantRightLeg.setTextureOffset(60, 0).setRotationPoint(5.0F, 18.0F + par2, 0.0F);
|
||||
this.iceGiantRightLeg.addBox(-3.5F, -3.0F, -3.0F, 6, 16, 5, par1);
|
||||
|
||||
headSpike1 = new ModelRenderer(this, 0, 0).setTextureSize(short1, short2);
|
||||
headSpike1.addBox(-4F, -4F, 0F, 4, 4, 4);
|
||||
headSpike1.setRotationPoint(-4F, -10F, -5F);
|
||||
headSpike1.mirror = true;
|
||||
setRotationWithEulerYzx(headSpike1, -0.1047198F, -0.5235988F, 0.9599311F);
|
||||
|
||||
headSpike2 = new ModelRenderer(this, 0, 0).setTextureSize(short1, short2);
|
||||
headSpike2.addBox(0F, -4F, 0F, 4, 4, 4);
|
||||
headSpike2.setRotationPoint(4F, -16F, 0F);
|
||||
headSpike2.mirror = true;
|
||||
setRotationWithEulerYzx(headSpike2, 0.5585054F, 0.9250245F, -0.5235988F);
|
||||
|
||||
headSpike3 = new ModelRenderer(this, 0, 0).setTextureSize(short1, short2);
|
||||
headSpike3.addBox(-2F, -2F, -2F, 4, 4, 4);
|
||||
headSpike3.setRotationPoint(4F, -13F, 4F);
|
||||
headSpike3.mirror = true;
|
||||
setRotationWithEulerYzx(headSpike3, 0.7853982F, -1.396263F, 0.7853982F);
|
||||
|
||||
headSpike4 = new ModelRenderer(this, 0, 0).setTextureSize(short1, short2);
|
||||
headSpike4.addBox(-4F, -4F, 0F, 4, 4, 4);
|
||||
headSpike4.setRotationPoint(-4F, -16F, 0F);
|
||||
headSpike4.mirror = true;
|
||||
setRotationWithEulerYzx(headSpike4, 0.5585054F, -0.9250245F, 0.5235988F);
|
||||
|
||||
headSpike5 = new ModelRenderer(this, 0, 0).setTextureSize(short1, short2);
|
||||
headSpike5.addBox(0F, -4F, 0F, 4, 4, 4);
|
||||
headSpike5.setRotationPoint(4F, -10F, -5F);
|
||||
headSpike5.mirror = true;
|
||||
setRotationWithEulerYzx(headSpike5, 0.5235988F, -0.9599311F, 0.1047198F);
|
||||
|
||||
rightArmSpike1 = new ModelRenderer(this, 0, 0).setTextureSize(short1, short2);
|
||||
rightArmSpike1.addBox(-2F, -2F, -2F, 4, 4, 4);
|
||||
rightArmSpike1.setRotationPoint(-11F, -8F, 0F);
|
||||
rightArmSpike1.mirror = true;
|
||||
setRotationWithEulerYzx(rightArmSpike1, 0.7853982F, 1.134464F, 0.9599311F);
|
||||
|
||||
headSpike6 = new ModelRenderer(this, 0, 0).setTextureSize(short1, short2);
|
||||
headSpike6.addBox(-2F, -2F, -2F, 4, 4, 4);
|
||||
headSpike6.setRotationPoint(-4F, -13F, 4F);
|
||||
headSpike6.mirror = true;
|
||||
setRotationWithEulerYzx(headSpike6, 0.7853982F, -1.745329F, 0.7853982F);
|
||||
|
||||
leftArmSpike1 = new ModelRenderer(this, 0, 0).setTextureSize(short1, short2);
|
||||
leftArmSpike1.addBox(-2F, -2F, -2F, 4, 4, 4);
|
||||
leftArmSpike1.setRotationPoint(11F, -8F, 0F);
|
||||
leftArmSpike1.mirror = true;
|
||||
setRotationWithEulerYzx(leftArmSpike1, 0.7853982F, -1.134464F, -0.9599311F);
|
||||
|
||||
leftArmSpike2 = new ModelRenderer(this, 0, 0).setTextureSize(short1, short2);
|
||||
leftArmSpike2.addBox(-2F, -2F, -2F, 4, 4, 4);
|
||||
leftArmSpike2.setRotationPoint(12F, -4F, 0F);
|
||||
leftArmSpike2.mirror = true;
|
||||
setRotationWithEulerYzx(leftArmSpike2, 0.7853982F, 0F, -0.9599311F);
|
||||
|
||||
bodySpike1 = new ModelRenderer(this, 32, 69).setTextureSize(short1, short2);
|
||||
bodySpike1.addBox(-3F, -3F, -3F, 6, 6, 6);
|
||||
bodySpike1.setRotationPoint(-4F, -4F, 3F);
|
||||
bodySpike1.mirror = true;
|
||||
setRotationWithEulerYzx(bodySpike1, 0.2808018F, 0.8096675F, 0.8339369F);
|
||||
|
||||
rightArmSpike2 = new ModelRenderer(this, 0, 0).setTextureSize(short1, short2);
|
||||
rightArmSpike2.addBox(-2F, -2F, -2F, 4, 4, 4);
|
||||
rightArmSpike2.setRotationPoint(-12F, -4F, 0F);
|
||||
rightArmSpike2.mirror = true;
|
||||
setRotationWithEulerYzx(rightArmSpike2, 0.7853982F, 0F, 0.9599311F);
|
||||
|
||||
bodySpike2 = new ModelRenderer(this, 32, 69).setTextureSize(short1, short2);
|
||||
bodySpike2.addBox(-3F, -3F, -3F, 6, 6, 6);
|
||||
bodySpike2.setRotationPoint(4F, -4F, 3F);
|
||||
bodySpike2.mirror = true;
|
||||
setRotationWithEulerYzx(bodySpike2, 0.2808018F, -0.8096757F, -0.8339358F);
|
||||
|
||||
bodySpike3 = new ModelRenderer(this, 0, 0).setTextureSize(short1, short2);
|
||||
bodySpike3.addBox(-2F, -2F, -2F, 4, 4, 4);
|
||||
bodySpike3.setRotationPoint(6F, -2F, -5F);
|
||||
bodySpike3.mirror = true;
|
||||
setRotationWithEulerYzx(bodySpike3, 1.120006F, -1.347726F, -0.8969422F);
|
||||
|
||||
bodySpike4 = new ModelRenderer(this, 32, 69).setTextureSize(short1, short2);
|
||||
bodySpike4.addBox(-3F, -3F, -3F, 6, 6, 6);
|
||||
bodySpike4.setRotationPoint(0F, -4F, -4F);
|
||||
bodySpike4.mirror = true;
|
||||
setRotationWithEulerYzx(bodySpike4, 0.7853982F, -1.570796F, 0.9599311F);
|
||||
|
||||
headSpike7 = new ModelRenderer(this, 0, 0).setTextureSize(short1, short2);
|
||||
headSpike7.addBox(-2F, -2F, -2F, 4, 4, 4);
|
||||
headSpike7.setRotationPoint(0F, -20F, 4F);
|
||||
headSpike7.mirror = true;
|
||||
setRotationWithEulerYzx(headSpike7, 0.7853982F, 1.570796F, 0.7853982F);
|
||||
|
||||
bodySpike5 = new ModelRenderer(this, 0, 0).setTextureSize(short1, short2);
|
||||
bodySpike5.addBox(-2F, -2F, -2F, 4, 4, 4);
|
||||
bodySpike5.setRotationPoint(-6F, -2F, -5F);
|
||||
bodySpike5.mirror = true;
|
||||
setRotationWithEulerYzx(bodySpike5, 1.120006F, 1.347725F, 0.896934F);
|
||||
|
||||
this.convertToChild(this.iceGiantHead, headSpike1);
|
||||
this.convertToChild(this.iceGiantHead, headSpike2);
|
||||
this.convertToChild(this.iceGiantHead, headSpike3);
|
||||
this.convertToChild(this.iceGiantHead, headSpike4);
|
||||
this.convertToChild(this.iceGiantHead, headSpike5);
|
||||
this.convertToChild(this.iceGiantHead, headSpike6);
|
||||
this.convertToChild(this.iceGiantHead, headSpike7);
|
||||
this.convertToChild(this.iceGiantRightArm, rightArmSpike1);
|
||||
this.convertToChild(this.iceGiantRightArm, rightArmSpike2);
|
||||
this.convertToChild(this.iceGiantLeftArm, leftArmSpike1);
|
||||
this.convertToChild(this.iceGiantLeftArm, leftArmSpike2);
|
||||
this.convertToChild(this.iceGiantBody, bodySpike1);
|
||||
this.convertToChild(this.iceGiantBody, bodySpike2);
|
||||
this.convertToChild(this.iceGiantBody, bodySpike3);
|
||||
this.convertToChild(this.iceGiantBody, bodySpike4);
|
||||
this.convertToChild(this.iceGiantBody, bodySpike5);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the models various rotation angles then renders the model.
|
||||
*/
|
||||
public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7)
|
||||
{
|
||||
this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity);
|
||||
this.iceGiantHead.render(par7);
|
||||
this.iceGiantBody.render(par7);
|
||||
this.iceGiantLeftLeg.render(par7);
|
||||
this.iceGiantRightLeg.render(par7);
|
||||
this.iceGiantRightArm.render(par7);
|
||||
this.iceGiantLeftArm.render(par7);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity)
|
||||
{
|
||||
this.iceGiantHead.rotateAngleY = par4 / (180F / (float)Math.PI);
|
||||
this.iceGiantHead.rotateAngleX = par5 / (180F / (float)Math.PI);
|
||||
this.iceGiantLeftLeg.rotateAngleX = -1.5F * this.func_78172_a(par1, 13.0F) * par2;
|
||||
this.iceGiantRightLeg.rotateAngleX = 1.5F * this.func_78172_a(par1, 13.0F) * par2;
|
||||
this.iceGiantLeftLeg.rotateAngleY = 0.0F;
|
||||
this.iceGiantRightLeg.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 par1EntityLivingBase, float par2, float par3, float par4)
|
||||
{
|
||||
EntityIceGiant entityicegiant = (EntityIceGiant)par1EntityLivingBase;
|
||||
int i = entityicegiant.getAttackTimer();
|
||||
|
||||
if (i > 0)
|
||||
{
|
||||
this.iceGiantRightArm.rotateAngleX = -2.0F + 1.5F * this.func_78172_a((float)i - par4, 10.0F);
|
||||
this.iceGiantLeftArm.rotateAngleX = -2.0F + 1.5F * this.func_78172_a((float)i - par4, 10.0F);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.iceGiantRightArm.rotateAngleX = (-0.2F + 1.5F * this.func_78172_a(par2, 13.0F)) * par3;
|
||||
this.iceGiantLeftArm.rotateAngleX = (-0.2F - 1.5F * this.func_78172_a(par2, 13.0F)) * par3;
|
||||
}
|
||||
}
|
||||
|
||||
private float func_78172_a(float par1, float par2)
|
||||
{
|
||||
return (Math.abs(par1 % par2 - par2 * 0.5F) - par2 * 0.25F) / (par2 * 0.25F);
|
||||
}
|
||||
|
||||
/** This is really useful for converting the source from a Techne model export
|
||||
* which will have absolute rotation points that need to be converted before
|
||||
* creating the addChild() relationship. [Courtesy of jabelar] */
|
||||
protected void convertToChild(ModelRenderer parent, ModelRenderer child)
|
||||
{
|
||||
// move child rotation point to be relative to parent
|
||||
child.rotationPointX -= parent.rotationPointX;
|
||||
child.rotationPointY -= parent.rotationPointY;
|
||||
child.rotationPointZ -= parent.rotationPointZ;
|
||||
// make rotations relative to parent
|
||||
child.rotateAngleX -= parent.rotateAngleX;
|
||||
child.rotateAngleY -= parent.rotateAngleY;
|
||||
child.rotateAngleZ -= parent.rotateAngleZ;
|
||||
// create relationship
|
||||
parent.addChild(child);
|
||||
}
|
||||
|
||||
/** Fixes the Techne rotation order bug. [Courtesy of tprk77] */
|
||||
private Vector3f ConvertEulerYzxToZyx(Vector3f eulerYzx) {
|
||||
// Create a matrix from YZX ordered Euler angles
|
||||
float a = MathHelper.cos(eulerYzx.x);
|
||||
float b = MathHelper.sin(eulerYzx.x);
|
||||
float c = MathHelper.cos(eulerYzx.y);
|
||||
float d = MathHelper.sin(eulerYzx.y);
|
||||
float e = MathHelper.cos(eulerYzx.z);
|
||||
float f = MathHelper.sin(eulerYzx.z);
|
||||
Matrix4f matrix = new Matrix4f();
|
||||
matrix.m00 = c * e;
|
||||
matrix.m01 = b * d - a * c * f;
|
||||
matrix.m02 = b * c * f + a * d;
|
||||
matrix.m10 = f;
|
||||
matrix.m11 = a * e;
|
||||
matrix.m12 = -b * e;
|
||||
matrix.m20 = -d * e;
|
||||
matrix.m21 = a * d * f + b * c;
|
||||
matrix.m22 = a * c - b * d * f;
|
||||
matrix.m33 = 1.0F;
|
||||
// Create ZYX ordered Euler angles from the matrix
|
||||
Vector3f eulerZyx = new Vector3f();
|
||||
eulerZyx.y = (float) Math.asin(MathHelper.clamp_float(-matrix.m20, -1, 1));
|
||||
if (MathHelper.abs(matrix.m20) < 0.99999) {
|
||||
eulerZyx.x = (float) Math.atan2(matrix.m21, matrix.m22);
|
||||
eulerZyx.z = (float) Math.atan2(matrix.m10, matrix.m00);
|
||||
} else {
|
||||
eulerZyx.x = 0.0F;
|
||||
eulerZyx.z = (float) Math.atan2(-matrix.m01, matrix.m11);
|
||||
}
|
||||
return eulerZyx;
|
||||
}
|
||||
|
||||
private void setRotationWithEulerYzx(ModelRenderer model, float x, float y, float z) {
|
||||
Vector3f eulerYzx = new Vector3f(x, y, z);
|
||||
Vector3f eulerZyx = ConvertEulerYzxToZyx(eulerYzx);
|
||||
model.rotateAngleX = eulerZyx.x;
|
||||
model.rotateAngleY = eulerZyx.y;
|
||||
model.rotateAngleZ = eulerZyx.z;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
package electroblob.wizardry.client.model;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
||||
public class ModelPhoenix extends ModelBase {
|
||||
|
||||
ModelRenderer body;
|
||||
ModelRenderer rightWing;
|
||||
ModelRenderer leftWing;
|
||||
ModelRenderer tailFeathers;
|
||||
ModelRenderer tail;
|
||||
ModelRenderer head;
|
||||
ModelRenderer neck;
|
||||
ModelRenderer beak;
|
||||
ModelRenderer plume;
|
||||
|
||||
public ModelPhoenix()
|
||||
{
|
||||
textureWidth = 64;
|
||||
textureHeight = 64;
|
||||
|
||||
/* For future reference:
|
||||
* - setRotationPoint sets the origin of a part relative to that of its parent.
|
||||
* - The first 3 arguments of addBox set the position of a part relative to its rotation point, and the last
|
||||
* 3 arguments are the size of the part.
|
||||
* (This means that rotation point and position seem to be the wrong way round, since changing the rotation point
|
||||
* will move the component without changing which point on the component it rotates about.)
|
||||
* - The two integer arguments in the ModelRenderer constructor are the texture offset.
|
||||
* - Mirror does nothing unless you set it before addBox.
|
||||
* - Rotation is the usual pitch, yaw, roll.
|
||||
*/
|
||||
|
||||
body = new ModelRenderer(this, 0, 34);
|
||||
body.addBox(0F, 0F, -3F, 6, 15, 6);
|
||||
body.setRotationPoint(-3F, 0F, -5F);
|
||||
body.setTextureSize(64, 64);
|
||||
body.mirror = true;
|
||||
setRotation(body, 0.296706F, 0F, 0F);
|
||||
|
||||
rightWing = new ModelRenderer(this, 0, 0);
|
||||
rightWing.mirror = true;
|
||||
rightWing.addBox(-27F, -27F, 0F, 27, 34, 0);
|
||||
rightWing.setRotationPoint(0F, 5F, 0F);
|
||||
rightWing.setTextureSize(64, 64);
|
||||
setRotation(rightWing, 0.1745329F, 0F, 0F);
|
||||
|
||||
leftWing = new ModelRenderer(this, 0, 0);
|
||||
leftWing.addBox(0F, -27F, 0F, 27, 34, 0);
|
||||
leftWing.setRotationPoint(6F, 5F, 0F);
|
||||
leftWing.setTextureSize(64, 64);
|
||||
setRotation(leftWing, 0.1745329F, 0F, 0F);
|
||||
|
||||
tailFeathers = new ModelRenderer(this, 0, 57);
|
||||
tailFeathers.addBox(-5F, 0F, 0F, 10, 7, 0);
|
||||
tailFeathers.setRotationPoint(0F, 7F, 1F);
|
||||
tailFeathers.setTextureSize(64, 64);
|
||||
tailFeathers.mirror = true;
|
||||
setRotation(tailFeathers, 0.5235988F, 0F, 0F);
|
||||
|
||||
tail = new ModelRenderer(this, 20, 55);
|
||||
tail.addBox(-1F, 0F, -1F, 2, 7, 2);
|
||||
tail.setRotationPoint(3F, 15F, 2F);
|
||||
tail.setTextureSize(64, 64);
|
||||
tail.mirror = true;
|
||||
setRotation(tail, 0.4014257F, 0F, 0F);
|
||||
|
||||
head = new ModelRenderer(this, 24, 34);
|
||||
head.addBox(-2F, -4F, -5F, 4, 4, 6);
|
||||
head.setRotationPoint(0F, -4F, 0F);
|
||||
head.setTextureSize(64, 64);
|
||||
head.mirror = true;
|
||||
setRotation(head, 0F, 0F, 0F);
|
||||
|
||||
neck = new ModelRenderer(this, 24, 44);
|
||||
neck.addBox(-1F, -4F, -1F, 2, 4, 2);
|
||||
neck.setRotationPoint(0F, 0F, -4F);
|
||||
neck.setTextureSize(64, 64);
|
||||
neck.mirror = true;
|
||||
setRotation(neck, 0.2443461F, 0F, 0F);
|
||||
|
||||
beak = new ModelRenderer(this, 32, 44);
|
||||
beak.addBox(-0.5F, 4F, -1F, 1, 2, 3);
|
||||
beak.setRotationPoint(0F, -5F, -8F);
|
||||
beak.setTextureSize(64, 64);
|
||||
beak.mirror = true;
|
||||
setRotation(beak, 0.2792527F, 0F, 0F);
|
||||
|
||||
plume = new ModelRenderer(this, 28, 50);
|
||||
plume.addBox(-0.03333334F, 1F, 0F, 0, 5, 5);
|
||||
plume.setRotationPoint(0F, -7F, 0F);
|
||||
plume.setTextureSize(64, 64);
|
||||
plume.mirror = true;
|
||||
setRotation(plume, 0F, 0F, 0F);
|
||||
|
||||
neck.addChild(head);
|
||||
head.addChild(plume);
|
||||
head.addChild(beak);
|
||||
tail.addChild(tailFeathers);
|
||||
body.addChild(tail);
|
||||
body.addChild(rightWing);
|
||||
body.addChild(leftWing);
|
||||
}
|
||||
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
|
||||
//float f6 = (180F / (float)Math.PI);
|
||||
this.neck.rotateAngleX = f4 / (180F / (float)Math.PI);
|
||||
this.neck.rotateAngleY = f3 / (180F / (float)Math.PI);
|
||||
this.neck.rotateAngleZ = 0.0F;
|
||||
this.body.rotateAngleX = 0.3f + MathHelper.cos(f2 * 0.1F) * 0.15F;
|
||||
this.body.rotateAngleY = 0.0F;
|
||||
this.tail.rotateAngleX = this.body.rotateAngleX * 1.1f;
|
||||
this.tailFeathers.rotateAngleX = this.body.rotateAngleX * 1.2f;
|
||||
this.rightWing.rotateAngleY = MathHelper.cos(f2 * 0.3F) * (float)Math.PI * 0.15F;
|
||||
this.leftWing.rotateAngleY = -this.rightWing.rotateAngleY;
|
||||
|
||||
body.render(f5);
|
||||
neck.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||
{
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
package electroblob.wizardry.client.model;
|
||||
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
|
||||
public class ModelWizard extends ModelBiped
|
||||
{
|
||||
//fields
|
||||
ModelRenderer Shape5;
|
||||
ModelRenderer Shape8;
|
||||
ModelRenderer Shape9;
|
||||
ModelRenderer Shape10;
|
||||
ModelRenderer Shape7;
|
||||
ModelRenderer Shape11;
|
||||
ModelRenderer Shape12;
|
||||
ModelRenderer beard;
|
||||
ModelRenderer Shape13;
|
||||
|
||||
public ModelWizard()
|
||||
{
|
||||
//super(0, 0, 64, 32);
|
||||
/*
|
||||
bipedRightLeg = new ModelRenderer(this, 32, 0); // 32 and 0 are the x and y texture offsets respectively.
|
||||
bipedRightLeg.addBox(-2F, 0F, -2F, 4, 12, 4); // x, y, z, u, v, w.
|
||||
bipedRightLeg.setRotationPoint(-2F, 12F, 0F); // Rotation point xyz (absolute, not relative)
|
||||
bipedRightLeg.setTextureSize(64, 64);
|
||||
bipedRightLeg.mirror = true;
|
||||
setRotation(bipedRightLeg, 0F, 0F, 0F);
|
||||
|
||||
bipedLeftLeg.mirror = true;
|
||||
bipedLeftLeg = new ModelRenderer(this, 32, 0);
|
||||
bipedLeftLeg.addBox(-2F, 0F, -2F, 4, 12, 4);
|
||||
bipedLeftLeg.setRotationPoint(2F, 12F, 0F);
|
||||
bipedLeftLeg.setTextureSize(64, 64);
|
||||
bipedLeftLeg.mirror = true;
|
||||
setRotation(bipedLeftLeg, 0F, 0F, 0F);
|
||||
bipedLeftLeg.mirror = false;
|
||||
|
||||
bipedBody = new ModelRenderer(this, 0, 16);
|
||||
bipedBody.addBox(0F, 0F, 0F, 8, 12, 4);
|
||||
bipedBody.setRotationPoint(-4F, 0F, -2F);
|
||||
bipedBody.setTextureSize(64, 64);
|
||||
bipedBody.mirror = true;
|
||||
setRotation(bipedBody, 0F, 0F, 0F);
|
||||
|
||||
bipedLeftArm.mirror = true;
|
||||
bipedLeftArm = new ModelRenderer(this, 48, 0);
|
||||
bipedLeftArm.addBox(-1F, 0F, -2F, 4, 12, 4);
|
||||
bipedLeftArm.setRotationPoint(4F, 0F, 0F);
|
||||
bipedLeftArm.setTextureSize(64, 64);
|
||||
bipedLeftArm.mirror = true;
|
||||
setRotation(bipedLeftArm, 0F, 0F, 0F);
|
||||
bipedLeftArm.mirror = false;
|
||||
|
||||
bipedRightArm = new ModelRenderer(this, 48, 0);
|
||||
bipedRightArm.addBox(-3F, 0F, -2F, 4, 12, 4);
|
||||
bipedRightArm.setRotationPoint(-4F, 0F, 0F);
|
||||
bipedRightArm.setTextureSize(64, 64);
|
||||
bipedRightArm.mirror = true;
|
||||
setRotation(bipedRightArm, 0F, 0F, 0F);
|
||||
|
||||
bipedHead = new ModelRenderer(this, 0, 0);
|
||||
bipedHead.addBox(-4F, -8F, -4F, 8, 8, 8);
|
||||
bipedHead.setRotationPoint(0F, 0F, 0F);
|
||||
bipedHead.setTextureSize(64, 64);
|
||||
bipedHead.mirror = true;
|
||||
setRotation(bipedHead, 0F, 0F, 0F);
|
||||
*/
|
||||
Shape5 = new ModelRenderer(this, 0, 51);
|
||||
Shape5.addBox(0F, 0F, 0F, 12, 1, 12);
|
||||
Shape5.setRotationPoint(-6F, -7F, -6F);
|
||||
Shape5.setTextureSize(64, 64);
|
||||
Shape5.mirror = true;
|
||||
setRotation(Shape5, 0F, 0F, 0F);
|
||||
Shape8 = new ModelRenderer(this, 0, 32);
|
||||
Shape8.addBox(0F, 0F, 0F, 6, 1, 6);
|
||||
Shape8.setRotationPoint(-3F, -9F, -3F);
|
||||
Shape8.setTextureSize(64, 64);
|
||||
Shape8.mirror = true;
|
||||
setRotation(Shape8, -0.0349066F, 0F, 0F);
|
||||
Shape9 = new ModelRenderer(this, 24, 32);
|
||||
Shape9.addBox(0F, 0F, 0F, 3, 3, 3);
|
||||
Shape9.setRotationPoint(-1.5F, -13F, -0.5F);
|
||||
Shape9.setTextureSize(64, 64);
|
||||
Shape9.mirror = true;
|
||||
setRotation(Shape9, -0.2511622F, 0F, 0F);
|
||||
Shape10 = new ModelRenderer(this, 0, 39);
|
||||
Shape10.addBox(0F, 0F, 0F, 5, 1, 5);
|
||||
Shape10.setRotationPoint(-2.5F, -10F, -2.5F);
|
||||
Shape10.setTextureSize(64, 64);
|
||||
Shape10.mirror = true;
|
||||
setRotation(Shape10, -0.0698132F, 0F, 0F);
|
||||
Shape7 = new ModelRenderer(this, 0, 45);
|
||||
Shape7.addBox(0F, 0F, 0F, 4, 2, 4);
|
||||
Shape7.setRotationPoint(-2F, -11F, -1.5F);
|
||||
Shape7.setTextureSize(64, 64);
|
||||
Shape7.mirror = true;
|
||||
setRotation(Shape7, -0.1396263F, 0F, 0F);
|
||||
Shape11 = new ModelRenderer(this, 20, 39);
|
||||
Shape11.addBox(0F, 0F, 0F, 2, 3, 2);
|
||||
Shape11.setRotationPoint(-1F, -15F, 1F);
|
||||
Shape11.setTextureSize(64, 64);
|
||||
Shape11.mirror = true;
|
||||
setRotation(Shape11, -0.4363323F, 0F, 0F);
|
||||
Shape12 = new ModelRenderer(this, 28, 39);
|
||||
Shape12.addBox(0F, 0F, 0F, 1, 2, 1);
|
||||
Shape12.setRotationPoint(-0.5F, -16F, 2.5F);
|
||||
Shape12.setTextureSize(64, 64);
|
||||
Shape12.mirror = true;
|
||||
setRotation(Shape12, -0.715585F, 0F, 0F);
|
||||
beard = new ModelRenderer(this, 32, 0);
|
||||
beard.addBox(0F, 0F, 0F, 8, 5, 0);
|
||||
beard.setRotationPoint(-4F, 0F, -4F);
|
||||
beard.setTextureSize(64, 64);
|
||||
beard.mirror = true;
|
||||
setRotation(beard, 0F, 0F, 0F);
|
||||
Shape13 = new ModelRenderer(this, 36, 16);
|
||||
Shape13.addBox(4F, 0F, 2F, 8, 20, 6);
|
||||
Shape13.setRotationPoint(-4F, 0F, -3F);
|
||||
Shape13.setTextureSize(64, 64);
|
||||
Shape13.mirror = true;
|
||||
setRotation(Shape13, 0F, 0F, 0F);
|
||||
|
||||
// Makes head bits move with head
|
||||
//bipedHead.addChild(Shape5);
|
||||
bipedHead.addChild(beard);
|
||||
//bipedHead.addChild(Shape7);
|
||||
//bipedHead.addChild(Shape8);
|
||||
//bipedHead.addChild(Shape9);
|
||||
//bipedHead.addChild(Shape10);
|
||||
//bipedHead.addChild(Shape11);
|
||||
//bipedHead.addChild(Shape12);
|
||||
|
||||
// Makes cloak attached to body
|
||||
//bipedBody.addChild(Shape13);
|
||||
|
||||
// No outer head layer
|
||||
this.bipedHeadwear.isHidden = true;
|
||||
}
|
||||
/*
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
bipedRightLeg.render(f5);
|
||||
bipedLeftLeg.render(f5);
|
||||
bipedBody.render(f5);
|
||||
bipedLeftArm.render(f5);
|
||||
bipedRightArm.render(f5);
|
||||
bipedHead.render(f5);
|
||||
Shape5.render(f5);
|
||||
Shape8.render(f5);
|
||||
Shape9.render(f5);
|
||||
Shape10.render(f5);
|
||||
Shape7.render(f5);
|
||||
Shape11.render(f5);
|
||||
Shape12.render(f5);
|
||||
Shape6.render(f5);
|
||||
Shape13.render(f5);
|
||||
}
|
||||
*/
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||
{
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
/*
|
||||
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);
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package electroblob.wizardry.client.model;
|
||||
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class ModelWizardArmour extends ModelBiped
|
||||
{
|
||||
ModelRenderer Shape1;
|
||||
ModelRenderer Shape2;
|
||||
ModelRenderer Shape3;
|
||||
ModelRenderer Shape4;
|
||||
ModelRenderer Shape5;
|
||||
ModelRenderer Shape6;
|
||||
ModelRenderer Shape7;
|
||||
ModelRenderer robe;
|
||||
|
||||
public ModelWizardArmour(float scale){
|
||||
|
||||
super(scale, 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);
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
// The robe is now the body
|
||||
bipedBody = new ModelRenderer(this, 40, 42);
|
||||
bipedBody.addBox(-4F, 0F, -2F, 8, 18, 4, scale);
|
||||
bipedBody.setRotationPoint(0F, 0F, 0F);
|
||||
bipedBody.setTextureSize(64, 64);
|
||||
bipedBody.mirror = true;
|
||||
setRotation(bipedBody, 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);
|
||||
}
|
||||
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z){
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
package electroblob.wizardry.client.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import electroblob.wizardry.registry.WizardryBlocks;
|
||||
import electroblob.wizardry.registry.WizardryItems;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.event.ModelRegistryEvent;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
/**
|
||||
* Class responsible for registering all of wizardry's item (and itemblock) models.
|
||||
* @author Electroblob
|
||||
* @since Wizardry 2.1
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Mod.EventBusSubscriber(Side.CLIENT)
|
||||
public final class WizardryItemModels {
|
||||
|
||||
@SubscribeEvent
|
||||
public static void register(ModelRegistryEvent event){
|
||||
|
||||
// ItemBlocks
|
||||
|
||||
registerItemModel(Item.getItemFromBlock(WizardryBlocks.arcane_workbench));
|
||||
registerItemModel(Item.getItemFromBlock(WizardryBlocks.crystal_ore));
|
||||
registerItemModel(Item.getItemFromBlock(WizardryBlocks.crystal_flower));
|
||||
registerItemModel(Item.getItemFromBlock(WizardryBlocks.transportation_stone));
|
||||
registerItemModel(Item.getItemFromBlock(WizardryBlocks.crystal_block));
|
||||
|
||||
// Items
|
||||
|
||||
registerItemModel(WizardryItems.magic_crystal);
|
||||
|
||||
registerItemModel(WizardryItems.magic_wand);
|
||||
registerItemModel(WizardryItems.apprentice_wand);
|
||||
registerItemModel(WizardryItems.advanced_wand);
|
||||
registerItemModel(WizardryItems.master_wand);
|
||||
|
||||
registerItemModel(WizardryItems.spell_book);
|
||||
// Wildcard registered for wizard trades.
|
||||
registerItemModel(WizardryItems.spell_book, OreDictionary.WILDCARD_VALUE, "normal");
|
||||
registerItemModel(WizardryItems.arcane_tome);
|
||||
registerItemModel(WizardryItems.wizard_handbook);
|
||||
|
||||
registerItemModel(WizardryItems.basic_fire_wand);
|
||||
registerItemModel(WizardryItems.basic_ice_wand);
|
||||
registerItemModel(WizardryItems.basic_lightning_wand);
|
||||
registerItemModel(WizardryItems.basic_necromancy_wand);
|
||||
registerItemModel(WizardryItems.basic_earth_wand);
|
||||
registerItemModel(WizardryItems.basic_sorcery_wand);
|
||||
registerItemModel(WizardryItems.basic_healing_wand);
|
||||
|
||||
registerItemModel(WizardryItems.apprentice_fire_wand);
|
||||
registerItemModel(WizardryItems.apprentice_ice_wand);
|
||||
registerItemModel(WizardryItems.apprentice_lightning_wand);
|
||||
registerItemModel(WizardryItems.apprentice_necromancy_wand);
|
||||
registerItemModel(WizardryItems.apprentice_earth_wand);
|
||||
registerItemModel(WizardryItems.apprentice_sorcery_wand);
|
||||
registerItemModel(WizardryItems.apprentice_healing_wand);
|
||||
|
||||
registerItemModel(WizardryItems.advanced_fire_wand);
|
||||
registerItemModel(WizardryItems.advanced_ice_wand);
|
||||
registerItemModel(WizardryItems.advanced_lightning_wand);
|
||||
registerItemModel(WizardryItems.advanced_necromancy_wand);
|
||||
registerItemModel(WizardryItems.advanced_earth_wand);
|
||||
registerItemModel(WizardryItems.advanced_sorcery_wand);
|
||||
registerItemModel(WizardryItems.advanced_healing_wand);
|
||||
|
||||
registerItemModel(WizardryItems.master_fire_wand);
|
||||
registerItemModel(WizardryItems.master_ice_wand);
|
||||
registerItemModel(WizardryItems.master_lightning_wand);
|
||||
registerItemModel(WizardryItems.master_necromancy_wand);
|
||||
registerItemModel(WizardryItems.master_earth_wand);
|
||||
registerItemModel(WizardryItems.master_sorcery_wand);
|
||||
registerItemModel(WizardryItems.master_healing_wand);
|
||||
|
||||
registerItemModel(WizardryItems.spectral_sword);
|
||||
registerItemModel(WizardryItems.spectral_pickaxe);
|
||||
registerItemModel(WizardryItems.spectral_bow);
|
||||
|
||||
registerItemModel(WizardryItems.mana_flask);
|
||||
|
||||
registerItemModel(WizardryItems.storage_upgrade);
|
||||
registerItemModel(WizardryItems.siphon_upgrade);
|
||||
registerItemModel(WizardryItems.condenser_upgrade);
|
||||
registerItemModel(WizardryItems.range_upgrade);
|
||||
registerItemModel(WizardryItems.duration_upgrade);
|
||||
registerItemModel(WizardryItems.cooldown_upgrade);
|
||||
registerItemModel(WizardryItems.blast_upgrade);
|
||||
registerItemModel(WizardryItems.attunement_upgrade);
|
||||
|
||||
registerItemModel(WizardryItems.flaming_axe);
|
||||
registerItemModel(WizardryItems.frost_axe);
|
||||
|
||||
registerItemModel(WizardryItems.firebomb);
|
||||
registerItemModel(WizardryItems.poison_bomb);
|
||||
|
||||
registerItemModel(WizardryItems.blank_scroll);
|
||||
registerItemModel(WizardryItems.scroll);
|
||||
|
||||
registerItemModel(WizardryItems.armour_upgrade);
|
||||
|
||||
registerItemModel(WizardryItems.magic_silk);
|
||||
|
||||
registerItemModel(WizardryItems.wizard_hat);
|
||||
registerItemModel(WizardryItems.wizard_robe);
|
||||
registerItemModel(WizardryItems.wizard_leggings);
|
||||
registerItemModel(WizardryItems.wizard_boots);
|
||||
|
||||
registerItemModel(WizardryItems.wizard_hat_fire);
|
||||
registerItemModel(WizardryItems.wizard_robe_fire);
|
||||
registerItemModel(WizardryItems.wizard_leggings_fire);
|
||||
registerItemModel(WizardryItems.wizard_boots_fire);
|
||||
|
||||
registerItemModel(WizardryItems.wizard_hat_ice);
|
||||
registerItemModel(WizardryItems.wizard_robe_ice);
|
||||
registerItemModel(WizardryItems.wizard_leggings_ice);
|
||||
registerItemModel(WizardryItems.wizard_boots_ice);
|
||||
|
||||
registerItemModel(WizardryItems.wizard_hat_lightning);
|
||||
registerItemModel(WizardryItems.wizard_robe_lightning);
|
||||
registerItemModel(WizardryItems.wizard_leggings_lightning);
|
||||
registerItemModel(WizardryItems.wizard_boots_lightning);
|
||||
|
||||
registerItemModel(WizardryItems.wizard_hat_necromancy);
|
||||
registerItemModel(WizardryItems.wizard_robe_necromancy);
|
||||
registerItemModel(WizardryItems.wizard_leggings_necromancy);
|
||||
registerItemModel(WizardryItems.wizard_boots_necromancy);
|
||||
|
||||
registerItemModel(WizardryItems.wizard_hat_earth);
|
||||
registerItemModel(WizardryItems.wizard_robe_earth);
|
||||
registerItemModel(WizardryItems.wizard_leggings_earth);
|
||||
registerItemModel(WizardryItems.wizard_boots_earth);
|
||||
|
||||
registerItemModel(WizardryItems.wizard_hat_sorcery);
|
||||
registerItemModel(WizardryItems.wizard_robe_sorcery);
|
||||
registerItemModel(WizardryItems.wizard_leggings_sorcery);
|
||||
registerItemModel(WizardryItems.wizard_boots_sorcery);
|
||||
|
||||
registerItemModel(WizardryItems.wizard_hat_healing);
|
||||
registerItemModel(WizardryItems.wizard_robe_healing);
|
||||
registerItemModel(WizardryItems.wizard_leggings_healing);
|
||||
registerItemModel(WizardryItems.wizard_boots_healing);
|
||||
|
||||
registerItemModel(WizardryItems.spectral_helmet);
|
||||
registerItemModel(WizardryItems.spectral_chestplate);
|
||||
registerItemModel(WizardryItems.spectral_leggings);
|
||||
registerItemModel(WizardryItems.spectral_boots);
|
||||
|
||||
registerItemModel(WizardryItems.smoke_bomb);
|
||||
|
||||
registerItemModel(WizardryItems.identification_scroll);
|
||||
}
|
||||
|
||||
// Moved from the proxies
|
||||
|
||||
/** Registers an item model, using the item's registry name as the model name (this
|
||||
* convention makes it easier to keep track of everything). Variant defaults to "normal". Registers the model
|
||||
* for metadata 0 automatically, plus all the other metadata values that the item can take, as defined in
|
||||
* {@link Item#getSubItems(Item, net.minecraft.creativetab.CreativeTabs, java.util.List)}. The passed in item
|
||||
* <b>must</b> allow null to be passed in for the creative tab parameter in the aforementioned method, or a
|
||||
* {@link NullPointerException} will result. */
|
||||
private static void registerItemModel(Item item){
|
||||
|
||||
if(item.getHasSubtypes()){
|
||||
List<ItemStack> items = new ArrayList<ItemStack>();
|
||||
item.getSubItems(item, null, items); // Client-only method, but we're client-side so this is OK.
|
||||
for(ItemStack stack : items){
|
||||
ModelLoader.setCustomModelResourceLocation(item, stack.getMetadata(), new ModelResourceLocation(item.getRegistryName(), "inventory"));
|
||||
}
|
||||
}
|
||||
// Changing the last parameter from null to "inventory" fixed the item/block model weirdness. No idea why!
|
||||
ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
|
||||
}
|
||||
|
||||
/** Registers an item model for the given metadata, using the item's registry name as the model name (this
|
||||
* convention makes it easier to keep track of everything). This is intended for registering additional metadata
|
||||
* values which aren't displayed in the creative menu, for example the wildcard spell book used in wizard trades. */
|
||||
private static void registerItemModel(Item item, int metadata, String variant) {
|
||||
ModelLoader.setCustomModelResourceLocation(item, metadata, new ModelResourceLocation(item.getRegistryName(), variant));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user