Пример #1
0
  @Override
  protected void actionPerformed(GuiButton par1GuiButton) {
    if (par1GuiButton instanceof IRadioButton) ((IRadioButton) par1GuiButton).enableFromClick();
    else buttonListMM.get(0).enabled = !buttonListMM.get(0).enabled;

    mobMagnet.adult = buttonListMM.get(0).enabled;

    ThaumicTinkerer.netHandler.sendToServer(new PacketMobMagnetButton(mobMagnet));
  }
Пример #2
0
  @Override
  protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    mc.renderEngine.bindTexture(gui);
    drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
    String adult = StatCollector.translateToLocal("ttmisc.adult");
    String child = StatCollector.translateToLocal("ttmisc.child");
    stack = mobMagnet.getStackInSlot(0);

    String filter;

    if (stack != null) {
      String name = ItemSoulMould.getPatternName(stack);
      if (name.isEmpty()) filter = StatCollector.translateToLocal("ttmisc.none");
      else filter = StatCollector.translateToLocal("entity." + name + ".name");
    } else filter = StatCollector.translateToLocal("ttmisc.all");

    fontRendererObj.drawString(
        filter, x + xSize / 2 - fontRendererObj.getStringWidth(filter) / 2 - 26, y + 16, 0x999999);
    fontRendererObj.drawString(adult, x + 120, y + 30, 0x999999);
    fontRendererObj.drawString(child, x + 120, y + 50, 0x999999);
    GL11.glColor3f(1F, 1F, 1F);
  }