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.

RadioactiveStud

Members
  • Joined

  • Last visited

  1. @diesieben07 Removed all the gl stuff, didn't work. @Nephroid Will take a look. (For the record, I did do the static final, but I didn't copy it to this forum) Edit: Thanks for the examples. I understand a lot better now. I don't think it helps me with my problem though.
  2. That is very true . In my defence though, I wrote the function without the gl stuff but the color problem presented itself, and I asked someome helping me if they knew how to fix it. They did.
  3. I need the glColor because if I don't have it, the new GUI changes colors depending on other renders I added to the screen. I believe that I need to other gl stuff for the glColor to work.
  4. Oh that's slightly outdated code. GL11.glPushMatrix(); GL11.glEnable(GL11.GL_BLEND); GL11.glColor4f(1, 1, 1, 1); ResourceLocation r = new ResourceLocation(Reference.PREFIX + "textures/gui/armorBar.png"); res = new ScaledResolution(Minecraft.getMinecraft(), Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight); int x = (res.getScaledWidth() / 2) - 11; int y = res.getScaledHeight() - 49; switch(EventArmorTick.size) { case 1: Minecraft.getMinecraft().getTextureManager().bindTexture(r); Util.drawTexturedModalRect(x, y, 0, 0, 9, 9); break; } GL11.glDisable(GL11.GL_BLEND); GL11.glPopMatrix(); Here's drawTexturedModalRect. Pretty sure this is the same as the normal drawTexturedModalRect, I don't remember why I added it. public static void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { float f = 0.00390625F; float f1 = 0.00390625F; Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.addVertexWithUV((double)(par1 + 0), (double)(par2 + par6), 1D, (double)((float)(par3 + 0) * f), (double)((float)(par4 + par6) * f1)); tessellator.addVertexWithUV((double)(par1 + par5), (double)(par2 + par6), 1D, (double)((float)(par3 + par5) * f), (double)((float)(par4 + par6) * f1)); tessellator.addVertexWithUV((double)(par1 + par5), (double)(par2 + 0), 1D, (double)((float)(par3 + par5) * f), (double)((float)(par4 + 0) * f1)); tessellator.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), 1D, (double)((float)(par3 + 0) * f), (double)((float)(par4 + 0) * f1)); tessellator.draw(); }
  5. Oh, if I replace gui.drawArmor() with a drawString method like you did, it draws behind the chat. So it's not the event that's the problem it's drawArmor(). (drawArmor() can be seen in the OP)
  6. Well it's the exact same as shown but with the changed event. Do I need to change something? public void renderOverlay(RenderGameOverlayEvent.Post event){ if(event.isCanceled() || event.type != ElementType.EXPERIENCE) return; if((EventArmorTick.size != 0) && !Minecraft.getMinecraft().thePlayer.capabilities.isCreativeMode) { gui.drawArmor(); } }
  7. Basically what he is saying is that you need to do tileEntity = (TileEntityStoneCauldron) entity; instead of getting the TileEntity from the world.
  8. Put setLightLevel(1.0F); in the block's constructor.
  9. Using Pre was just a suggestion by someone helping me. I've also tried using Post.
  10. Okay so, kinda forgot about this, but what ever I tried, it didn't fix the problem. Tried ElementType.Armor and some others. Nothing worked. Tried RenderGameOverlayEvent.Pre with and without event.isCanceled() Am I doing something wrong? Using recommended (1230) forge by the way.
  11. I actually tried to do that earlier but I don't know how to set an ElementType.
  12. I figured that was the case. I just don't know what to change to fix that. The function is being called with the RenderGameOverlayEvent which is being called in the ClientProxy in the preInit.
  13. I have run forge and it works as expected. Server seems to work but I have not tested thoroughly.
  14. I have a working GUI that draws to the screen just fine, but it renders in front of the chat instead of behind. What should I do? Image: Code: GL11.glDisable(GL11.GL_BLEND); GL11.glColor4f(1, 1, 1, 1); ResourceLocation r = new ResourceLocation(Reference.PREFIX + "textures/gui/armorBar.png"); res = new ScaledResolution(Minecraft.getMinecraft(), Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight); int x = (res.getScaledWidth() / 2) - 11; int y = res.getScaledHeight() - 49; GL11.glPushMatrix(); Minecraft.getMinecraft().getTextureManager().bindTexture(r); Util.drawTexturedModalRect(x, y, 0, 0, 9, 9); GL11.glPopMatrix(); GL11.glDisable(GL11.GL_BLEND); I can show other code if you wish.

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.