Jump to content

[1.8][Simple][Solved]Drawing single quad with TileEntitySpecialRenderer


FredTargaryen

Recommended Posts

I copied my working 1.7 code over to 1.8 and made the necessary changes to get rid of the errors, but in-game, the quad I want to draw just doesn't appear. Does anyone know what change I need to make?

Code:

@Override
    public void renderTileEntityAt(TileEntity te, double x, double z, double something, float somethingElse, int somethingElser)
    {
        ItemStack stack = ((TileEntityFloowerPot)te).getStackInSlot(0);
        if(stack != null && stack.stackSize > 0)
        {
            GL11.glPushMatrix();
            BlockPos pos = te.getPos();
            GL11.glTranslated(pos.getX(), pos.getY(), pos.getZ());
            Tessellator t = Tessellator.getInstance();
            WorldRenderer r = t.getWorldRenderer();
            r.startDrawingQuads();
            this.bindTexture(DataReference.powderRes);
            double level = (((float)stack.stackSize / 64) * 0.3125) + 0.0625;
            r.addVertexWithUV(0.625, level, 0.625, 1.0, 1.0);
            r.addVertexWithUV(0.625, level, 0.375, 1.0, 0.0);
            r.addVertexWithUV(0.375, level, 0.375, 0.0, 0.0);
            r.addVertexWithUV(0.375, level, 0.625, 0.0, 1.0);
            t.draw();
            GL11.glPopMatrix();
        }
    }
 

Thanks for reading.

Edited by FredTargaryen
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.