Jump to content

[1.16.5]How to make this code run correctly on 1.16.5


byxiaobai_

Recommended Posts

package moe.plushie.armourers_workshop.client.model.armourer;

import net.minecraft.client.model.ModelBase;

import net.minecraft.client.renderer.model.ModelRenderer;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import org.lwjgl.opengl.GL11;

@OnlyIn(Dist.CLIENT)
public class ModelHead extends ModelBase {

    public static final ModelHead MODEL = new ModelHead();

    private ModelRenderer main;
    private ModelRenderer overlay;

    public ModelHead() {
        main = new ModelRenderer(this, 0, 0);
        main.addBox(-4F, -8F, -4F, 8, 8, 8);
        main.setRotationPoint(0, 0, 0);

        overlay = new ModelRenderer(this, 32, 0);
        overlay.addBox(-4F, -8F, -4F, 8, 8, 8, 0.5F);
        overlay.setRotationPoint(0F, 0F, 0F);
        overlay.setTextureSize(64, 32);
    }

    public void render(float scale, boolean showOverlay) {
        main.render(scale);
        if (showOverlay) {
            GL11.glDisable(GL11.GL_CULL_FACE);
            overlay.render(scale);
            GL11.glEnable(GL11.GL_CULL_FACE);
        }
    }
}

ModelBase seems to be replaced with EntityModel<T>, but I don’t know how to use it😵

Edited by byxiaobai_
Link to comment
Share on other sites

  • byxiaobai_ changed the title to [1.16.5]How to make this code run correctly on 1.16.5

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.