Jump to content

Problem with Z-fighting on Entity Model [1.12.2]


kpzip

Recommended Posts

The model for my custom entity has some issues with z-fighting: (seen on the top of the claws)

Spoiler

2019-07-20_13_09_18.thumb.png.47fdb7ce1f192dbe9f5d4354f4aa584a.png

Here is me model file:

Spoiler

package com.kpzip.SushiMod.entities.render.model;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

/**
 * Crab - kpzip
 * Created using Tabula 7.0.1
 */
@SideOnly(Side.CLIENT)
public class ModelCrab extends ModelBase {
    public ModelRenderer back_left_leg;
    public ModelRenderer back_right_leg;
    public ModelRenderer front_left_leg;
    public ModelRenderer front_right_leg;
    public ModelRenderer right_eye;
    public ModelRenderer left_eye;
    public ModelRenderer body;
    public ModelRenderer top;
    public ModelRenderer side_main_front;
    public ModelRenderer side_2_back;
    public ModelRenderer side_main_right;
    public ModelRenderer side_2_left;
    public ModelRenderer side_1_front;
    public ModelRenderer side_2_front;
    public ModelRenderer side_main_left;
    public ModelRenderer side_1_left;
    public ModelRenderer side_1_back;
    public ModelRenderer side_main_back;
    public ModelRenderer top_1;
    public ModelRenderer side_main_front_1;
    public ModelRenderer side_2_back_1;
    public ModelRenderer side_main_right_1;
    public ModelRenderer side_2_left_1;
    public ModelRenderer side_1_front_1;
    public ModelRenderer side_2_front_1;
    public ModelRenderer side_main_left_1;
    public ModelRenderer side_1_left_1;
    public ModelRenderer side_1_back_1;
    public ModelRenderer side_main_back_1;
    public ModelRenderer top_2;
    public ModelRenderer side_main_front_2;
    public ModelRenderer side_2_back_2;
    public ModelRenderer side_main_right_2;
    public ModelRenderer side_2_left_2;
    public ModelRenderer side_1_front_2;
    public ModelRenderer side_2_front_2;
    public ModelRenderer side_main_left_2;
    public ModelRenderer side_1_left_2;
    public ModelRenderer side_1_back_2;
    public ModelRenderer side_main_back_2;
    public ModelRenderer top_3;
    public ModelRenderer side_main_front_3;
    public ModelRenderer side_2_back_3;
    public ModelRenderer side_main_right_3;
    public ModelRenderer side_2_left_3;
    public ModelRenderer side_1_front_3;
    public ModelRenderer side_2_front_3;
    public ModelRenderer side_main_left_3;
    public ModelRenderer side_1_left_3;
    public ModelRenderer side_1_back_3;
    public ModelRenderer side_main_back_3;

    public ModelCrab() {
        this.textureWidth = 64;
        this.textureHeight = 64;
        this.side_2_front_2 = new ModelRenderer(this, 0, 0);
        this.side_2_front_2.setRotationPoint(-3.0F, 20.8F, -1.0F);
        this.side_2_front_2.addBox(2.0F, -1.0F, -2.0F, 1, 1, 0, 0.0F);
        this.setRotateAngle(side_2_front_2, 0.0F, 3.141592653589793F, 0.2617993877991494F);
        this.side_main_left = new ModelRenderer(this, 0, 0);
        this.side_main_left.setRotationPoint(3.0F, 20.8F, -1.0F);
        this.side_main_left.addBox(-2.0F, -2.0F, 4.0F, 4, 1, 0, 0.0F);
        this.setRotateAngle(side_main_left, 0.0F, 1.5707963267948966F, -0.2617993877991494F);
        this.side_2_front_1 = new ModelRenderer(this, 0, 0);
        this.side_2_front_1.setRotationPoint(3.0F, 20.8F, -1.0F);
        this.side_2_front_1.addBox(2.0F, 0.0F, -2.0F, 1, 1, 0, 0.0F);
        this.setRotateAngle(side_2_front_1, 3.141592653589793F, 0.0F, -0.08726646259971647F);
        this.side_main_left_3 = new ModelRenderer(this, 0, 0);
        this.side_main_left_3.setRotationPoint(-3.0F, 20.8F, -1.0F);
        this.side_main_left_3.addBox(-2.0F, -1.0F, -4.0F, 4, 1, 0, 0.0F);
        this.setRotateAngle(side_main_left_3, 3.141592653589793F, 4.71238898038469F, 0.08726646259971647F);
        this.right_eye = new ModelRenderer(this, 43, 0);
        this.right_eye.setRotationPoint(-1.5F, 20.5F, -2.0F);
        this.right_eye.addBox(-0.5F, -2.0F, -0.5F, 1, 2, 1, 0.0F);
        this.side_1_left_3 = new ModelRenderer(this, 0, 0);
        this.side_1_left_3.setRotationPoint(-3.0F, 20.8F, -1.0F);
        this.side_1_left_3.addBox(1.0F, 0.0F, -4.0F, 1, 1, 0, 0.0F);
        this.setRotateAngle(side_1_left_3, 3.141592653589793F, 4.71238898038469F, 0.08726646259971647F);
        this.front_right_leg = new ModelRenderer(this, 0, 0);
        this.front_right_leg.setRotationPoint(-3.8F, 22.0F, -2.0F);
        this.front_right_leg.addBox(0.5F, 0.0F, 0.0F, 1, 2, 1, 0.0F);
        this.setRotateAngle(front_right_leg, 0.0F, 0.0F, 0.3490658503988659F);
        this.left_eye = new ModelRenderer(this, 39, 0);
        this.left_eye.setRotationPoint(1.5F, 20.5F, -2.0F);
        this.left_eye.addBox(-0.5F, -2.0F, -0.5F, 1, 2, 1, 0.0F);
        this.side_1_left = new ModelRenderer(this, 0, 0);
        this.side_1_left.setRotationPoint(3.0F, 20.8F, -1.0F);
        this.side_1_left.addBox(0.0F, -1.0F, 4.0F, 1, 1, 0, 0.0F);
        this.setRotateAngle(side_1_left, 0.0F, 1.5707963267948966F, -0.2617993877991494F);
        this.back_right_leg = new ModelRenderer(this, 0, 0);
        this.back_right_leg.setRotationPoint(-3.8F, 22.0F, 1.0F);
        this.back_right_leg.addBox(0.5F, 0.0F, 0.0F, 1, 2, 1, 0.0F);
        this.setRotateAngle(back_right_leg, 0.0F, 0.0F, 0.3490658503988659F);
        this.side_2_back_2 = new ModelRenderer(this, 0, 0);
        this.side_2_back_2.setRotationPoint(-3.0F, 20.8F, -1.0F);
        this.side_2_back_2.addBox(3.0F, -1.0F, 2.0F, 1, 1, 0, 0.0F);
        this.setRotateAngle(side_2_back_2, 0.0F, 3.141592653589793F, 0.2617993877991494F);
        this.side_2_front_3 = new ModelRenderer(this, 0, 0);
        this.side_2_front_3.setRotationPoint(-3.0F, 20.8F, -1.0F);
        this.side_2_front_3.addBox(2.0F, 0.0F, -2.0F, 1, 1, 0, 0.0F);
        this.setRotateAngle(side_2_front_3, 3.141592653589793F, 3.141592653589793F, 0.08726646259971647F);
        this.side_1_left_2 = new ModelRenderer(this, 0, 0);
        this.side_1_left_2.setRotationPoint(-3.0F, 20.8F, -1.0F);
        this.side_1_left_2.addBox(0.0F, -1.0F, 4.0F, 1, 1, 0, 0.0F);
        this.setRotateAngle(side_1_left_2, 0.0F, 4.71238898038469F, 0.2617993877991494F);
        this.side_1_front_1 = new ModelRenderer(this, 0, 0);
        this.side_1_front_1.setRotationPoint(3.0F, 20.8F, -1.0F);
        this.side_1_front_1.addBox(0.0F, 0.0F, -2.0F, 1, 1, 0, 0.0F);
        this.setRotateAngle(side_1_front_1, 3.141592653589793F, 0.0F, -0.08726646259971647F);
        this.side_main_back_2 = new ModelRenderer(this, 0, 0);
        this.side_main_back_2.setRotationPoint(-3.0F, 20.8F, -1.0F);
        this.side_main_back_2.addBox(0.0F, -2.0F, 2.0F, 4, 1, 0, 0.0F);
        this.setRotateAngle(side_main_back_2, 0.0F, 3.141592653589793F, 0.2617993877991494F);
        this.side_1_back_2 = new ModelRenderer(this, 0, 0);
        this.side_1_back_2.setRotationPoint(-3.0F, 20.8F, -1.0F);
        this.side_1_back_2.addBox(1.0F, -1.0F, 2.0F, 1, 1, 0, 0.0F);
        this.setRotateAngle(side_1_back_2, 0.0F, 3.141592653589793F, 0.2617993877991494F);
        this.side_2_back = new ModelRenderer(this, 0, 0);
        this.side_2_back.setRotationPoint(3.0F, 20.8F, -1.0F);
        this.side_2_back.addBox(3.0F, -1.0F, 2.0F, 1, 1, 0, 0.0F);
        this.setRotateAngle(side_2_back, 0.0F, 0.0F, -0.2617993877991494F);
        this.side_1_front_2 = new ModelRenderer(this, 0, 0);
        this.side_1_front_2.setRotationPoint(-3.0F, 20.8F, -1.0F);
        this.side_1_front_2.addBox(0.0F, -1.0F, -2.0F, 1, 1, 0, 0.0F);
        this.setRotateAngle(side_1_front_2, 0.0F, 3.141592653589793F, 0.2617993877991494F);
        this.side_main_front = new ModelRenderer(this, 0, 0);
        this.side_main_front.setRotationPoint(3.0F, 20.8F, -1.0F);
        this.side_main_front.addBox(0.0F, -2.0F, -2.0F, 4, 1, 0, 0.0F);
        this.setRotateAngle(side_main_front, 0.0F, 0.0F, -0.2617993877991494F);
        this.side_main_front_2 = new ModelRenderer(this, 0, 0);
        this.side_main_front_2.setRotationPoint(-3.0F, 20.8F, -1.0F);
        this.side_main_front_2.addBox(0.0F, -2.0F, -2.0F, 4, 1, 0, 0.0F);
        this.setRotateAngle(side_main_front_2, 0.0F, 3.141592653589793F, 0.2617993877991494F);
        this.side_main_front_1 = new ModelRenderer(this, 0, 0);
        this.side_main_front_1.setRotationPoint(3.0F, 20.8F, -1.0F);
        this.side_main_front_1.addBox(0.0F, -1.0F, -2.0F, 4, 1, 0, 0.0F);
        this.setRotateAngle(side_main_front_1, 3.141592653589793F, 0.0F, -0.08726646259971647F);
        this.side_1_back_3 = new ModelRenderer(this, 0, 0);
        this.side_1_back_3.setRotationPoint(-3.0F, 20.8F, -1.0F);
        this.side_1_back_3.addBox(1.0F, 0.0F, 2.0F, 1, 1, 0, 0.0F);
        this.setRotateAngle(side_1_back_3, 3.141592653589793F, 3.141592653589793F, 0.08726646259971647F);
        this.side_2_front = new ModelRenderer(this, 0, 0);
        this.side_2_front.setRotationPoint(3.0F, 20.8F, -1.0F);
        this.side_2_front.addBox(2.0F, -1.0F, -2.0F, 1, 1, 0, 0.0F);
        this.setRotateAngle(side_2_front, 0.0F, 0.0F, -0.2617993877991494F);
        this.side_2_left = new ModelRenderer(this, 0, 0);
        this.side_2_left.setRotationPoint(3.0F, 20.8F, -1.0F);
        this.side_2_left.addBox(-2.0F, -1.0F, 4.0F, 1, 1, 0, 0.0F);
        this.setRotateAngle(side_2_left, 0.0F, 1.5707963267948966F, -0.2617993877991494F);
        this.side_main_right_1 = new ModelRenderer(this, 0, 0);
        this.side_main_right_1.setRotationPoint(3.0F, 20.8F, -1.0F);
        this.side_main_right_1.addBox(-2.0F, -1.0F, 0.0F, 4, 2, 0, 0.0F);
        this.setRotateAngle(side_main_right_1, 3.141592653589793F, 1.5707963267948966F, -0.08726646259971647F);
        this.body = new ModelRenderer(this, 42, 0);
        this.body.setRotationPoint(-3.0F, 20.5F, -2.5F);
        this.body.addBox(0.0F, 0.0F, 0.0F, 6, 2, 5, 0.0F);
        this.side_main_right = new ModelRenderer(this, 0, 0);
        this.side_main_right.setRotationPoint(3.0F, 20.8F, -1.0F);
        this.side_main_right.addBox(-2.0F, -2.0F, 0.0F, 4, 2, 0, 0.0F);
        this.setRotateAngle(side_main_right, 0.0F, 1.5707963267948966F, -0.2617993877991494F);
        this.side_2_back_1 = new ModelRenderer(this, 0, 0);
        this.side_2_back_1.setRotationPoint(3.0F, 20.8F, -1.0F);
        this.side_2_back_1.addBox(3.0F, 0.0F, 2.0F, 1, 1, 0, 0.0F);
        this.setRotateAngle(side_2_back_1, 3.141592653589793F, 0.0F, -0.08726646259971647F);
        this.side_1_front_3 = new ModelRenderer(this, 0, 0);
        this.side_1_front_3.setRotationPoint(-3.0F, 20.8F, -1.0F);
        this.side_1_front_3.addBox(0.0F, 0.0F, -2.0F, 1, 1, 0, 0.0F);
        this.setRotateAngle(side_1_front_3, 3.141592653589793F, 3.141592653589793F, 0.08726646259971647F);
        this.side_main_left_1 = new ModelRenderer(this, 0, 0);
        this.side_main_left_1.setRotationPoint(3.0F, 20.8F, -1.0F);
        this.side_main_left_1.addBox(-2.0F, -1.0F, -4.0F, 4, 1, 0, 0.0F);
        this.setRotateAngle(side_main_left_1, 3.141592653589793F, 1.5707963267948966F, -0.08726646259971647F);
        this.side_2_back_3 = new ModelRenderer(this, 0, 0);
        this.side_2_back_3.setRotationPoint(-3.0F, 20.8F, -1.0F);
        this.side_2_back_3.addBox(3.0F, 0.0F, 2.0F, 1, 1, 0, 0.0F);
        this.setRotateAngle(side_2_back_3, 3.141592653589793F, 3.141592653589793F, 0.08726646259971647F);
        this.side_main_right_2 = new ModelRenderer(this, 0, 0);
        this.side_main_right_2.setRotationPoint(-3.0F, 20.8F, -1.0F);
        this.side_main_right_2.addBox(-2.0F, -2.0F, 0.0F, 4, 2, 0, 0.0F);
        this.setRotateAngle(side_main_right_2, 0.0F, 4.71238898038469F, 0.2617993877991494F);
        this.front_left_leg = new ModelRenderer(this, 0, 0);
        this.front_left_leg.setRotationPoint(2.8F, 22.0F, -2.0F);
        this.front_left_leg.addBox(-0.5F, 0.0F, 0.0F, 1, 2, 1, 0.0F);
        this.setRotateAngle(front_left_leg, 0.0F, 0.0F, -0.3490658503988659F);
        this.side_1_back = new ModelRenderer(this, 0, 0);
        this.side_1_back.setRotationPoint(3.0F, 20.8F, -1.0F);
        this.side_1_back.addBox(1.0F, -1.0F, 2.0F, 1, 1, 0, 0.0F);
        this.setRotateAngle(side_1_back, 0.0F, 0.0F, -0.2617993877991494F);
        this.side_1_front = new ModelRenderer(this, 0, 0);
        this.side_1_front.setRotationPoint(3.0F, 20.8F, -1.0F);
        this.side_1_front.addBox(0.0F, -1.0F, -2.0F, 1, 1, 0, 0.0F);
        this.setRotateAngle(side_1_front, 0.0F, 0.0F, -0.2617993877991494F);
        this.top_2 = new ModelRenderer(this, 0, 0);
        this.top_2.setRotationPoint(-3.0F, 20.8F, -1.0F);
        this.top_2.addBox(0.0F, -2.0F, -2.0F, 4, 0, 4, 0.0F);
        this.setRotateAngle(top_2, 0.0F, 3.141592653589793F, 0.2617993877991494F);
        this.side_main_back_3 = new ModelRenderer(this, 0, 0);
        this.side_main_back_3.setRotationPoint(-3.0F, 20.8F, -1.0F);
        this.side_main_back_3.addBox(0.0F, -1.0F, 2.0F, 4, 1, 0, 0.0F);
        this.setRotateAngle(side_main_back_3, 3.141592653589793F, 3.141592653589793F, 0.08726646259971647F);
        this.side_2_left_1 = new ModelRenderer(this, 0, 0);
        this.side_2_left_1.setRotationPoint(3.0F, 20.8F, -1.0F);
        this.side_2_left_1.addBox(-1.0F, 0.0F, -4.0F, 1, 1, 0, 0.0F);
        this.setRotateAngle(side_2_left_1, 3.141592653589793F, 1.5707963267948966F, -0.08726646259971647F);
        this.side_main_front_3 = new ModelRenderer(this, 0, 0);
        this.side_main_front_3.setRotationPoint(-3.0F, 20.8F, -1.0F);
        this.side_main_front_3.addBox(0.0F, -1.0F, -2.0F, 4, 1, 0, 0.0F);
        this.setRotateAngle(side_main_front_3, 3.141592653589793F, 3.141592653589793F, 0.08726646259971647F);
        this.back_left_leg = new ModelRenderer(this, 0, 0);
        this.back_left_leg.setRotationPoint(2.8F, 22.0F, 1.0F);
        this.back_left_leg.addBox(-0.5F, 0.0F, 0.0F, 1, 2, 1, 0.0F);
        this.setRotateAngle(back_left_leg, 0.0F, 0.0F, -0.3490658503988659F);
        this.side_2_left_2 = new ModelRenderer(this, 0, 0);
        this.side_2_left_2.setRotationPoint(-3.0F, 20.8F, -1.0F);
        this.side_2_left_2.addBox(-2.0F, -1.0F, 4.0F, 1, 1, 0, 0.0F);
        this.setRotateAngle(side_2_left_2, 0.0F, 4.71238898038469F, 0.2617993877991494F);
        this.side_1_back_1 = new ModelRenderer(this, 0, 0);
        this.side_1_back_1.setRotationPoint(3.0F, 20.8F, -1.0F);
        this.side_1_back_1.addBox(1.0F, 0.0F, 2.0F, 1, 1, 0, 0.0F);
        this.setRotateAngle(side_1_back_1, 3.141592653589793F, 0.0F, -0.08726646259971647F);
        this.side_1_left_1 = new ModelRenderer(this, 0, 0);
        this.side_1_left_1.setRotationPoint(3.0F, 20.8F, -1.0F);
        this.side_1_left_1.addBox(1.0F, 0.0F, -4.0F, 1, 1, 0, 0.0F);
        this.setRotateAngle(side_1_left_1, 3.141592653589793F, 1.5707963267948966F, -0.08726646259971647F);
        this.side_main_right_3 = new ModelRenderer(this, 0, 0);
        this.side_main_right_3.setRotationPoint(-3.0F, 20.8F, -1.0F);
        this.side_main_right_3.addBox(-2.0F, -1.0F, 0.0F, 4, 2, 0, 0.0F);
        this.setRotateAngle(side_main_right_3, 3.141592653589793F, 4.71238898038469F, 0.08726646259971647F);
        this.side_main_back_1 = new ModelRenderer(this, 0, 0);
        this.side_main_back_1.setRotationPoint(3.0F, 20.8F, -1.0F);
        this.side_main_back_1.addBox(0.0F, -1.0F, 2.0F, 4, 1, 0, 0.0F);
        this.setRotateAngle(side_main_back_1, 3.141592653589793F, 0.0F, -0.08726646259971647F);
        this.top = new ModelRenderer(this, 0, 0);
        this.top.setRotationPoint(3.0F, 20.8F, -1.0F);
        this.top.addBox(0.0F, -2.0F, -2.0F, 4, 0, 4, 0.0F);
        this.setRotateAngle(top, 0.0F, 0.0F, -0.2617993877991494F);
        this.side_2_left_3 = new ModelRenderer(this, 0, 0);
        this.side_2_left_3.setRotationPoint(-3.0F, 20.8F, -1.0F);
        this.side_2_left_3.addBox(-1.0F, 0.0F, -4.0F, 1, 1, 0, 0.0F);
        this.setRotateAngle(side_2_left_3, 3.141592653589793F, 4.71238898038469F, 0.08726646259971647F);
        this.top_1 = new ModelRenderer(this, 0, 0);
        this.top_1.setRotationPoint(3.0F, 20.8F, -1.0F);
        this.top_1.addBox(0.0F, -1.0F, -2.0F, 4, 0, 4, 0.0F);
        this.setRotateAngle(top_1, 3.141592653589793F, 0.0F, -0.08726646259971647F);
        this.side_main_left_2 = new ModelRenderer(this, 0, 0);
        this.side_main_left_2.setRotationPoint(-3.0F, 20.8F, -1.0F);
        this.side_main_left_2.addBox(-2.0F, -2.0F, 4.0F, 4, 1, 0, 0.0F);
        this.setRotateAngle(side_main_left_2, 0.0F, 4.71238898038469F, 0.2617993877991494F);
        this.side_main_back = new ModelRenderer(this, 0, 0);
        this.side_main_back.setRotationPoint(3.0F, 20.8F, -1.0F);
        this.side_main_back.addBox(0.0F, -2.0F, 2.0F, 4, 1, 0, 0.0F);
        this.setRotateAngle(side_main_back, 0.0F, 0.0F, -0.2617993877991494F);
        this.top_3 = new ModelRenderer(this, 0, 0);
        this.top_3.setRotationPoint(-3.0F, 20.8F, -1.0F);
        this.top_3.addBox(0.0F, -1.0F, -2.0F, 4, 0, 4, 0.0F);
        this.setRotateAngle(top_3, 3.141592653589793F, 3.141592653589793F, 0.08726646259971647F);
    }

    @Override
    public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { 
        this.side_2_front_2.render(f5);
        this.side_main_left.render(f5);
        this.side_2_front_1.render(f5);
        this.side_main_left_3.render(f5);
        this.right_eye.render(f5);
        this.side_1_left_3.render(f5);
        this.front_right_leg.render(f5);
        this.left_eye.render(f5);
        this.side_1_left.render(f5);
        this.back_right_leg.render(f5);
        this.side_2_back_2.render(f5);
        this.side_2_front_3.render(f5);
        this.side_1_left_2.render(f5);
        this.side_1_front_1.render(f5);
        this.side_main_back_2.render(f5);
        this.side_1_back_2.render(f5);
        this.side_2_back.render(f5);
        this.side_1_front_2.render(f5);
        this.side_main_front.render(f5);
        this.side_main_front_2.render(f5);
        this.side_main_front_1.render(f5);
        this.side_1_back_3.render(f5);
        this.side_2_front.render(f5);
        this.side_2_left.render(f5);
        this.side_main_right_1.render(f5);
        this.body.render(f5);
        this.side_main_right.render(f5);
        this.side_2_back_1.render(f5);
        this.side_1_front_3.render(f5);
        this.side_main_left_1.render(f5);
        this.side_2_back_3.render(f5);
        this.side_main_right_2.render(f5);
        this.front_left_leg.render(f5);
        this.side_1_back.render(f5);
        this.side_1_front.render(f5);
        this.top_2.render(f5);
        this.side_main_back_3.render(f5);
        this.side_2_left_1.render(f5);
        this.side_main_front_3.render(f5);
        this.back_left_leg.render(f5);
        this.side_2_left_2.render(f5);
        this.side_1_back_1.render(f5);
        this.side_1_left_1.render(f5);
        this.side_main_right_3.render(f5);
        this.side_main_back_1.render(f5);
        this.top.render(f5);
        this.side_2_left_3.render(f5);
        this.top_1.render(f5);
        this.side_main_left_2.render(f5);
        this.side_main_back.render(f5);
        this.top_3.render(f5);
    }

    /**
     * This is a helper function from Tabula to set the rotation of model parts
     */
    public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {
        modelRenderer.rotateAngleX = x;
        modelRenderer.rotateAngleY = y;
        modelRenderer.rotateAngleZ = z;
    }
    
    @Override
    public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) {
    	this.back_left_leg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount;
    	this.front_left_leg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount;
    	this.back_right_leg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.4F * limbSwingAmount;
    	this.front_right_leg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.4F * limbSwingAmount;
    	this.right_eye.rotateAngleX = headPitch * 0.017453292F;
    	this.left_eye.rotateAngleX = headPitch * 0.017453292F;
    }
}

 

Here is my render code:

Spoiler

package com.kpzip.SushiMod.entities.render;

import com.kpzip.SushiMod.entities.EntityCrab;
import com.kpzip.SushiMod.entities.render.model.ModelCrab;
import com.kpzip.SushiMod.util.Reference;

import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.util.ResourceLocation;

public class RenderCrab extends RenderLiving<EntityCrab>{

	public static final ResourceLocation TEXTURES = new ResourceLocation(Reference.MOD_ID + ":textures/entity/crab.png");
	
	public RenderCrab(RenderManager manager) {
		super(manager, new ModelCrab(), 0.5f);
	}
	
	@Override
	protected ResourceLocation getEntityTexture(EntityCrab entity) {
		return TEXTURES;
	}
	
	@Override
	protected void applyRotations(EntityCrab entityLiving, float p_77043_2_, float rotationYaw, float partialTicks) {
		super.applyRotations(entityLiving, p_77043_2_, rotationYaw, partialTicks);
	}

}

 

 

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

    • The game crashed whilst exception ticking world Error: java.lang.NullPointerException: Cannot invoke "net.minecraft.resources.ResourceLocation.equals(Object)" because "this.lootTableId" is null Error given is above. I was already playing for around 15 minutes and wasn't doing anything specific or even breaking anything when the crashed happened. This is update 1.19.2 forge: 43.2.23 Mod list: ESSENTIAL Mod (by SparkUniverse_) Traveler's Titles (Forge) (by YUNGNICKYOUNG) Resourceful Config (by ThatGravyBoat) Dynamic Lights (by atomicstrykergrumpy) TenzinLib (by CommodoreThrawn) Nature's Compass (by Chaosyr) Library Ferret - Forge (by jtl_elisa) Cold Sweat (by Mikul) Simple Voice Chat (by henkelmax) Waystones (by BlayTheNinth) Carry On (by Tschipp) [Let's Do] Meadow (by satisfy) Creeper Overhaul (by joosh_7889) AutoRegLib (by Vazkii) Moonlight Lib (by MehVahdJukaar) AppleSkin (by squeek502) Xaero's World Map (by xaero96) Rotten Creatures (by fusionstudiomc) YUNG's API (Forge) (by YUNGNICKYOUNG) Village Artifacts (by Lothrazar) Right Click, Get Crops (by TeamCoFH) Supplementaries (by MehVahdJukaar) Automatic Tool Swap (by MelanX) Better Third Person (by Socolio) Supplementaries Squared (by plantspookable) Traveler's Backpack (by Tiviacz1337) Caelus API (Forge/NeoForge) (by TheIllusiveC4) Creatures and Beasts (by joosh_7889) Architectury API (Fabric/Forge/NeoForge) (by shedaniel) Quark Oddities (by Vazkii) Origins (Forge) (by EdwinMindcraft) Villager Names (by Serilum) GeckoLib (by Gecko) Realistic Bees (by Serilum) Illuminations Forge 🔥 (by dimadencep) Serene Seasons (by TheAdubbz) Critters and Companions (by joosh_7889) [Let's Do] Bakery (by satisfy) Falling Leaves (Forge) (by Cheaterpaul) Jade 🔍 (by Snownee) Collective (by Serilum) TerraBlender (Forge) (by TheAdubbz) [Let's Do] API (by Cristelknight) Towns and Towers (by Biban_Auriu) More Villagers (by SameDifferent) Biomes O' Plenty (by Forstride) Goblin Traders (by MrCrayfish) Corpse (by henkelmax) Tree Harvester (by Serilum) Balm (Forge Edition) (by BlayTheNinth) Mouse Tweaks (by YaLTeR) Sound Physics Remastered (by henkelmax) Xaero's Minimap (by xaero96) Just Enough Items (JEI) (by mezz) Terralith (by Starmute) Quark (by Vazkii) [Let's Do] Vinery (by satisfy) [Let's Do] Candlelight (by satisfy) Repurposed Structures (Neoforge/Forge) (by telepathicgrunt) Dusty Decorations (by flint_mischiff) Immersive Armors [Fabric/Forge] (by Conczin) Serene Seasons Fix (by Or_OS) Shutup Experimental Settings! (by Corgi_Taco) Skin Layers 3D (Fabric/Forge) (by tr7zw)
    • Make sure Java is running via Nvidia GPU https://windowsreport.com/minecraft-not-using-gpu/  
    • Also make a test with other Custom Launchers like AT Launcher, MultiMC or Technic Launcher
    • Embeddium and valkyrienskies are not working together - remove one of these mods With removing Embeddium, also remove Oculus, TexTrue's Embeddium Options and Embeddium Extras Or use Rubidium instead
  • Topics

×
×
  • Create New...

Important Information

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