Jump to content

Recommended Posts

Posted

hey everyone,

I am working on a mod with custom armor models (I got them as .java)

So right now I dont know how to make minecraft use these custom models.

Any1 here that know how to do so?

Greetz BusyBeever

Posted

Override

Item#getArmorModel

to return the armour's

ModelBiped

instance.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted

Just made my armor estend ModelBiped and it works..

But the armor is glitchy and not really following the player when he moves

Any idea why?

 

public class AdamantArmorModel extends ModelBiped {
// fields
ModelRenderer head;
ModelRenderer body;
ModelRenderer rightarm;
ModelRenderer leftarm;
ModelRenderer rightleg;
ModelRenderer leftleg;
ModelRenderer Shape1;
ModelRenderer Shape2;
ModelRenderer Shape3;
ModelRenderer Shape4;

public AdamantArmorModel() {
	textureWidth = 76;
	textureHeight = 32;

	head = new ModelRenderer(this, 0, 0);
	head.addBox(-4F, -8F, -4F, 8, 8, ;
	head.setRotationPoint(0F, 0F, 0F);
	head.setTextureSize(76, 32);
	head.mirror = true;
	setRotation(head, 0F, 0F, 0F);
	body = new ModelRenderer(this, 16, 16);
	body.addBox(-4F, 0F, -2F, 8, 12, 4);
	body.setRotationPoint(0F, 0F, 0F);
	body.setTextureSize(76, 32);
	body.mirror = true;
	setRotation(body, 0F, 0F, 0F);
	rightarm = new ModelRenderer(this, 40, 16);
	rightarm.addBox(-3F, -2F, -2F, 4, 12, 4);
	rightarm.setRotationPoint(-5F, 2F, 0F);
	rightarm.setTextureSize(76, 32);
	rightarm.mirror = true;
	setRotation(rightarm, 0F, 0F, 0F);
	leftarm = new ModelRenderer(this, 40, 16);
	leftarm.addBox(-1F, -2F, -2F, 4, 12, 4);
	leftarm.setRotationPoint(5F, 2F, 0F);
	leftarm.setTextureSize(76, 32);
	leftarm.mirror = true;
	setRotation(leftarm, 0F, 0F, 0F);
	rightleg = new ModelRenderer(this, 0, 16);
	rightleg.addBox(-2F, 0F, -2F, 4, 12, 4);
	rightleg.setRotationPoint(-2F, 12F, 0F);
	rightleg.setTextureSize(76, 32);
	rightleg.mirror = true;
	setRotation(rightleg, 0F, 0F, 0F);
	leftleg = new ModelRenderer(this, 0, 16);
	leftleg.addBox(-2F, 0F, -2F, 4, 12, 4);
	leftleg.setRotationPoint(2F, 12F, 0F);
	leftleg.setTextureSize(76, 32);
	leftleg.mirror = true;
	setRotation(leftleg, 0F, 0F, 0F);
	Shape1 = new ModelRenderer(this, 44, 9);
	Shape1.addBox(0F, 0F, 0F, 3, 6, 1);
	Shape1.setRotationPoint(-4F, -8F, -5F);
	Shape1.setTextureSize(76, 32);
	Shape1.mirror = true;
	setRotation(Shape1, 0F, 0F, 0F);
	Shape2 = new ModelRenderer(this, 32, 1);
	Shape2.addBox(0F, 0F, 0F, 1, 6, 4);
	Shape2.setRotationPoint(-5F, -8F, -5F);
	Shape2.setTextureSize(76, 32);
	Shape2.mirror = true;
	setRotation(Shape2, 0F, 0F, 0F);
	Shape3 = new ModelRenderer(this, 40, 18);
	Shape3.addBox(0F, 0F, 0F, 1, 1, 1);
	Shape3.setRotationPoint(-2F, -4F, -6F);
	Shape3.setTextureSize(76, 32);
	Shape3.mirror = true;
	setRotation(Shape3, 0F, 0F, 0F);
	Shape3 = new ModelRenderer(this, 40, 18);
	Shape3.addBox(0F, 0F, 0F, 1, 1, 1);
	Shape3.setRotationPoint(-5F, -4F, -6F);
	Shape3.setTextureSize(76, 32);
	Shape3.mirror = true;
	setRotation(Shape3, 0F, 0F, 0F);
	Shape3 = new ModelRenderer(this, 52, 17);
	Shape3.addBox(0F, 0F, 0F, 2, 2, 1);
	Shape3.setRotationPoint(-4F, -7F, -6F);
	Shape3.setTextureSize(76, 32);
	Shape3.mirror = true;
	setRotation(Shape3, 0F, 0F, 0F);
	Shape4 = new ModelRenderer(this, 56, 21);
	Shape4.addBox(0F, 0F, 0F, 4, 5, 6);
	Shape4.setRotationPoint(-2F, 0F, -3F);
	Shape4.setTextureSize(76, 32);
	Shape4.mirror = true;
	setRotation(Shape4, 0F, 0F, 0F);
	Shape4 = new ModelRenderer(this, 60, 11);
	Shape4.addBox(0F, 0F, 0F, 2, 4, 6);
	Shape4.setRotationPoint(2F, 0F, -3F);
	Shape4.setTextureSize(76, 32);
	Shape4.mirror = true;
	setRotation(Shape4, 0F, 0F, 0F);
	Shape4 = new ModelRenderer(this, 60, 11);
	Shape4.addBox(0F, 0F, 0F, 2, 4, 6);
	Shape4.setRotationPoint(-4F, 0F, -3F);
	Shape4.setTextureSize(76, 32);
	Shape4.mirror = true;
	setRotation(Shape4, 0F, 0F, 0F);
	Shape4 = new ModelRenderer(this, 54, 1);
	Shape4.addBox(0F, 0F, 0F, 5, 4, 6);
	Shape4.setRotationPoint(-9F, -1F, -3F);
	Shape4.setTextureSize(76, 32);
	Shape4.mirror = true;
	setRotation(Shape4, 0F, 0F, 0F);
	Shape4.mirror = true;
	Shape4 = new ModelRenderer(this, 54, 1);
	Shape4.addBox(0F, 0F, 0F, 5, 4, 6);
	Shape4.setRotationPoint(4F, -1F, -3F);
	Shape4.setTextureSize(76, 32);
	Shape4.mirror = true;
	setRotation(Shape4, 0F, 0F, 0F);
	Shape4.mirror = false;
}

@Override
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);
	head.render(f5);
	body.render(f5);
	rightarm.render(f5);
	leftarm.render(f5);
	rightleg.render(f5);
	leftleg.render(f5);
	Shape1.render(f5);
	Shape2.render(f5);
	Shape3.render(f5);
	Shape3.render(f5);
	Shape3.render(f5);
	Shape4.render(f5);
	Shape4.render(f5);
	Shape4.render(f5);
	Shape4.render(f5);
	Shape4.render(f5);
}

private void setRotation(ModelRenderer model, float x, float y, float z) {
	model.rotateAngleX = x;
	model.rotateAngleY = y;
	model.rotateAngleZ = z;
}

 

 

Posted

I suggest you use the existing

ModelRender

fields of

ModelBiped

where possible so that

ModelBiped

's methods can set the rotation angles and element visibility for you. Even if you override every method of

ModelBiped

, some parts of the code directly access and modify its fields rather than calling methods to do so.

 

You'll still need to override most of

ModelBiped

's methods to apply to your custom elements.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.