public static void drawPlayerOnGui(
     Minecraft par0Minecraft, int par1, int par2, int par3, float par4, float par5) {
   GL11.glEnable(GL11.GL_COLOR_MATERIAL);
   GL11.glPushMatrix();
   GL11.glTranslatef((float) par1, (float) par2, 50.0F);
   GL11.glScalef((float) (-par3), (float) par3, (float) par3);
   GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
   float f2 = par0Minecraft.thePlayer.renderYawOffset;
   float f3 = par0Minecraft.thePlayer.rotationYaw;
   float f4 = par0Minecraft.thePlayer.rotationPitch;
   par4 -= 19;
   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((double) (par5 / 40.0F))) * 20.0F, 1.0F, 0.0F, 0.0F);
   par0Minecraft.thePlayer.renderYawOffset = (float) Math.atan((double) (par4 / 40.0F)) * 20.0F;
   par0Minecraft.thePlayer.rotationYaw = (float) Math.atan((double) (par4 / 40.0F)) * 40.0F;
   par0Minecraft.thePlayer.rotationPitch = -((float) Math.atan((double) (par5 / 40.0F))) * 20.0F;
   par0Minecraft.thePlayer.rotationYawHead = par0Minecraft.thePlayer.rotationYaw;
   GL11.glTranslatef(0.0F, par0Minecraft.thePlayer.yOffset, 0.0F);
   RenderManager.instance.playerViewY = 180.0F;
   RenderManager.instance.renderEntityWithPosYaw(
       par0Minecraft.thePlayer, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F);
   par0Minecraft.thePlayer.renderYawOffset = f2;
   par0Minecraft.thePlayer.rotationYaw = f3;
   par0Minecraft.thePlayer.rotationPitch = f4;
   GL11.glPopMatrix();
   RenderHelper.disableStandardItemLighting();
   GL11.glDisable(GL12.GL_RESCALE_NORMAL);
   OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
   GL11.glDisable(GL11.GL_TEXTURE_2D);
   OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
 }
Esempio n. 2
0
  protected void func_180479_a(ScaledResolution p_180479_1_, float p_180479_2_) {
    if (this.mc.func_175606_aa() instanceof EntityPlayer) {
      GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
      this.mc.getTextureManager().bindTexture(widgetsTexPath);
      EntityPlayer var3 = (EntityPlayer) this.mc.func_175606_aa();
      int var4 = p_180479_1_.getScaledWidth() / 2;
      float var5 = this.zLevel;
      this.zLevel = -90.0F;
      this.drawTexturedModalRect(var4 - 91, p_180479_1_.getScaledHeight() - 22, 0, 0, 182, 22);
      this.drawTexturedModalRect(
          var4 - 91 - 1 + var3.inventory.currentItem * 20,
          p_180479_1_.getScaledHeight() - 22 - 1,
          0,
          22,
          24,
          22);
      this.zLevel = var5;
      GlStateManager.enableRescaleNormal();
      GlStateManager.enableBlend();
      GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
      RenderHelper.enableGUIStandardItemLighting();

      for (int var6 = 0; var6 < 9; ++var6) {
        int var7 = p_180479_1_.getScaledWidth() / 2 - 90 + var6 * 20 + 2;
        int var8 = p_180479_1_.getScaledHeight() - 16 - 3;
        this.func_175184_a(var6, var7, var8, p_180479_2_, var3);
      }

      RenderHelper.disableStandardItemLighting();
      GlStateManager.disableRescaleNormal();
      GlStateManager.disableBlend();
    }
  }
  @Override
  public void renderTileEntityAt(TileEntity t, double x, double y, double z, float pt) {
    Block blockType = t.getBlockType();

    Tessellator tes = Tessellator.instance;
    tes.setColorOpaque_F(1.0F, 1.0F, 1.0F);

    renderBlocks.blockAccess = t.getWorldObj();

    {
      if (Minecraft.isAmbientOcclusionEnabled()) {
        GL11.glShadeModel(GL11.GL_SMOOTH);
      } else {
        GL11.glShadeModel(GL11.GL_FLAT);
      }
      RenderHelper.disableStandardItemLighting();

      RenderUtils.loadTexture(TextureMap.locationBlocksTexture);

      tes.startDrawingQuads();
      tes.setTranslation(x - t.xCoord, y - t.yCoord, z - t.zCoord);

      renderBlocks.renderBlockAllFaces(blockType, t.xCoord, t.yCoord, t.zCoord);
      tes.setTranslation(0, 0, 0);
      tes.draw();

      RenderHelper.enableStandardItemLighting();
    }
  }
  @SideOnly(Side.CLIENT)
  @Override
  public void renderHUD(Minecraft mc, ScaledResolution res) {
    super.renderHUD(mc, res);

    IBlockState filter = getUnderlyingBlock();
    ItemStack recieverStack =
        new ItemStack(
            Item.getItemFromBlock(filter.getBlock()),
            1,
            filter.getBlock().getMetaFromState(filter));
    int color = getColor();

    GlStateManager.enableBlend();
    GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    if (recieverStack.getItem() != null) {
      String stackName = recieverStack.getDisplayName();
      int width = 16 + mc.fontRendererObj.getStringWidth(stackName) / 2;
      int x = res.getScaledWidth() / 2 - width;
      int y = res.getScaledHeight() / 2 + 30;

      mc.fontRendererObj.drawStringWithShadow(stackName, x + 20, y + 5, color);
      RenderHelper.enableGUIStandardItemLighting();
      mc.getRenderItem().renderItemAndEffectIntoGUI(recieverStack, x, y);
      RenderHelper.disableStandardItemLighting();
    }

    GlStateManager.disableLighting();
    GlStateManager.disableBlend();
  }
 protected void func_74190_a(String p_74190_1_, int p_74190_2_, int p_74190_3_) {
   GL11.glDisable('\u803a');
   RenderHelper.func_74518_a();
   GL11.glDisable(2896);
   GL11.glDisable(2929);
   int var4 = this.field_73886_k.func_78256_a(p_74190_1_);
   int var5 = p_74190_2_ + 12;
   int var6 = p_74190_3_ - 12;
   byte var8 = 8;
   this.field_73735_i = 300.0F;
   field_74196_a.field_77023_b = 300.0F;
   int var9 = -267386864;
   this.func_73733_a(var5 - 3, var6 - 4, var5 + var4 + 3, var6 - 3, var9, var9);
   this.func_73733_a(var5 - 3, var6 + var8 + 3, var5 + var4 + 3, var6 + var8 + 4, var9, var9);
   this.func_73733_a(var5 - 3, var6 - 3, var5 + var4 + 3, var6 + var8 + 3, var9, var9);
   this.func_73733_a(var5 - 4, var6 - 3, var5 - 3, var6 + var8 + 3, var9, var9);
   this.func_73733_a(var5 + var4 + 3, var6 - 3, var5 + var4 + 4, var6 + var8 + 3, var9, var9);
   int var10 = 1347420415;
   int var11 = (var10 & 16711422) >> 1 | var10 & -16777216;
   this.func_73733_a(var5 - 3, var6 - 3 + 1, var5 - 3 + 1, var6 + var8 + 3 - 1, var10, var11);
   this.func_73733_a(
       var5 + var4 + 2, var6 - 3 + 1, var5 + var4 + 3, var6 + var8 + 3 - 1, var10, var11);
   this.func_73733_a(var5 - 3, var6 - 3, var5 + var4 + 3, var6 - 3 + 1, var10, var10);
   this.func_73733_a(var5 - 3, var6 + var8 + 2, var5 + var4 + 3, var6 + var8 + 3, var11, var11);
   this.field_73886_k.func_78261_a(p_74190_1_, var5, var6, -1);
   this.field_73735_i = 0.0F;
   field_74196_a.field_77023_b = 0.0F;
   GL11.glEnable(2896);
   GL11.glEnable(2929);
   RenderHelper.func_74519_b();
   GL11.glEnable('\u803a');
 }
  @SideOnly(Side.CLIENT)
  public static void renderItem(GuiScreen gui, ItemStack stack, int x, int y, float scale) {
    GL11.glPushMatrix();
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    RenderHelper.enableGUIStandardItemLighting();
    GL11.glEnable(GL11.GL_DEPTH_TEST);
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    GL11.glTranslated(x, y, 0);
    GL11.glScalef(scale, scale, scale);

    boolean flagBefore = gui.mc.fontRenderer.getUnicodeFlag();
    gui.mc.fontRenderer.setUnicodeFlag(false);
    RenderItem.getInstance()
        .renderItemAndEffectIntoGUI(gui.mc.fontRenderer, gui.mc.getTextureManager(), stack, 0, 0);
    RenderItem.getInstance()
        .renderItemOverlayIntoGUI(gui.mc.fontRenderer, gui.mc.getTextureManager(), stack, 0, 0);
    gui.mc.fontRenderer.setUnicodeFlag(flagBefore);

    // GL+MC+NEI suck
    if (gui instanceof GuiBooklet) {
      RenderHelper.disableStandardItemLighting();
    }
    GL11.glPopMatrix();
  }
 public void drawPlayerOnGui(
     Minecraft par0Minecraft, int par1, int par2, int par3, float par4, float par5) {
   final float pitchBefore = par0Minecraft.thePlayer.rotationPitch;
   GL11.glEnable(GL11.GL_COLOR_MATERIAL);
   GL11.glPushMatrix();
   GL11.glTranslatef(par1, par2, 50.0F);
   GL11.glScalef(-par3, par3, par3);
   GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
   final float var6 = par0Minecraft.thePlayer.renderYawOffset;
   final float var7 = par0Minecraft.thePlayer.rotationYaw;
   final float var8 = par0Minecraft.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(this.rotation / 40.0F)) * 00.0F, 1.0F, 0.0F, 0.0F);
   par0Minecraft.thePlayer.renderYawOffset = this.rotation;
   par0Minecraft.thePlayer.rotationYaw = this.rotation;
   par0Minecraft.thePlayer.rotationPitch = 0;
   par0Minecraft.thePlayer.rotationYawHead = par0Minecraft.thePlayer.rotationYaw;
   GL11.glTranslatef(0.0F, par0Minecraft.thePlayer.yOffset, 0.0F);
   RenderManager.instance.playerViewY = 180.0F;
   RenderManager.instance.renderEntityWithPosYaw(
       par0Minecraft.thePlayer, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F);
   par0Minecraft.thePlayer.renderYawOffset = var6;
   par0Minecraft.thePlayer.rotationYaw = var7;
   //        par0Minecraft.thePlayer.rotationPitch = var8;
   GL11.glPopMatrix();
   RenderHelper.disableStandardItemLighting();
   GL11.glDisable(GL12.GL_RESCALE_NORMAL);
   OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
   GL11.glDisable(GL11.GL_TEXTURE_2D);
   OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
   par0Minecraft.thePlayer.rotationPitch = pitchBefore;
 }
  @Override
  public void renderTileEntityAt(TileEntity var1, double xd, double yd, double zd, float partial) {
    SculptureEntity se = (SculptureEntity) var1;

    RenderHelper.disableStandardItemLighting();
    GL11.glShadeModel(GL11.GL_SMOOTH);
    GL11.glEnable(GL11.GL_BLEND);
    OpenGlHelper.glBlendFunc(770, 771, 1, 0);

    if (!se.getRender().ready() && !se.getRender().hasContext()) {

      int lightX = (int) (OpenGlHelper.lastBrightnessX);
      int lightY = (int) (OpenGlHelper.lastBrightnessY);
      int light = lightY * 65536 + lightX;

      se.getRender().initFromSculptureAndLight(se.sculpture(), light);
    } else se.updateRender();

    GL11.glPushMatrix();
    GL11.glTranslated(xd, yd, zd);
    GL11.glCallList(se.getRender().glDisplayList);
    GL11.glPopMatrix();

    GL11.glDisable(GL11.GL_BLEND);
    GL11.glShadeModel(GL11.GL_FLAT);
    RenderHelper.enableStandardItemLighting();
  }
Esempio n. 9
0
 @Override
 protected void drawSlot(int id, int x, int y, int var4, int var5, int var6) {
   Block block = blocks.get(id);
   ItemStack itemStack = new ItemStack(Item.getItemFromBlock(block));
   GlStateManager.enableRescaleNormal();
   GlStateManager.enableBlend();
   RenderHelper.enableGUIStandardItemLighting();
   GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
   if (itemStack.getItem() != null)
     try {
       Minecraft.getMinecraft()
           .getRenderItem()
           .renderItemAndEffectIntoGUI(itemStack, x + 4, y + 4);
     } catch (Exception e) {
       e.printStackTrace();
     }
   else mc.fontRendererObj.drawString("?", x + 10, y + 9, 10526880);
   Minecraft.getMinecraft()
       .getRenderItem()
       .func_175030_a(Minecraft.getMinecraft().fontRendererObj, itemStack, x + 4, y + 4);
   RenderHelper.disableStandardItemLighting();
   GlStateManager.disableRescaleNormal();
   GlStateManager.disableBlend();
   glDisable(GL_LIGHTING);
   mc.fontRendererObj.drawString(
       "Name: "
           + (itemStack.getItem() == null ? block.getLocalizedName() : itemStack.getDisplayName()),
       x + 31,
       y + 3,
       10526880);
   int blockID = Block.getIdFromBlock(block);
   mc.fontRendererObj.drawString("ID: " + blockID, x + 31, y + 15, 10526880);
 }
  @Override
  public void drawScreen(int x, int y, float par3) {
    super.drawScreen(x, y, par3);

    MerchantRecipeList recipes = this.villager.getRecipes(this.mc.thePlayer);
    if ((recipes != null) && !(recipes.isEmpty())) {
      int xCenter = (this.width - this.xSize) / 2;
      int yCenter = (this.height - this.ySize) / 2;

      MerchantRecipe recipe = (MerchantRecipe) recipes.get(this.currentRecipeIndex);

      ItemStack[] slot = new ItemStack[3];
      slot[0] = recipe.getItemToBuy();
      slot[1] = recipe.getSecondItemToBuy();
      slot[2] = recipe.getItemToSell();

      GL11.glPushMatrix();
      GL11.glPushAttrib(GL11.GL_ENABLE_BIT);

      RenderHelper.enableGUIStandardItemLighting();

      GL11.glEnable(GL12.GL_RESCALE_NORMAL);

      itemRender.zLevel = 100;
      itemRender.renderItemAndEffectIntoGUI(
          this.fontRendererObj, this.mc.renderEngine, slot[0], xCenter + 36, yCenter + 24);
      itemRender.renderItemOverlayIntoGUI(
          this.fontRendererObj, this.mc.renderEngine, slot[0], xCenter + 36, yCenter + 24);

      if (slot[1] != null) {
        itemRender.renderItemAndEffectIntoGUI(
            this.fontRendererObj, this.mc.renderEngine, slot[1], xCenter + 62, yCenter + 24);
        itemRender.renderItemOverlayIntoGUI(
            this.fontRendererObj, this.mc.renderEngine, slot[1], xCenter + 62, yCenter + 24);
      }

      itemRender.renderItemAndEffectIntoGUI(
          this.fontRendererObj, this.mc.renderEngine, slot[2], xCenter + 120, yCenter + 24);
      itemRender.renderItemOverlayIntoGUI(
          this.fontRendererObj, this.mc.renderEngine, slot[2], xCenter + 120, yCenter + 24);

      itemRender.zLevel = 0;

      GL11.glDisable(GL11.GL_LIGHTING);

      if (this.func_146978_c(36, 24, 16, 16, x, y)) {
        this.renderToolTip(slot[0], x, y);
      } else if ((slot[1] != null) && this.func_146978_c(62, 24, 16, 16, x, y)) {
        this.renderToolTip(slot[1], x, y);
      } else if (this.func_146978_c(120, 24, 16, 16, x, y)) {
        this.renderToolTip(slot[2], x, y);
      }

      RenderHelper.enableStandardItemLighting();

      GL11.glPopAttrib();
      GL11.glPopMatrix();
    }
  }
Esempio n. 11
0
  public static void fixLighting() {
    lighting = !lighting;

    if (lighting) {
      RenderHelper.enableGUIStandardItemLighting();
    } else {
      RenderHelper.disableStandardItemLighting();
    }
  }
    public void renderAll() {
      RenderHelper.disableStandardItemLighting();
      fire.render(0.0625F);
      RenderHelper.enableStandardItemLighting();

      stick.render(0.0625F);
      fuel.render(0.0625F);
      cookingItem.render(0.0625F);
    }
Esempio n. 13
0
 private void drawStatsScreen(int p_146521_1_, int p_146521_2_, Item p_146521_3_) {
   this.drawButtonBackground(p_146521_1_ + 1, p_146521_2_ + 1);
   GlStateManager.enableRescaleNormal();
   RenderHelper.enableGUIStandardItemLighting();
   this.itemRender.func_175042_a(
       new ItemStack(p_146521_3_, 1, 0), p_146521_1_ + 2, p_146521_2_ + 2);
   RenderHelper.disableStandardItemLighting();
   GlStateManager.disableRescaleNormal();
 }
Esempio n. 14
0
  /** Renders the animation for when an enderdragon dies */
  protected void renderDragonDying(EntityDragonBoss par1entitydragonboss, float par2) {
    super.renderEquippedItems(par1entitydragonboss, par2);
    Tessellator tessellator = Tessellator.instance;

    if (par1entitydragonboss.deathTicks > 0) {
      RenderHelper.disableStandardItemLighting();
      float f1 = (par1entitydragonboss.deathTicks + par2) / 200.0F;
      float f2 = 0.0F;

      if (f1 > 0.8F) {
        f2 = (f1 - 0.8F) / 0.2F;
      }

      Random random = new Random(432L);
      GL11.glDisable(GL11.GL_TEXTURE_2D);
      GL11.glShadeModel(GL11.GL_SMOOTH);
      GL11.glEnable(GL11.GL_BLEND);
      GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
      GL11.glDisable(GL11.GL_ALPHA_TEST);
      GL11.glEnable(GL11.GL_CULL_FACE);
      GL11.glDepthMask(false);
      GL11.glPushMatrix();
      GL11.glTranslatef(0.0F, -1.0F, -2.0F);

      for (int i = 0; i < (f1 + f1 * f1) / 2.0F * 60.0F; ++i) {
        GL11.glRotatef(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);
        GL11.glRotatef(random.nextFloat() * 360.0F, 0.0F, 0.0F, 1.0F);
        GL11.glRotatef(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);
        GL11.glRotatef(random.nextFloat() * 360.0F + f1 * 90.0F, 0.0F, 0.0F, 1.0F);
        tessellator.startDrawing(6);
        float f3 = random.nextFloat() * 20.0F + 5.0F + f2 * 10.0F;
        float f4 = random.nextFloat() * 2.0F + 1.0F + f2 * 2.0F;
        tessellator.setColorRGBA_I(16777215, (int) (255.0F * (1.0F - f2)));
        tessellator.addVertex(0.0D, 0.0D, 0.0D);
        tessellator.setColorRGBA_I(16711935, 0);
        tessellator.addVertex(-0.866D * f4, f3, -0.5F * f4);
        tessellator.addVertex(0.866D * f4, f3, -0.5F * f4);
        tessellator.addVertex(0.0D, f3, 1.0F * f4);
        tessellator.addVertex(-0.866D * f4, f3, -0.5F * f4);
        tessellator.draw();
      }

      GL11.glPopMatrix();
      GL11.glDepthMask(true);
      GL11.glDisable(GL11.GL_CULL_FACE);
      GL11.glDisable(GL11.GL_BLEND);
      GL11.glShadeModel(GL11.GL_FLAT);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      GL11.glEnable(GL11.GL_TEXTURE_2D);
      GL11.glEnable(GL11.GL_ALPHA_TEST);
      RenderHelper.enableStandardItemLighting();
    }
  }
Esempio n. 15
0
  /** Draws the screen and all the components in it. */
  @Override
  public void drawScreen(int par1, int par2, float par3) {

    super.drawScreen(par1, par2, par3);
    MerchantRecipeList var4 = this.recordList;

    if (var4 != null && !var4.isEmpty()) {
      int var5 = (this.width - this.xSize) / 2;
      int var6 = (this.height - this.ySize) / 2;
      int var7 = this.currentRecipeIndex;
      MerchantRecipe var8 = (MerchantRecipe) var4.get(var7);
      GL11.glPushMatrix();
      ItemStack var9 = var8.getItemToBuy();
      ItemStack var10 = var8.getSecondItemToBuy();
      ItemStack var11 = var8.getItemToSell();
      RenderHelper.enableGUIStandardItemLighting();
      GL11.glDisable(GL11.GL_LIGHTING);
      GL11.glEnable(GL12.GL_RESCALE_NORMAL);
      GL11.glEnable(GL11.GL_COLOR_MATERIAL);
      GL11.glEnable(GL11.GL_LIGHTING);
      GuiContainer.itemRenderer.zLevel = 100.0F;
      GuiContainer.itemRenderer.renderItemAndEffectIntoGUI(
          this.fontRenderer, this.mc.renderEngine, var9, var5 + 36, var6 + 24);
      GuiContainer.itemRenderer.renderItemOverlayIntoGUI(
          this.fontRenderer, this.mc.renderEngine, var9, var5 + 36, var6 + 24);

      if (var10 != null) {
        GuiContainer.itemRenderer.renderItemAndEffectIntoGUI(
            this.fontRenderer, this.mc.renderEngine, var10, var5 + 62, var6 + 24);
        GuiContainer.itemRenderer.renderItemOverlayIntoGUI(
            this.fontRenderer, this.mc.renderEngine, var10, var5 + 62, var6 + 24);
      }

      GuiContainer.itemRenderer.renderItemAndEffectIntoGUI(
          this.fontRenderer, this.mc.renderEngine, var11, var5 + 120, var6 + 24);
      GuiContainer.itemRenderer.renderItemOverlayIntoGUI(
          this.fontRenderer, this.mc.renderEngine, var11, var5 + 120, var6 + 24);
      GuiContainer.itemRenderer.zLevel = 0.0F;
      GL11.glDisable(GL11.GL_LIGHTING);

      if (this.isPointInRegion(36, 24, 16, 16, par1, par2)) {
        this.drawItemStackTooltip(var9, par1, par2);
      } else if (var10 != null && this.isPointInRegion(62, 24, 16, 16, par1, par2)) {
        this.drawItemStackTooltip(var10, par1, par2);
      } else if (this.isPointInRegion(120, 24, 16, 16, par1, par2)) {
        this.drawItemStackTooltip(var11, par1, par2);
      }

      GL11.glPopMatrix();
      GL11.glEnable(GL11.GL_LIGHTING);
      GL11.glEnable(GL11.GL_DEPTH_TEST);
      RenderHelper.enableStandardItemLighting();
    }
  }
  private void drawItemStack(int x, int y, ItemStack itemStack) {
    drawItemStackSlot(x, y);

    if (itemStack != null && Item.itemsList[itemStack.itemID] != null) {
      GL11.glEnable(GL12.GL_RESCALE_NORMAL);
      RenderHelper.enableGUIStandardItemLighting();
      Settings.renderItem.renderItemIntoGUI(
          this.fontRenderer, this.renderEngine, itemStack, x + 2, y + 2);
      RenderHelper.disableStandardItemLighting();
      GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    }
  }
Esempio n. 17
0
  @SideOnly(Side.CLIENT)
  public void renderItem(
      IGuiLexiconEntry gui, int xPos, int yPos, ItemStack stack, boolean accountForContainer) {
    RenderItem render = new RenderItem();
    boolean mouseDown = Mouse.isButtonDown(0);

    GL11.glPushMatrix();
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    RenderHelper.enableGUIStandardItemLighting();
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    GL11.glEnable(GL11.GL_DEPTH_TEST);
    render.renderItemAndEffectIntoGUI(
        Minecraft.getMinecraft().fontRenderer,
        Minecraft.getMinecraft().getTextureManager(),
        stack,
        xPos,
        yPos);
    render.renderItemOverlayIntoGUI(
        Minecraft.getMinecraft().fontRenderer,
        Minecraft.getMinecraft().getTextureManager(),
        stack,
        xPos,
        yPos);
    RenderHelper.disableStandardItemLighting();
    GL11.glPopMatrix();

    if (relativeMouseX >= xPos
        && relativeMouseY >= yPos
        && relativeMouseX <= xPos + 16
        && relativeMouseY <= yPos + 16) {
      tooltipStack = stack;

      EntryData data = LexiconRecipeMappings.getDataForStack(tooltipStack);
      if (data != null && (data.entry != gui.getEntry() || data.page != gui.getPageOn())) {
        tooltipEntry = true;

        if (!mouseDownLastTick && mouseDown && GuiScreen.isShiftKeyDown()) {
          GuiLexiconEntry newGui = new GuiLexiconEntry(data.entry, (GuiScreen) gui);
          newGui.page = data.page;
          Minecraft.getMinecraft().displayGuiScreen(newGui);
        }
      }

      if (accountForContainer) {
        ItemStack containerStack = stack.getItem().getContainerItem(stack);
        if (containerStack != null && containerStack.getItem() != null)
          tooltipContainerStack = containerStack;
      }
    }

    GL11.glDisable(GL11.GL_LIGHTING);
  }
Esempio n. 18
0
 private void func_74137_c(int p_74137_1_, int p_74137_2_, int p_74137_3_) {
   this.func_74142_b(p_74137_1_ + 1, p_74137_2_ + 1);
   GL11.glEnable('\u803a');
   RenderHelper.func_74520_c();
   field_74152_c.func_77015_a(
       this.field_73886_k,
       this.field_73882_e.field_71446_o,
       new ItemStack(p_74137_3_, 1, 0),
       p_74137_1_ + 2,
       p_74137_2_ + 2);
   RenderHelper.func_74518_a();
   GL11.glDisable('\u803a');
 }
  public void drawScreen(int par1, int par2, float par3) {
    super.drawScreen(par1, par2, par3);
    Minecraft mc = Minecraft.getMinecraft();
    MerchantRecipeList merchantrecipelist = this.theIMerchant.getRecipes(mc.thePlayer);
    if (merchantrecipelist != null && !merchantrecipelist.isEmpty()) {
      int k = (super.width - super.xSize) / 2;
      int l = (super.height - super.ySize) / 2;
      int i1 = this.currentRecipeIndex;
      MerchantRecipe merchantrecipe = (MerchantRecipe) merchantrecipelist.get(i1);
      GL11.glPushMatrix();
      ItemStack itemstack = merchantrecipe.getItemToBuy();
      ItemStack itemstack1 = merchantrecipe.getSecondItemToBuy();
      ItemStack itemstack2 = merchantrecipe.getItemToSell();
      RenderHelper.enableGUIStandardItemLighting();
      GL11.glDisable(2896);
      GL11.glEnable('\u803a');
      GL11.glEnable(2903);
      GL11.glEnable(2896);
      GuiScreen.itemRender.zLevel = 100.0F;
      GuiScreen.itemRender.renderItemAndEffectIntoGUI(
          super.fontRendererObj, mc.getTextureManager(), itemstack, k + 36, l + 24);
      GuiScreen.itemRender.renderItemOverlayIntoGUI(
          super.fontRendererObj, mc.getTextureManager(), itemstack, k + 36, l + 24);
      if (itemstack1 != null) {
        GuiScreen.itemRender.renderItemAndEffectIntoGUI(
            super.fontRendererObj, mc.getTextureManager(), itemstack1, k + 62, l + 24);
        GuiScreen.itemRender.renderItemOverlayIntoGUI(
            super.fontRendererObj, mc.getTextureManager(), itemstack1, k + 62, l + 24);
      }

      GuiScreen.itemRender.renderItemAndEffectIntoGUI(
          super.fontRendererObj, mc.getTextureManager(), itemstack2, k + 120, l + 24);
      GuiScreen.itemRender.renderItemOverlayIntoGUI(
          super.fontRendererObj, mc.getTextureManager(), itemstack2, k + 120, l + 24);
      GuiScreen.itemRender.zLevel = 0.0F;
      GL11.glDisable(2896);
      if (this.isPointInRegion(36, 24, 16, 16, par1, par2)) {
        this.renderToolTip(itemstack, par1, par2);
      } else if (itemstack1 != null && this.isPointInRegion(62, 24, 16, 16, par1, par2)) {
        this.renderToolTip(itemstack1, par1, par2);
      } else if (this.isPointInRegion(120, 24, 16, 16, par1, par2)) {
        this.renderToolTip(itemstack2, par1, par2);
      }

      GL11.glPopMatrix();
      GL11.glEnable(2896);
      GL11.glEnable(2929);
      RenderHelper.enableStandardItemLighting();
    }
  }
Esempio n. 20
0
    @Override
    public void draw(int startX, int startY) {
      GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
      GL11.glDisable(GL11.GL_LIGHTING);
      GL11.glEnable(GL11.GL_DEPTH_TEST);
      RenderHelper.enableGUIStandardItemLighting();
      OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240, 240);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

      ItemStack output = getOutputStack();
      if (output != null) manager.gui.drawItemStack(output, startX + xPos, startY + yPos);
      // RenderHelper.disableStandardItemLighting();

      GL11.glDisable(GL11.GL_DEPTH_TEST);

      if (worktable.getMemory().isLocked(slotNumber)) {
        manager.gui.setZLevel(110f);
        Proxies.common.bindTexture(SpriteSheet.ITEMS);
        manager.gui.drawTexturedModelRectFromIcon(
            startX + xPos,
            startY + yPos,
            TextureManager.getInstance().getDefault("slots/locked"),
            16,
            16);
        manager.gui.setZLevel(0f);
      }

      GL11.glPopAttrib();
    }
Esempio n. 21
0
  private void drawMachineRender(int posX, int posY) {
    RenderHelper.enableGUIStandardItemLighting();
    GL11.glTranslated(0, 0, 32);
    HandbookEntry h = this.getEntry();
    double x = posX + 167;
    double y = posY + 44;
    // float q = 12.5F + fscale*(float)Math.sin(System.nanoTime()/1000000000D); //wobble
    // ReikaJavaLibrary.pConsole(y-ReikaGuiAPI.instance.getMouseScreenY(height));
    int range = 64;
    boolean rotate =
        ReikaGuiAPI.instance.isMouseInBox(
            (int) x - range / 2, (int) x + range / 2, (int) y - range, (int) y + range);
    if (Mouse.isButtonDown(0) && rotate) {
      int mvy = Mouse.getDY();
      if (mvy < 0 && renderq < 45) {
        renderq++;
      }
      if (mvy > 0 && renderq > -45) {
        renderq--;
      }
    }
    y -= 8 * Math.sin(Math.abs(Math.toRadians(renderq)));

    if (h.hasMachineRender()) {
      GL11.glEnable(GL11.GL_BLEND);
      this.doRenderMachine(x, y, h);
      GL11.glDisable(GL11.GL_BLEND);
    }
    GL11.glTranslated(0, 0, -32);
  }
Esempio n. 22
0
  private void renderPart(int x, int y, int z, int scale, PartInfo partInfo) {
    GL11.glPushMatrix();
    GL11.glTranslatef(x, y, z);
    GL11.glScalef(-scale, scale, 1F);

    RenderHelper.enableStandardItemLighting();
    Minecraft.getMinecraft().getRenderManager().playerViewY = 180.0F;
    PartRegistry.getRenderPart(partInfo.partType, partInfo.typeid)
        .render(fakeEntity, partInfo, 0, 0, 0, 0);
    RenderHelper.disableStandardItemLighting();
    OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);

    GL11.glPopMatrix();
  }
Esempio n. 23
0
  public static void drawMultilineTip(int x, int y, List<String> list) {
    if (list.isEmpty()) return;

    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    GL11.glDisable(GL11.GL_DEPTH_TEST);
    RenderHelper.disableStandardItemLighting();

    int w = 0;
    int h = -2;
    for (int i = 0; i < list.size(); i++) {
      String s = list.get(i);
      ITooltipLineHandler line = getTipLine(s);
      Dimension d =
          line != null
              ? line.getSize()
              : new Dimension(
                  getStringWidth(s),
                  list.get(i).endsWith(TOOLTIP_LINESPACE) && i + 1 < list.size() ? 12 : 10);
      w = Math.max(w, d.width);
      h += d.height;
    }

    if (x < 8) x = 8;
    else if (x > displaySize().width - w - 8) x -= 24 + w; // flip side of cursor
    y = (int) MathHelper.clip(y, 8, displaySize().height - 8 - h);

    gui.incZLevel(300);
    drawTooltipBox(x - 4, y - 4, w + 7, h + 7);
    for (String s : list) {
      ITooltipLineHandler line = getTipLine(s);
      if (line != null) {
        line.draw(x, y);
        y += line.getSize().height;
      } else {
        fontRenderer.drawStringWithShadow(s, x, y, -1);
        y += s.endsWith(TOOLTIP_LINESPACE) ? 12 : 10;
      }
    }

    tipLineHandlers.clear();
    gui.incZLevel(-300);

    GL11.glEnable(GL11.GL_DEPTH_TEST);
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    RenderHelper.enableGUIStandardItemLighting();
  }
Esempio n. 24
0
  private void drawSlot(Minecraft mc, ItemStack stack, int x, int y) {
    RenderHelper.enableGUIStandardItemLighting();

    itemRender.renderItemIntoGUI(stack, x, y);
    RenderHelper.disableStandardItemLighting();
    //        itemRender.renderItemOverlayIntoGUI(mc.fontRendererObj, mc.getTextureManager(), stack,
    // x, y);
    //        GL11.glDisable(GL11.GL_LIGHTING);
    //        GL11.glEnable(GL11.GL_ALPHA_TEST);
    //        GL11.glEnable(GL11.GL_BLEND);

    if (stack.isItemEnchanted()) renderEffectSlot(mc.getTextureManager(), x - 1, y - 1);
    else {
      SAOGL.glBlend(true);
      SAOGL.glAlpha(true);
    }
  }
Esempio n. 25
0
  @Override
  public void draw(
      GuiEntry entry,
      int width,
      int height,
      int left,
      int top,
      EntityPlayer player,
      String key,
      int page,
      int mX,
      int mY) {
    int x, y;

    GL11.glPushMatrix();
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glColor4f(1F, 1F, 1F, 1F);
    RenderHelper.enableGUIStandardItemLighting();
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    GL11.glEnable(GL11.GL_DEPTH_TEST);
    renderOverlay(entry, width, height, left, top);

    x = left + width / 2 - (65 - 45);
    y = (height / 2 - 36) + (18 * (4 - 3));
    drawIcon(this.input, x, y);

    /** Result */
    x = left + width / 2 - (65 - (48 + 48) - 5);
    y = (height / 2 - 36) + (18 * (4 - 3));
    drawIcon(this.output, x, y);

    RenderHelper.disableStandardItemLighting();

    GL11.glDisable(GL11.GL_LIGHTING);

    GL11.glPopMatrix();

    for (ItemIcon icon : icons) {
      if (icon.stack != null) icon.onMouseBetween(mX, mY);
    }
  }
  @Override
  public void renderContentLayer(int localWidth, int localHeight) {
    manual.fonts.drawString("\u00a7nTool Station", localWidth + 60, localHeight + 4, 0);
    GL11.glScalef(2f, 2f, 2f);
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    RenderHelper.enableGUIStandardItemLighting();

    ItemStack toolstack = TSClientRegistry.getManualIcon("ironpick");
    if (type.equals("weapon")) toolstack = TSClientRegistry.getManualIcon("ironlongsword");

    manual.renderitem.zLevel = 100;
    manual.renderitem.renderItemAndEffectIntoGUI(
        manual.fonts,
        manual.getMC().renderEngine,
        toolstack,
        (localWidth + 54) / 2,
        (localHeight + 54) / 2);
    manual.renderitem.renderItemAndEffectIntoGUI(
        manual.fonts,
        manual.getMC().renderEngine,
        icons[0],
        (localWidth + 130) / 2,
        (localHeight + 54) / 2);
    manual.renderitem.renderItemAndEffectIntoGUI(
        manual.fonts,
        manual.getMC().renderEngine,
        icons[1],
        (localWidth + 18) / 2,
        (localHeight + 36) / 2);
    if (icons[2] != null)
      manual.renderitem.renderItemAndEffectIntoGUI(
          manual.fonts,
          manual.getMC().renderEngine,
          icons[2],
          (localWidth + 18) / 2,
          (localHeight + 74) / 2);
    manual.renderitem.zLevel = 0;

    GL11.glScalef(0.5F, 0.5F, 0.5F);
    RenderHelper.disableStandardItemLighting();
    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
  }
Esempio n. 27
0
    @Override
    public void draw(int startX, int startY) {
      GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
      GL11.glDisable(GL11.GL_LIGHTING);
      GL11.glEnable(GL11.GL_DEPTH_TEST);
      RenderHelper.enableGUIStandardItemLighting();
      OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240, 240);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

      manager.gui.drawItemStack(BOOK, startX + xPos, startY + yPos);

      GL11.glPopAttrib();
    }
Esempio n. 28
0
  protected void func_146979_b(int p_146979_1_, int p_146979_2_) {
    RenderHelper.disableStandardItemLighting();
    this.drawCenteredString(
        this.fontRendererObj, I18n.format("tile.beacon.primary", new Object[0]), 62, 10, 14737632);
    this.drawCenteredString(
        this.fontRendererObj,
        I18n.format("tile.beacon.secondary", new Object[0]),
        169,
        10,
        14737632);
    Iterator var3 = this.buttonList.iterator();

    while (var3.hasNext()) {
      GuiButton var4 = (GuiButton) var3.next();

      if (var4.func_146115_a()) {
        var4.func_146111_b(p_146979_1_ - this.field_147003_i, p_146979_2_ - this.field_147009_r);
        break;
      }
    }

    RenderHelper.enableGUIStandardItemLighting();
  }
Esempio n. 29
0
  @Override
  protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
    fontRendererObj.drawString(I18n.format("container.crafting") + " EX", 28, 6, 0x404040);
    fontRendererObj.drawString(I18n.format("container.inventory"), 8, ySize - 94, 0x404040);

    if (container.isRecipes()) {
      String str = container.getCurrentIndex() + 1 + " / " + container.getRecipeSize();
      recipesX = xSize - fontRendererObj.getStringWidth(str) - 10;
      recipesY = 6;
      fontRendererObj.drawString(str, recipesX, recipesY, 0x707070);
    }

    if (mouseX >= guiLeft && mouseX <= guiLeft + 20 && mouseY >= guiTop && mouseY <= guiTop + 20) {
      GlStateManager.pushMatrix();
      GlStateManager.scale(0.82F, 0.82F, 1.0F);
      RenderHelper.enableGUIStandardItemLighting();
      itemRender.zLevel = 100.0F;
      itemRender.renderItemAndEffectIntoGUI(CRAFTING_TABLE, 6, 6);
      itemRender.zLevel = 0.0F;
      RenderHelper.disableStandardItemLighting();
      GlStateManager.popMatrix();
    }
  }
Esempio n. 30
0
  @SideOnly(Side.CLIENT)
  private static void renderEnderSky() {
    TextureManager renderEngine = Minecraft.getMinecraft().getTextureManager();

    GL11.glDisable(GL11.GL_FOG);
    GL11.glDisable(GL11.GL_ALPHA_TEST);
    GL11.glEnable(GL11.GL_BLEND);
    OpenGlHelper.glBlendFunc(770, 771, 1, 0);
    RenderHelper.disableStandardItemLighting();
    GL11.glDepthMask(false);
    renderEngine.bindTexture(locationEndSkyPng);
    Tessellator tessellator = Tessellator.instance;

    for (int i = 0; i < 6; ++i) {
      GL11.glPushMatrix();

      if (i == 1) {
        GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
      }

      if (i == 2) {
        GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F);
      }

      if (i == 3) {
        GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
      }

      if (i == 4) {
        GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F);
      }

      if (i == 5) {
        GL11.glRotatef(-90.0F, 0.0F, 0.0F, 1.0F);
      }

      tessellator.startDrawingQuads();
      tessellator.setColorOpaque_I(2631720);
      tessellator.addVertexWithUV(-100.0D, -100.0D, -100.0D, 0.0D, 0.0D);
      tessellator.addVertexWithUV(-100.0D, -100.0D, 100.0D, 0.0D, 16.0D);
      tessellator.addVertexWithUV(100.0D, -100.0D, 100.0D, 16.0D, 16.0D);
      tessellator.addVertexWithUV(100.0D, -100.0D, -100.0D, 16.0D, 0.0D);
      tessellator.draw();
      GL11.glPopMatrix();
    }

    GL11.glDepthMask(true);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL11.GL_ALPHA_TEST);
  }