Jump to content

I need help with my custom entity


owoskree07

Recommended Posts

spacer.png

My model looks like this and I can't figure out how to fix it. This is the java class code blockbench gave me. My code looks like this ->

package com.owoskree07.heaven.client.model;

import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.vertex.IVertexBuilder;
import com.owoskree07.heaven.enitites.AngelEntity;
import net.minecraft.client.renderer.entity.model.EntityModel;
import net.minecraft.client.renderer.model.ModelRenderer;
import net.minecraft.util.math.MathHelper;

public class AngelModel<T extends AngelEntity> extends EntityModel<T> {

    private final ModelRenderer head;
    private final ModelRenderer body;
    private final ModelRenderer right_wing;
    private final ModelRenderer left_wing;
    private final ModelRenderer arms;
    private final ModelRenderer mirrored;
    private final ModelRenderer right_leg;
    private final ModelRenderer left_leg;
    private final ModelRenderer headwear;

    public AngelModel() {
        textureWidth = 64;
        textureHeight = 64;

        head = new ModelRenderer(this);
        head.setRotationPoint(0.0F, 0.0F, 0.0F);
        head.setTextureOffset(0, 0).addBox(-4.0F, -8.0F, -4.0F, 8.0F, 8.0F, 8.0F, 0.0F, false);

        body = new ModelRenderer(this);
        body.setRotationPoint(0.0F, 0.0F, 0.0F);
        body.setTextureOffset(16, 20).addBox(-4.0F, -4.0F, -2.0F, 8.0F, 12.0F, 4.0F, 0.0F, false);

        right_wing = new ModelRenderer(this);
        right_wing.setRotationPoint(3.0F, 3.0F, 2.0F);
        body.addChild(right_wing);
        setRotationAngle(right_wing, 0.0F, -0.3927F, 0.0F);
        right_wing.setTextureOffset(0, 0).addBox(0.9886F, -3.0F, 0.2615F, 8.0F, 1.0F, 1.0F, 0.0F, false);
        right_wing.setTextureOffset(0, 0).addBox(1.9886F, -4.0F, 0.2615F, 7.0F, 1.0F, 1.0F, 0.0F, false);
        right_wing.setTextureOffset(0, 0).addBox(2.9886F, -5.0F, 0.2615F, 5.0F, 1.0F, 1.0F, 0.0F, false);
        right_wing.setTextureOffset(0, 0).addBox(3.9886F, -6.0F, 0.2615F, 3.0F, 1.0F, 1.0F, 0.0F, false);
        right_wing.setTextureOffset(0, 0).addBox(-0.0114F, -2.0F, 0.2615F, 9.0F, 1.0F, 1.0F, 0.0F, false);
        right_wing.setTextureOffset(0, 0).addBox(-1.0114F, 0.0F, 0.2615F, 8.0F, 1.0F, 1.0F, 0.0F, false);
        right_wing.setTextureOffset(0, 0).addBox(-0.0114F, 1.0F, 0.2615F, 6.0F, 1.0F, 1.0F, 0.0F, false);
        right_wing.setTextureOffset(0, 0).addBox(-0.0114F, 2.0F, 0.2615F, 6.0F, 1.0F, 1.0F, 0.0F, false);
        right_wing.setTextureOffset(0, 0).addBox(0.9886F, 3.0F, 0.2615F, 4.0F, 1.0F, 1.0F, 0.0F, false);
        right_wing.setTextureOffset(0, 0).addBox(-1.0114F, -1.0F, 0.2615F, 9.0F, 1.0F, 1.0F, 0.0F, false);

        left_wing = new ModelRenderer(this);
        left_wing.setRotationPoint(-2.0F, 3.0F, 1.0F);
        body.addChild(left_wing);
        setRotationAngle(left_wing, 0.0F, 0.3491F, 0.0F);
        left_wing.setTextureOffset(0, 0).addBox(-10.0F, -3.0F, 1.0F, 8.0F, 1.0F, 1.0F, 0.0F, false);
        left_wing.setTextureOffset(0, 0).addBox(-10.0F, -4.0F, 1.0F, 7.0F, 1.0F, 1.0F, 0.0F, false);
        left_wing.setTextureOffset(0, 0).addBox(-9.0F, -5.0F, 1.0F, 5.0F, 1.0F, 1.0F, 0.0F, false);
        left_wing.setTextureOffset(0, 0).addBox(-8.0F, -6.0F, 1.0F, 3.0F, 1.0F, 1.0F, 0.0F, false);
        left_wing.setTextureOffset(0, 0).addBox(-10.0F, -2.0F, 1.0F, 9.0F, 1.0F, 1.0F, 0.0F, false);
        left_wing.setTextureOffset(0, 0).addBox(-8.0F, 0.0F, 1.0F, 8.0F, 1.0F, 1.0F, 0.0F, false);
        left_wing.setTextureOffset(0, 0).addBox(-7.0F, 1.0F, 1.0F, 6.0F, 1.0F, 1.0F, 0.0F, false);
        left_wing.setTextureOffset(0, 0).addBox(-7.0F, 2.0F, 1.0F, 6.0F, 1.0F, 1.0F, 0.0F, false);
        left_wing.setTextureOffset(0, 0).addBox(-6.0F, 3.0F, 1.0F, 4.0F, 1.0F, 1.0F, 0.0F, false);
        left_wing.setTextureOffset(0, 0).addBox(-9.0F, -1.0F, 1.0F, 9.0F, 1.0F, 1.0F, 0.0F, false);

        arms = new ModelRenderer(this);
        arms.setRotationPoint(-5.0F, 2.0F, 4.0F);
        arms.setTextureOffset(40, 38).addBox(1.0F, 2.0F, -6.0F, 8.0F, 8.0F, 4.0F, 0.0F, false);
        arms.setTextureOffset(44, 22).addBox(-3.0F, -2.0F, -6.0F, 4.0F, 12.0F, 4.0F, 0.0F, false);

        mirrored = new ModelRenderer(this);
        mirrored.setRotationPoint(11.0F, -1.0F, -4.0F);
        arms.addChild(mirrored);
        mirrored.setTextureOffset(44, 22).addBox(-2.0F, -1.0F, -2.0F, 4.0F, 12.0F, 4.0F, 0.0F, true);

        right_leg = new ModelRenderer(this);
        right_leg.setRotationPoint(2.0F, 12.0F, 0.0F);
        right_leg.setTextureOffset(0, 22).addBox(-2.0F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, 0.0F, false);

        left_leg = new ModelRenderer(this);
        left_leg.setRotationPoint(-2.0F, 12.0F, 0.0F);
        left_leg.setTextureOffset(0, 22).addBox(-2.0F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, 0.0F, false);

        headwear = new ModelRenderer(this);
        headwear.setRotationPoint(0.0F, 1.0F, 0.0F);
        headwear.setTextureOffset(0, 0).addBox(-5.0F, -6.0F, -3.0F, 1.0F, 1.0F, 4.0F, 0.0F, false);
        headwear.setTextureOffset(0, 0).addBox(-5.0F, -5.0F, 1.0F, 1.0F, 1.0F, 4.0F, 0.0F, false);
        headwear.setTextureOffset(0, 0).addBox(-4.0F, -6.0F, 4.0F, 4.0F, 1.0F, 1.0F, 0.0F, false);
        headwear.setTextureOffset(0, 0).addBox(0.0F, -5.0F, 4.0F, 4.0F, 1.0F, 1.0F, 0.0F, false);
        headwear.setTextureOffset(0, 0).addBox(4.0F, -6.0F, 0.0F, 1.0F, 1.0F, 5.0F, 0.0F, false);
        headwear.setTextureOffset(0, 0).addBox(4.0F, -7.0F, -3.0F, 1.0F, 1.0F, 3.0F, 0.0F, false);
    }

    @Override
    public void setRotationAngles(T entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {
        this.head.rotateAngleX = headPitch * ((float)Math.PI / 180F);
        this.head.rotateAngleY = netHeadYaw * ((float)Math.PI / 180F);
        this.body.rotateAngleX = ((float)Math.PI / 2F);
        this.right_leg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount;
        this.left_leg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.4F * limbSwingAmount;
        this.right_wing.rotateAngleX = ((float)Math.PI / 2F);
        this.left_wing.rotateAngleX = ((float)Math.PI / 2F);
    }

    @Override
    public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha){
        head.render(matrixStack, buffer, packedLight, packedOverlay);
        body.render(matrixStack, buffer, packedLight, packedOverlay);
        arms.render(matrixStack, buffer, packedLight, packedOverlay);
        right_leg.render(matrixStack, buffer, packedLight, packedOverlay);
        left_leg.render(matrixStack, buffer, packedLight, packedOverlay);
        headwear.render(matrixStack, buffer, packedLight, packedOverlay);
    }

    public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) {
        modelRenderer.rotateAngleX = x;
        modelRenderer.rotateAngleY = y;
        modelRenderer.rotateAngleZ = z;
    }
}

 

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



×
×
  • Create New...

Important Information

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