Jump to content

[1.11] GuiScreen rendering Block in GUI is very dark compared to other items


Recommended Posts

Posted

Hey everyone,

So I am trying to render one of my ModBlocks on a custom GUIScreen. The problem is, I have it rendering, but it extremely dark in the GUI. Rendering items looks fine, but the block doesn't. I have tried using standard Minecraft blocks, such as stone or obsidian, but still the same thing. Here are the important bits of my code. (PICTURE BELOW)

@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
	drawDefaultBackground();
	super.drawScreen(mouseX, mouseY, partialTicks);
	ItemStack icon3 = new ItemStack(ModBlocks.tin_block);
    GlStateManager.pushMatrix();
    {
        GlStateManager.translate(centerX + guiWidth / 2 - 16, centerY + guiHeight / 2 + 24, 0);
        GlStateManager.scale(2, 2, 2);
        Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(icon3, 0, 0);
    }
    GlStateManager.popMatrix();
	drawTooltip(icon3.getTooltip(mc.player, false), mouseX, mouseY, centerX, centerY + 40, 16, 16, guiWidth, guiHeight);
}

private void drawTooltip(List<String> tooltip, int mouseX, int mouseY, int posX, int posY, int itemWidth, int itemHeight, int guiWidth, int guiHeight){
        if(mouseX >= posX + guiWidth / 2 - itemWidth && mouseX <= posX + guiWidth / 2 + itemWidth && mouseY >= posY + guiHeight / 2 - itemHeight && mouseY <= posY + guiHeight / 2 + itemHeight) {
            drawHoveringText(tooltip, mouseX, mouseY);
        }
    }

(Indents messed up...)

Picture:

3HsZ9hV.png

Posted

Try things with lighting, like:

 

GlStateManager.disableLighting();

Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(icon3, 0, 0);

GlStateManager.enableLighting();

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.