コード例 #1
0
  /**
   * Fired when a control is clicked. This is the equivalent of
   * ActionListener.actionPerformed(ActionEvent e).
   */
  @Override
  protected void actionPerformed(GuiButton par1GuiButton) {
    if (!par1GuiButton.enabled) {
      return;
    }

    if (par1GuiButton.id == 0) {
      mc.displayGuiScreen(parentGui);
    } else if (par1GuiButton.id == 1) {
      selectedSlot = slotGeneral;
    } else if (par1GuiButton.id == 3) {
      selectedSlot = slotItem;
    } else if (par1GuiButton.id == 2) {
      selectedSlot = slotBlock;
    } else {
      selectedSlot.actionPerformed(par1GuiButton);
    }
  }
コード例 #2
0
 /** Draws the screen and all the components in it. */
 @Override
 public void drawScreen(int par1, int par2, float par3) {
   selectedSlot.drawScreen(par1, par2, par3);
   drawCenteredString(fontRenderer, statsTitle, width / 2, 20, 0xffffff);
   super.drawScreen(par1, par2, par3);
 }