Jump to content

Renders a TE with a moving case (like chests)


TheJavaNoob

Recommended Posts

The problem is that I am using a TESR to render but it still shows there error messages:

[15:58:16] [Client thread/ERROR] [FML]: Model definition for location containertest:testblock#facing=north not found
[15:58:16] [Client thread/ERROR] [FML]: Model definition for location containertest:testblock#facing=south not found
[15:58:16] [Client thread/ERROR] [FML]: Model definition for location containertest:testblock#facing=west not found
[15:58:16] [Client thread/ERROR] [FML]: Model definition for location containertest:testblock#facing=east not found

 

Link to comment
Share on other sites

  • 2 weeks later...
	public void doRender(TileEntityTestBlock entity,double posX, double posZ, double posY, float useless, int iDontKnowWhatsThis)
    {
        int facing;
        ModelTestBlock mdr=new ModelTestBlock();
        if (!entity.hasWorldObj())
        {
            facing = 0;
        }
        else
        {
            Block block = entity.getBlockType();
            facing = entity.getBlockMetadata();

            if (block instanceof TestBlock && facing == 0)
            {
                facing = entity.getBlockMetadata();
            }
        }
        this.bindTexture(texture);
        GlStateManager.pushMatrix();
        GlStateManager.enableRescaleNormal();

        if (iDontKnowWhatsThis < 0)
        {
            GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        }

        GlStateManager.translate((float)posX, (float)posZ, (float)posY + 1.0F);
        GlStateManager.scale(1.0F, -1.0F, -1.0F);
        GlStateManager.translate(0.5F, 0.5F, 0.5F);
        short rotation = 0;

        if (facing == 2)
        {
            rotation = 180;
        }

        if (facing == 3)
        {
            rotation = 0;
        }

        if (facing == 4)
        {
            rotation = 90;
        }

        if (facing == 5)
        {
            rotation = -90;
        }

        GlStateManager.rotate((float)rotation, 0.0F, 1.0F, 0.0F);
        GlStateManager.translate(-0.5F, -0.5F, -0.5F);
        float f1 = entity.caseAngle*9.0F;
//        f1 = 1.0F - f1;
//        f1 = 1.0F - f1 * f1 * f1;
        mdr.rechargerCase.rotateAngleY = f1;
        mdr.renderAll();
        GlStateManager.popMatrix();
//        if (iDontKnowWhatsThis >= 0)
//        {
//            GlStateManager.matrixMode(5890);
//            GlStateManager.popMatrix();
//            GlStateManager.matrixMode(5888);
//        }
        if(entity.getStackInSlot(0)!=null){
        	//Render the item
	        GlStateManager.pushMatrix();
	        Minecraft.getMinecraft().getRenderItem().renderItemModel(entity.getStackInSlot(0));
	        
	        GlStateManager.disableRescaleNormal();
	        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
	        GlStateManager.rotate(90.0F, 90.0F, 0.0F, 0.0F);
	        GlStateManager.translate((float)posX, (float)posZ, (float)posY + 1.0F);
	        GlStateManager.popMatrix();
        }
        
        

Mostly copied from chest renderer, no model files attached.

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.