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.

Featured Replies

Posted

So i am making a client atm and i want to have a transparent rainbow in my GuiInventory but idk how to make it transparent heres the GuiInventory code i have at the moment help would be apprciated 

Spoiler

package net.minecraft.src;

import java.awt.Color;
import java.util.List;
import me.darkmagician6.morbid.gui.ColorUtil;
import me.darkmagician6.morbid.gui.Wrapper;
import me.darkmagician6.morbid.util.R2DUtils;
import net.minecraft.client.Minecraft;
import org.lwjgl.opengl.GL11;

public class GuiInventory
  extends InventoryEffectRenderer
{
  private float xSize_lo;
  private float ySize_lo;
  int alpha = 127;
  
  public GuiInventory(EntityPlayer par1EntityPlayer)
  {
    super(par1EntityPlayer.inventoryContainer);
    this.allowUserInput = true;
    par1EntityPlayer.addStat(AchievementList.openInventory, 1);
  }
  
  public void updateScreen()
  {
    if (this.mc.playerController.isInCreativeMode()) {
      this.mc.displayGuiScreen(new GuiContainerCreative(Minecraft.thePlayer));
    }
  }
  
  public void initGui()
  {
    this.buttonList.clear();
    if (this.mc.playerController.isInCreativeMode()) {
      this.mc.displayGuiScreen(new GuiContainerCreative(Minecraft.thePlayer));
    } else {
      super.initGui();
    }
  }
  
  protected void drawGuiContainerForegroundLayer(int par1, int par2)
  {
    this.fontRenderer.drawString(StatCollector.translateToLocal("N1kZz"), 86, 64, ColorUtil.rainbow(2.0E8D, 1.0F).getRGB());
  }
  
  public void drawScreen(int par1, int par2, float par3)
  {
    super.drawScreen(par1, par2, par3);
    this.xSize_lo = par1;
    this.ySize_lo = par2;
  }
  
  protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
  {
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.renderEngine.bindTexture("/gui/inventory.png");
    int var4 = this.guiLeft;
    int var5 = this.guiTop;
    drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize);
    drawPlayerOnGui(this.mc, var4 + 51, var5 + 75, 30, var4 + 51 - this.xSize_lo, var5 + 75 - 50 - this.ySize_lo);
  }
  
  public static void drawPlayerOnGui(Minecraft par0Minecraft, int par1, int par2, int par3, float par4, float par5)
  {
      
    GL11.glEnable(2903);
    GL11.glPushMatrix();
    GL11.glTranslatef(par1, par2, 50.0F);
    GL11.glScalef(-par3, par3, par3);
    GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
    float var6 = Minecraft.thePlayer.renderYawOffset;
    float var7 = Minecraft.thePlayer.rotationYaw;
    float var8 = Minecraft.thePlayer.rotationPitch;
    GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F);
    RenderHelper.enableStandardItemLighting();
    GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F);
    GL11.glRotatef(-(float)Math.atan(par5 / 40.0F) * 20.0F, 1.0F, 0.0F, 0.0F);
    Minecraft.thePlayer.renderYawOffset = ((float)Math.atan(par4 / 40.0F) * 20.0F);
    Minecraft.thePlayer.rotationYaw = ((float)Math.atan(par4 / 40.0F) * 40.0F);
    Minecraft.thePlayer.rotationPitch = (-(float)Math.atan(par5 / 40.0F) * 20.0F);
    Minecraft.thePlayer.rotationYawHead = Minecraft.thePlayer.rotationYaw;
    GL11.glTranslatef(0.0F, Minecraft.thePlayer.yOffset, 0.0F);
    RenderManager.instance.playerViewY = 180.0F;
    RenderManager.instance.renderEntityWithPosYaw(Minecraft.thePlayer, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F);
    Minecraft.thePlayer.renderYawOffset = var6;
    Minecraft.thePlayer.rotationYaw = var7;
    Minecraft.thePlayer.rotationPitch = var8;
    GL11.glPopMatrix();
    RenderHelper.disableStandardItemLighting();
    GL11.glDisable(32826);
    OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
    GL11.glDisable(3553);
    OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
      GL11.glEnable(GL11.GL_BLEND);
      GL11.glDisable(GL11.GL_DEPTH_TEST);
      GL11.glDepthMask(false);
      GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      GL11.glDisable(GL11.GL_ALPHA_TEST);
      R2DUtils.drawRect(var6 /4 - 1500, (float)(Wrapper.getScreenHeight() -5 ), var6 / 4 + 1500, Wrapper.getScreenHeight(), ColorUtil.rainbow(2.0E8D, 1.0F ).getRGB());

  }
  
  protected void actionPerformed(GuiButton par1GuiButton)
  {
    if (par1GuiButton.id == 0) {
      this.mc.displayGuiScreen(new GuiAchievements(this.mc.statFileWriter));
    }
    if (par1GuiButton.id == 1) {
      this.mc.displayGuiScreen(new GuiStats(this, this.mc.statFileWriter));
    }
  }
}

 

1.5.2 is no longer supported on this forum. Please update if you want help.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

  • Guest locked this topic
Guest
This topic is now closed to further replies.

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.