Jump to content

Recommended Posts

Posted

Hello evevryone!

 

Recently I've been trying to override the player render, and so I tried to change the head's rotation point, here's what I did :

 

package justpingo.lyokocraftmod.client;

import net.minecraft.client.model.ModelRenderer;

public class DynaModelBiped extends net.minecraft.client.model.ModelBiped {

public float size;

public DynaModelBiped()
    {
        this(0.0F);
    }

    public DynaModelBiped(float p_i1148_1_)
    {
        this(p_i1148_1_, 0.0F, 64, 32, 1);
    }
    
    public DynaModelBiped(float size, boolean osef)
    {
    	this(0.0F, 0.0F, 64, 32, size);
    }
    
    public DynaModelBiped(float size, float multi) {
    	this(multi, 0.0F, 64, 32, size);
    }
    
    public DynaModelBiped(float p_i1149_1_, float p_i1149_2_, int p_i1149_3_, int p_i1149_4_) {
    	this(p_i1149_1_, p_i1149_2_, p_i1149_3_, p_i1149_4_, 1F);
    }

    public DynaModelBiped(float p_i1149_1_, float p_i1149_2_, int p_i1149_3_, int p_i1149_4_, float size)
    {
    	this.size = size;
        this.textureWidth = p_i1149_3_;
        this.textureHeight = p_i1149_4_;
        this.bipedCloak = new ModelRenderer(this, 0, 0);
        this.bipedCloak.addBox(-5.0F, 0.0F, -1.0F, 10, 16, 1, p_i1149_1_);
        this.bipedEars = new ModelRenderer(this, 24, 0);
        this.bipedEars.addBox(-3.0F, -6.0F, -1.0F, 6, 6, 1, p_i1149_1_);
        this.bipedHead = new ModelRenderer(this, 0, 0);
        this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, p_i1149_1_);
        this.bipedHead.setRotationPoint(0.0F, p_i1149_2_ - 12*size, 0.0F); // INTERESTING PART
        this.bipedHeadwear = new ModelRenderer(this, 32, 0);
        this.bipedHeadwear.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, p_i1149_1_ + 0.5F);
        this.bipedHeadwear.setRotationPoint(0.0F, 0.0F + p_i1149_2_ - 12*size, 0.0F);
        this.bipedBody = new ModelRenderer(this, 16, 16);
        this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, (int) (12*size), 4, p_i1149_1_);
        this.bipedBody.setRotationPoint(0.0F, 0.0F + p_i1149_2_-6*size, 0.0F);
        this.bipedRightArm = new ModelRenderer(this, 40, 16);
        this.bipedRightArm.addBox(-3.0F, -2.0F, -2.0F, 4, (int) (12*size), 4, p_i1149_1_);
        this.bipedRightArm.setRotationPoint(-5.0F, 2.0F + p_i1149_2_ - 6*size, 0.0F);
        this.bipedLeftArm = new ModelRenderer(this, 40, 16);
        this.bipedLeftArm.mirror = true;
        this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, (int) (12*size), 4, p_i1149_1_);
        this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + p_i1149_2_  - 6*size, 0.0F);
        this.bipedRightLeg = new ModelRenderer(this, 0, 16);
        this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, (int) (12*size), 4, p_i1149_1_);
        this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F + p_i1149_2_, 0.0F);
        this.bipedLeftLeg = new ModelRenderer(this, 0, 16);
        this.bipedLeftLeg.mirror = true;
        this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, (int) (12*size), 4, p_i1149_1_);
        this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F + p_i1149_2_, 0.0F);
    }

}

 

(sorry if the code is a bit messy, I tried a lot of stuff to make it work)

But when I tried to change that rotation point (by using 12*size), it just does nothing in the game. I even tried with eclipse's debug mode, but just nothing. Even weirder, it works perfectly with the arms but the same problem appears with the legs.

 

Do you know what I did wrong?

 

Thanks in advance!

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.