Jump to content

[1.9]Use .java for armor model


BusyBeever

Recommended Posts

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;
}

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I cant craft any of the epic fight mod weapons. I try using the recipes in the crafting table but nothing is working. and when i click on the epic fight weapon in jei there is no recipe at all.
    • Oklahoma Nation Cowboys at Youngstown Country PenguinsYoungstown, Ohio; Wednesday, 7 p.m. EDTBOTTOM LINE: The Youngstown Region Penguins facial area the Oklahoma Country Cowboys within the Countrywide Invitation Penguins include absent 15-5 versus Horizon League rivals, with a 9-4 history within non-meeting participate in. Youngstown Region is 1-2 inside online games resolved as a result of considerably less than 4 facts. The Cowboys are 8-10 in just Massive 12 engage in. Oklahoma Region ranks 9th within just the Large 12 taking pictures 31.1% towards 3-stage wide PERFORMERS: Dwayne Cohill is averaging 17.8 details and 4.8 helps for the Penguins. Adrian Nelson is averaging 17.1 info higher than the remaining 10 game titles for Youngstown Thompson is averaging 11.7 details for the Cowboys. Caleb Asberry is averaging 13.1 facts about the very last 10 video games for Oklahoma last 10 Video games: Penguins: 7-3 Zeke Zaragoza Jersey, averaging 79.7 info, 33.4 rebounds, 14.8 helps, 5.3 steals and 2.7 blocks for each video game despite the fact that capturing 48.1% versus the marketplace. Their rivals incorporate averaged 72.4 details for every : 4-6, averaging 66.4 specifics, 33.1 rebounds, 11.1 helps Jake Henry Jersey, 4.9 steals and 3.6 blocks for each sport even though taking pictures 41.3% towards the sector. Their rivals consist of averaged 72.0 info. The made this tale making use of technological innovation delivered by means of Information and facts Skrive and info against Sportradar. Cowboys Shop
    • Oklahoma Nation Cowboys at Youngstown Country PenguinsYoungstown, Ohio; Wednesday, 7 p.m. EDTBOTTOM LINE: The Youngstown Region Penguins facial area the Oklahoma Country Cowboys within the Countrywide Invitation Penguins include absent 15-5 versus Horizon League rivals, with a 9-4 history within non-meeting participate in. Youngstown Region is 1-2 inside online games resolved as a result of considerably less than 4 facts. The Cowboys are 8-10 in just Massive 12 engage in. Oklahoma Region ranks 9th within just the Large 12 taking pictures 31.1% towards 3-stage wide PERFORMERS: Dwayne Cohill is averaging 17.8 details and 4.8 helps for the Penguins. Adrian Nelson is averaging 17.1 info higher than the remaining 10 game titles for Youngstown Thompson is averaging 11.7 details for the Cowboys. Caleb Asberry is averaging 13.1 facts about the very last 10 video games for Oklahoma last 10 Video games: Penguins: 7-3 Zeke Zaragoza Jersey, averaging 79.7 info, 33.4 rebounds, 14.8 helps, 5.3 steals and 2.7 blocks for each video game despite the fact that capturing 48.1% versus the marketplace. Their rivals incorporate averaged 72.4 details for every : 4-6, averaging 66.4 specifics, 33.1 rebounds, 11.1 helps Jake Henry Jersey, 4.9 steals and 3.6 blocks for each sport even though taking pictures 41.3% towards the sector. Their rivals consist of averaged 72.0 info. The made this tale making use of technological innovation delivered by means of Information and facts Skrive and info against Sportradar. Cowboys Shop
    • DUTA89 agen slot online terbaik dan sering memberikan kemenangan kepada setiap member yang deposit diatas 50k dengan tidak klaim bonus sepeser pun.   Link daftar : https://heylink.me/DUTA89OFFICIAL/  
    • Hello All! Started a MC Eternal 1.6.2.2 server on Shockbyte hosting. The only other mod I added was betterfarmland v0.0.8BETA. Server is 16GB and Shockbyte wont tell me how many CPU cores i have.  We are having problems now when players log in it seems to crash the server. At other times it seems fine and we can have 3 people playing for hours at a time. Usually always when it does crash it is when someone logs in. Crash Reports Below. To the person who can post the fix I will reward $100 via Paypal.   ---- Minecraft Crash Report ---- // This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~] Time: 2024-09-19 21:04:58 UTC Description: Exception in server tick loop java.lang.StackOverflowError     at net.minecraft.advancements.PlayerAdvancements.hasCompletedChildrenOrSelf(PlayerAdvancements.java:451)     at net.minecraft.advancements.PlayerAdvancements.shouldBeVisible(PlayerAdvancements.java:419)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:385)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.P  
  • Topics

×
×
  • Create New...

Important Information

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