Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

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

Featured Replies

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

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...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.