Posted November 20, 20177 yr 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:
November 21, 20177 yr Try things with lighting, like: GlStateManager.disableLighting(); Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(icon3, 0, 0); GlStateManager.enableLighting();
November 22, 20177 yr Try using RenderHelper.enableGuiStandardItemLighting() / RenderHelper.disableGuiStandardItemLighting(). Working example: https://github.com/TeamPneumatic/pnc-repressurized/blob/master/src/main/java/me/desht/pneumaticcraft/common/progwidgets/ProgWidgetItemFilter.java#L69-L84
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.