Exemplo n.º 1
0
  /**
   * Renders the creative inventory hovering text if mouse is over it. Returns true if did render or
   * false otherwise. Params: current creative tab to be checked, current mouse x position, current
   * mouse y position.
   */
  protected boolean renderCreativeInventoryHoveringText(
      CreativeTabs p_147052_1_, int p_147052_2_, int p_147052_3_) {
    int k = p_147052_1_.getTabColumn();
    int l = 28 * k;
    byte b0 = 0;

    if (k == 5) {
      l = this.xSize - 28 + 2;
    } else if (k > 0) {
      l += k;
    }

    int i1;

    if (p_147052_1_.isTabInFirstRow()) {
      i1 = b0 - 32;
    } else {
      i1 = b0 + this.ySize;
    }

    if (this.func_146978_c(l + 3, i1 + 3, 23, 27, p_147052_2_, p_147052_3_)) {
      this.drawCreativeTabHoveringText(
          I18n.format(p_147052_1_.getTranslatedTabLabel(), new Object[0]),
          p_147052_2_,
          p_147052_3_);
      return true;
    } else {
      return false;
    }
  }
Exemplo n.º 2
0
  protected boolean func_147049_a(CreativeTabs p_147049_1_, int p_147049_2_, int p_147049_3_) {
    if (p_147049_1_.getTabPage() != tabPage) {
      if (p_147049_1_ != CreativeTabs.tabAllSearch && p_147049_1_ != CreativeTabs.tabInventory) {
        return false;
      }
    }

    int k = p_147049_1_.getTabColumn();
    int l = 28 * k;
    byte b0 = 0;

    if (k == 5) {
      l = this.xSize - 28 + 2;
    } else if (k > 0) {
      l += k;
    }

    int i1;

    if (p_147049_1_.isTabInFirstRow()) {
      i1 = b0 - 32;
    } else {
      i1 = b0 + this.ySize;
    }

    return p_147049_2_ >= l && p_147049_2_ <= l + 28 && p_147049_3_ >= i1 && p_147049_3_ <= i1 + 32;
  }
Exemplo n.º 3
0
  protected void func_147051_a(CreativeTabs p_147051_1_) {
    boolean flag = p_147051_1_.getTabIndex() == selectedTabIndex;
    boolean flag1 = p_147051_1_.isTabInFirstRow();
    int i = p_147051_1_.getTabColumn();
    int j = i * 28;
    int k = 0;
    int l = this.guiLeft + 28 * i;
    int i1 = this.guiTop;
    byte b0 = 32;

    if (flag) {
      k += 32;
    }

    if (i == 5) {
      l = this.guiLeft + this.xSize - 28;
    } else if (i > 0) {
      l += i;
    }

    if (flag1) {
      i1 -= 28;
    } else {
      k += 64;
      i1 += this.ySize - 4;
    }

    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glColor3f(1F, 1F, 1F); // Forge: Reset color in case Items change it.
    GL11.glEnable(
        GL11.GL_BLEND); // Forge: Make sure blend is enabled else tabs show a white border.
    this.drawTexturedModalRect(l, i1, j, k, 28, b0);
    this.zLevel = 100.0F;
    itemRender.zLevel = 100.0F;
    l += 6;
    i1 += 8 + (flag1 ? 1 : -1);
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    ItemStack itemstack = p_147051_1_.getIconItemStack();
    itemRender.renderItemAndEffectIntoGUI(
        this.fontRendererObj, this.mc.getTextureManager(), itemstack, l, i1);
    itemRender.renderItemOverlayIntoGUI(
        this.fontRendererObj, this.mc.getTextureManager(), itemstack, l, i1);
    GL11.glDisable(GL11.GL_LIGHTING);
    itemRender.zLevel = 0.0F;
    this.zLevel = 0.0F;
  }