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);
 }
Beispiel #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();
    }
  }
 @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);
 }
  @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();
  }
  @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();
  }
Beispiel #9
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);
    }
Beispiel #11
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();
 }
  /** 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();
    }
  }
  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);
    }
  }
Beispiel #14
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);
  }
  @Override
  public final void drawScreen(int x, int y, float f) {
    super.drawScreen(x, y, f);

    int posX = (width - xSize) / 2;
    int posY = (height - ySize) / 2 - 8;

    // if (subpage == 0 && !disable)
    this.drawRecipes();

    this.drawGraphics();

    RenderHelper.disableStandardItemLighting();
  }
Beispiel #16
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);
  }
Beispiel #17
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();
  }
 public void renderVehicle(
     EntityShip entity, double x, double y, double z, float yaw, float pitch) {
   GL11.glPushAttrib(8256);
   RenderHelper.disableStandardItemLighting();
   GL11.glPushMatrix();
   GL11.glTranslatef((float) x, (float) y, (float) z);
   GL11.glRotatef(yaw, 0.0F, 1.0F, 0.0F);
   float fx = entity.getShipChunk().getCenterX();
   float fz = entity.getShipChunk().getCenterZ();
   GL11.glTranslatef(-fx, (float) (-entity.getShipChunk().minY()), -fz);
   float f4 = 0.75F;
   this.func_110777_b(entity);
   entity.getShipChunk().renderer.render(0.0F);
   GL11.glPopMatrix();
   GL11.glPopAttrib();
 }
Beispiel #19
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();
  }
Beispiel #20
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);
    }
  }
  @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);
  }
Beispiel #23
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();
    }
  }
Beispiel #24
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();
  }
Beispiel #25
0
  private void renderHandles(PedestalTileEntity te) {
    GlStateManager.pushMatrix();

    GlStateManager.translate(.5, 0, .5);
    long angle = (System.currentTimeMillis() / 10) % 360;
    GlStateManager.rotate(angle, 0, 1, 0);

    RenderHelper.disableStandardItemLighting();
    this.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    if (Minecraft.isAmbientOcclusionEnabled()) {
      GlStateManager.shadeModel(GL11.GL_SMOOTH);
    } else {
      GlStateManager.shadeModel(GL11.GL_FLAT);
    }

    World world = te.getWorld();
    // Translate back to local view coordinates so that we can do the acual rendering here
    GlStateManager.translate(-te.getPos().getX(), -te.getPos().getY(), -te.getPos().getZ());

    Tessellator tessellator = Tessellator.getInstance();
    tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);
    Minecraft.getMinecraft()
        .getBlockRendererDispatcher()
        .getBlockModelRenderer()
        .renderModel(
            world,
            getBakedModel(),
            world.getBlockState(te.getPos()),
            te.getPos(),
            Tessellator.getInstance().getBuffer(),
            false);
    tessellator.draw();

    RenderHelper.enableStandardItemLighting();
    GlStateManager.popMatrix();
  }
Beispiel #26
0
 @Override
 public void renderContent(int x, int y, float par3) {
   int swX = startX + 2;
   int swY = startY + 14;
   int hgPos = -1;
   if (x > startX && x < startX + wdth && y > startY + 15 && y < startY + hght - 1) {
     int pos = (y - 15 - startY) / 10;
     hgPos = startY + pos * 10 + 14;
     drawRect(swX, hgPos, startX + wdth - 2, hgPos + 10, 0x80ffffff);
     ArrayList<String> disable = new ArrayList<String>();
     disable.add("Disable " + enabled.get(pos) + "?");
     String help = modifications.get(enabled.get(pos)).help;
     if (help != null) {
       disable.add("");
       disable.add(help);
     }
     drawHoveringText(disable, x, y, fontRendererObj);
     RenderHelper.disableStandardItemLighting();
   }
   for (String title : enabled) {
     mc.fontRenderer.drawString(title, swX, swY + 1, 0xffffff, false);
     swY += 10;
   }
 }
  private void getcontent(int page) {
    RenderItem renderItem = new RenderItem();
    RenderHelper.enableGUIStandardItemLighting();

    switch (page) {
      case 0:
        this.fontRenderer.drawString("Table of Contents", 90, 45, 16777215);
        for (int p = 0; p < this.pages.size(); p++) {
          this.fontRenderer.drawString(
              "[" + p + "]: " + (String) this.pages.get(p), 20, 65 + p * 10, 16777215);
        }
        break;
      case 1:
        this.fontRenderer.drawString("Changelog V2.2.8.3.6", 90, 45, 16777215);
        this.fontRenderer.drawString("fix Coverter Powerloop", 20, 65, 16777215);
        this.fontRenderer.drawString("fix Textur Bug ", 20, 75, 16777215);
        this.fontRenderer.drawString("change ForceField -> ", 20, 85, 16777215);
        this.fontRenderer.drawString("touch damage system", 20, 95, 16777215);

        break;
      case 2:
        this.fontRenderer.drawString("Versions Check", 90, 45, 16777215);
        // TODO: FIX THIS
        this.fontRenderer.drawString(
            "Current Version: " + ModularForceFieldSystem.VERSION, 20, 65, 16777215);
        this.fontRenderer.drawString(
            "Newest Version : " + ModularForceFieldSystem.VERSION, 20, 75, 16777215);
        break;
      case 3:
        renderItem.renderItemIntoGUI(
            this.mc.fontRenderer,
            this.mc.renderEngine,
            new ItemStack(ModularForceFieldSystem.blockMonaziteOre),
            30,
            45);
        renderItem.renderItemIntoGUI(
            this.mc.fontRenderer,
            this.mc.renderEngine,
            new ItemStack(ModularForceFieldSystem.itemForcicium),
            30,
            65);
        renderItem.renderItemIntoGUI(
            this.mc.fontRenderer,
            this.mc.renderEngine,
            new ItemStack(ModularForceFieldSystem.itemForcicumCell),
            30,
            85);

        this.fontRenderer.drawString("Monazit Ore (Block/WorldGen)", 60, 50, 16777215);
        this.fontRenderer.drawString("Forcicium (Item/for Crafting)", 60, 70, 16777215);
        this.fontRenderer.drawString("Forcicium Cell (Item/from Crafting)", 60, 90, 16777215);

        this.fontRenderer.drawString("Monazite can be found between 80 and 0", 20, 105, 16777215);
        this.fontRenderer.drawString("Use furnace to get 4 Forcicium", 20, 115, 16777215);
        this.fontRenderer.drawString("Use IC Macerator to get 8 Forcicium", 20, 125, 16777215);
        this.fontRenderer.drawString("Forcicium Cell can store 1kForcicium", 20, 135, 16777215);
        this.fontRenderer.drawString("if in hand right click to activate", 20, 145, 16777215);
        this.fontRenderer.drawString("when active remove Forcicium from  ", 20, 155, 16777215);
        this.fontRenderer.drawString("Player Inventory and stores it", 20, 165, 16777215);
        break;
      case 4:
        renderItem.renderItemIntoGUI(
            this.mc.fontRenderer,
            this.mc.renderEngine,
            new ItemStack(ModularForceFieldSystem.itemCardEmpty),
            15,
            45);
        this.fontRenderer.drawString("Card <blank> get from Crafting stackable ", 35, 45, 16777215);
        this.fontRenderer.drawString("up to 16 need for create all Cards ", 35, 55, 16777215);

        renderItem.renderItemIntoGUI(
            this.mc.fontRenderer,
            this.mc.renderEngine,
            new ItemStack(ModularForceFieldSystem.itemCardPowerLink),
            15,
            95);
        renderItem.renderItemIntoGUI(
            this.mc.fontRenderer,
            this.mc.renderEngine,
            new ItemStack(ModularForceFieldSystem.blockCapacitor),
            35,
            105);
        renderItem.renderItemIntoGUI(
            this.mc.fontRenderer,
            this.mc.renderEngine,
            new ItemStack(ModularForceFieldSystem.itemCardEmpty),
            140,
            105);
        this.fontRenderer.drawString("Card <Power Link> get from right click", 35, 95, 16777215);
        this.fontRenderer.drawString("Capacitor with a ", 55, 110, 16777215);

        renderItem.renderItemIntoGUI(
            this.mc.fontRenderer,
            this.mc.renderEngine,
            new ItemStack(ModularForceFieldSystem.itemCardSecurityLink),
            15,
            145);
        this.fontRenderer.drawString("Card <Security Station Link> get from", 35, 145, 16777215);
        this.fontRenderer.drawString("right click", 35, 160, 16777215);
        renderItem.renderItemIntoGUI(
            this.mc.fontRenderer,
            this.mc.renderEngine,
            new ItemStack(ModularForceFieldSystem.blockSecurityStation),
            90,
            155);
        this.fontRenderer.drawString("SecurityStation with a ", 110, 160, 16777215);
        renderItem.renderItemIntoGUI(
            this.mc.fontRenderer,
            this.mc.renderEngine,
            new ItemStack(ModularForceFieldSystem.itemCardEmpty),
            220,
            155);

        break;
      case 5:
        renderItem.renderItemIntoGUI(
            this.mc.fontRenderer,
            this.mc.renderEngine,
            new ItemStack(ModularForceFieldSystem.itemCardAccess),
            15,
            45);
        this.fontRenderer.drawString("Card <Access license> create inside a  ", 35, 45, 16777215);
        renderItem.renderItemIntoGUI(
            this.mc.fontRenderer,
            this.mc.renderEngine,
            new ItemStack(ModularForceFieldSystem.blockSecurityStation),
            35,
            55);
        this.fontRenderer.drawString("SecurityStation with a", 55, 60, 16777215);
        renderItem.renderItemIntoGUI(
            this.mc.fontRenderer,
            this.mc.renderEngine,
            new ItemStack(ModularForceFieldSystem.itemCardEmpty),
            170,
            55);

        renderItem.renderItemIntoGUI(
            this.mc.fontRenderer,
            this.mc.renderEngine,
            new ItemStack(ModularForceFieldSystem.itemCardID),
            15,
            85);
        this.fontRenderer.drawString("Card <Personal ID> create with help  ", 35, 85, 16777215);
        renderItem.renderItemIntoGUI(
            this.mc.fontRenderer,
            this.mc.renderEngine,
            new ItemStack(ModularForceFieldSystem.itemMultiToolID),
            35,
            100);
        this.fontRenderer.drawString("MultiTool right click create self", 55, 98, 16777215);
        this.fontRenderer.drawString("or left click for another Player", 55, 110, 16777215);

        renderItem.renderItemIntoGUI(
            this.mc.fontRenderer,
            this.mc.renderEngine,
            new ItemStack(ModularForceFieldSystem.itemCardDataLink),
            15,
            125);
        this.fontRenderer.drawString("Card <Data Link> create with help  ", 35, 125, 16777215);
        renderItem.renderItemIntoGUI(
            this.mc.fontRenderer,
            this.mc.renderEngine,
            new ItemStack(ModularForceFieldSystem.itemMultiToolID),
            35,
            140);
        this.fontRenderer.drawString("MultiTool right click any ", 55, 138, 16777215);
        this.fontRenderer.drawString("MFFS Maschine ", 55, 150, 16777215);

        renderItem.renderItemIntoGUI(
            this.mc.fontRenderer,
            this.mc.renderEngine,
            new ItemStack(ModularForceFieldSystem.itemCardInfinite),
            15,
            165);
        this.fontRenderer.drawString("Admin Infinite Force Energy Card", 35, 170, 16777215);
    }

    RenderHelper.disableStandardItemLighting();
  }
  /** Renders the dragon, along with its dying animation */
  public void renderDragon(
      EntityDragonBoss par1entitydragonboss,
      double par2,
      double par4,
      double par6,
      float par8,
      float par9) {
    BossStatus.setBossStatus(par1entitydragonboss, false);
    super.doRender(par1entitydragonboss, par2, par4, par6, par8, par9);

    if (par1entitydragonboss.healingcircle != null) {
      float f2 = EntityDragonMinion.innerRotation + par9;
      float f3 = MathHelper.sin(f2 * 0.2F) / 2.0F + 0.5F;
      f3 = (f3 * f3 + f3) * 0.2F;
      float f4 =
          (float)
              (par1entitydragonboss.healingcircle.posX
                  - par1entitydragonboss.posX
                  - (par1entitydragonboss.prevPosX - par1entitydragonboss.posX) * (1.0F - par9));
      float f5 =
          (float)
              (f3
                  + par1entitydragonboss.healingcircle.posY
                  - 1.0D
                  - par1entitydragonboss.posY
                  - (par1entitydragonboss.prevPosY - par1entitydragonboss.posY) * (1.0F - par9));
      float f6 =
          (float)
              (par1entitydragonboss.healingcircle.posZ
                  - par1entitydragonboss.posZ
                  - (par1entitydragonboss.prevPosZ - par1entitydragonboss.posZ) * (1.0F - par9));
      float f7 = MathHelper.sqrt_float(f4 * f4 + f6 * f6);
      float f8 = MathHelper.sqrt_float(f4 * f4 + f5 * f5 + f6 * f6);
      GL11.glPushMatrix();
      GL11.glTranslatef((float) par2, (float) par4 + 2.0F, (float) par6);
      GL11.glRotatef(
          (float) -Math.atan2(f6, f4) * 180.0F / (float) Math.PI - 90.0F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(
          (float) -Math.atan2(f7, f5) * 180.0F / (float) Math.PI - 90.0F, 1.0F, 0.0F, 0.0F);
      Tessellator tessellator = Tessellator.instance;
      RenderHelper.disableStandardItemLighting();
      GL11.glDisable(GL11.GL_CULL_FACE);
      bindTexture(field_110843_g);
      GL11.glShadeModel(GL11.GL_SMOOTH);
      float f9 = 0.0F - (par1entitydragonboss.ticksExisted + par9) * 0.01F;
      float f10 =
          MathHelper.sqrt_float(f4 * f4 + f5 * f5 + f6 * f6) / 32.0F
              - (par1entitydragonboss.ticksExisted + par9) * 0.01F;
      tessellator.startDrawing(5);
      byte b0 = 8;

      for (int i = 0; i <= b0; ++i) {
        float f11 = MathHelper.sin(i % b0 * (float) Math.PI * 2.0F / b0) * 0.75F;
        float f12 = MathHelper.cos(i % b0 * (float) Math.PI * 2.0F / b0) * 0.75F;
        float f13 = i % b0 * 1.0F / b0;
        tessellator.setColorOpaque_I(0);
        tessellator.addVertexWithUV(f11 * 0.2F, f12 * 0.2F, 0.0D, f13, f10);
        tessellator.setColorOpaque_I(16777215);
        tessellator.addVertexWithUV(f11, f12, f8, f13, f9);
      }

      tessellator.draw();
      GL11.glEnable(GL11.GL_CULL_FACE);
      GL11.glShadeModel(GL11.GL_FLAT);
      RenderHelper.enableStandardItemLighting();
      GL11.glPopMatrix();
    }
  }
  public void renderPiston(
      TileEntityPiston par1TileEntityPiston, double par2, double par4, double par6, float par8) {
    Block var9 = Block.blocksList[par1TileEntityPiston.getStoredBlockID()];

    if (var9 != null && par1TileEntityPiston.getProgress(par8) < 1.0F) {
      Tessellator var10 = Tessellator.instance;
      this.bindTextureByName("/terrain.png");
      RenderHelper.disableStandardItemLighting();
      GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
      GL11.glEnable(GL11.GL_BLEND);
      GL11.glDisable(GL11.GL_CULL_FACE);

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

      ForgeHooksClient.beforeBlockRender(var9, blockRenderer);
      var10.startDrawingQuads();
      var10.setTranslation(
          (double)
              ((float) par2
                  - (float) par1TileEntityPiston.xCoord
                  + par1TileEntityPiston.getOffsetX(par8)),
          (double)
              ((float) par4
                  - (float) par1TileEntityPiston.yCoord
                  + par1TileEntityPiston.getOffsetY(par8)),
          (double)
              ((float) par6
                  - (float) par1TileEntityPiston.zCoord
                  + par1TileEntityPiston.getOffsetZ(par8)));
      var10.setColorOpaque(1, 1, 1);

      if (var9 == Block.pistonExtension && par1TileEntityPiston.getProgress(par8) < 0.5F) {
        this.blockRenderer.renderPistonExtensionAllFaces(
            var9,
            par1TileEntityPiston.xCoord,
            par1TileEntityPiston.yCoord,
            par1TileEntityPiston.zCoord,
            false);
      } else if (par1TileEntityPiston.shouldRenderHead() && !par1TileEntityPiston.isExtending()) {
        Block.pistonExtension.setHeadTexture(((BlockPistonBase) var9).getPistonExtensionTexture());
        this.blockRenderer.renderPistonExtensionAllFaces(
            Block.pistonExtension,
            par1TileEntityPiston.xCoord,
            par1TileEntityPiston.yCoord,
            par1TileEntityPiston.zCoord,
            par1TileEntityPiston.getProgress(par8) < 0.5F);
        Block.pistonExtension.clearHeadTexture();
        var10.setTranslation(
            (double) ((float) par2 - (float) par1TileEntityPiston.xCoord),
            (double) ((float) par4 - (float) par1TileEntityPiston.yCoord),
            (double) ((float) par6 - (float) par1TileEntityPiston.zCoord));
        this.blockRenderer.renderPistonBaseAllFaces(
            var9,
            par1TileEntityPiston.xCoord,
            par1TileEntityPiston.yCoord,
            par1TileEntityPiston.zCoord);
      } else {
        this.blockRenderer.renderBlockAllFaces(
            var9,
            par1TileEntityPiston.xCoord,
            par1TileEntityPiston.yCoord,
            par1TileEntityPiston.zCoord);
      }

      var10.setTranslation(0.0D, 0.0D, 0.0D);
      var10.draw();
      ForgeHooksClient.afterBlockRender(var9, blockRenderer);
      RenderHelper.enableStandardItemLighting();
    }
  }
Beispiel #30
0
 @Override
 public void drawScreen(int par1, int par2, float par3) {
   super.drawScreen(par1, par2, par3);
   RenderHelper.disableStandardItemLighting();
 }