Example #1
0
  @Override
  public void drawButton(Minecraft mc, int x, int y) {
    if (this.drawButton) {

      int k = this.getHoverState(this.field_82253_i) - 1;
      if (icon == null) {
        k = 0;
        if (screen.AnvilEntity != null && screen.AnvilEntity.workRecipe != null) {
          CraftingRuleEnum[] Rules = screen.AnvilEntity.workRecipe.getRules();
          int[] ItemRules = screen.AnvilEntity.getItemRules();
          this.displayString = Rules[ruleIndex].Name;
        }
      }

      mc.func_110434_K().func_110577_a(GuiAnvil.texture);
      GL11.glColor4ub(red, green, blue, (byte) 255);
      this.drawTexturedModalRect(
          this.xPosition,
          this.yPosition,
          this.bX + k * 16,
          this.bY + (ruleIndex * 22),
          this.bW,
          this.bH);

      this.field_82253_i =
          x >= this.xPosition
              && y >= this.yPosition
              && x < this.xPosition + this.width
              && y < this.yPosition + this.height;

      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      if (icon != null) {
        mc.func_110434_K().func_110577_a(TextureMap.field_110575_b);
        this.drawTexturedModelRectFromIcon(
            this.xPosition, this.yPosition, icon, this.width, this.height);
      }

      this.mouseDragged(mc, x, y);

      if (field_82253_i) {
        FontRenderer fontrenderer = Minecraft.getMinecraft().fontRenderer;
        screen.drawTooltip(x, y, this.displayString);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      }
    }
  }
Example #2
0
  public void func_73737_a(Minecraft p_73737_1_, int p_73737_2_, int p_73737_3_) {
    if (this.field_73748_h) {
      FontRenderer var4 = p_73737_1_.field_71466_p;
      p_73737_1_.func_110434_K().func_110577_a(field_110332_a);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      this.field_82253_i =
          p_73737_2_ >= this.field_73746_c
              && p_73737_3_ >= this.field_73743_d
              && p_73737_2_ < this.field_73746_c + this.field_73747_a
              && p_73737_3_ < this.field_73743_d + this.field_73745_b;
      int var5 = this.func_73738_a(this.field_82253_i);
      this.func_73729_b(
          this.field_73746_c,
          this.field_73743_d,
          0,
          46 + var5 * 20,
          this.field_73747_a / 2,
          this.field_73745_b);
      this.func_73729_b(
          this.field_73746_c + this.field_73747_a / 2,
          this.field_73743_d,
          200 - this.field_73747_a / 2,
          46 + var5 * 20,
          this.field_73747_a / 2,
          this.field_73745_b);
      this.func_73739_b(p_73737_1_, p_73737_2_, p_73737_3_);
      int var6 = 14737632;
      if (!this.field_73742_g) {
        var6 = -6250336;
      } else if (this.field_82253_i) {
        var6 = 16777120;
      }

      this.func_73732_a(
          var4,
          this.field_73744_e,
          this.field_73746_c + this.field_73747_a / 2,
          this.field_73743_d + (this.field_73745_b - 8) / 2,
          var6);
    }
  }
 public ItemRenderer(Minecraft p_i1247_1_) {
   this.field_78455_a = p_i1247_1_;
   this.field_78449_f = new MapItemRenderer(p_i1247_1_.field_71474_y, p_i1247_1_.func_110434_K());
 }