Jump to content

Item rendering over item count even when called before the text.


CosmicKid

Recommended Posts

public void render(MatrixStack stack, int mouseX, int mouseY, float partialTicks) {
        renderBg(stack, partialTicks, mouseX, mouseY);
        renderSlots(stack);
        renderCursorSlot(stack, mouseX, mouseY);
        renderLabels(stack, mouseX, mouseY);
        renderTooltip(stack, mouseX, mouseY);
    }

    public void renderSlots(MatrixStack stack) {
        int x = (this.width - this.imageWidth) / 2;
        int y = (this.height - this.imageHeight) / 2;

        for(Slot slot : container.slots) {
            super.itemRenderer.renderGuiItem(slot.getItem(), slot.x + x, slot.y + y);
            if(!slot.getItem().isEmpty() && !(slot.getItem().getCount() == 1)) {
                this.font.draw(stack, Integer.toString(slot.getItem().getCount()), slot.x + x + 8, slot.y + y + 8, 0xffffff);
            }
        }
    }

For some reason, it seems like the item renderer goes after the font draw even though it's called before. Any idea what's going on?

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.