private void drawButtons() {
    ItemStack stack = targetItem.getSelectedItem().getItem();
    IPowerModule module = targetModule.getSelectedModule().getModule();
    if (!MuseItemUtils.itemHasModule(stack, module.getName())) {

      installButton.setEnabled(
          player.capabilities.isCreativeMode
              || MuseItemUtils.hasInInventory(module.getInstallCost(), player.inventory));
      installButton.draw();
    } else {
      salvageButton.draw();
    }
  }
 /**
  * Performs all the functions associated with the install button. This requires communicating with
  * the server.
  */
 private void doInstall() {
   ItemStack stack = targetItem.getSelectedItem().getItem();
   IPowerModule module = targetModule.getSelectedModule().getModule();
   if (player.capabilities.isCreativeMode
       || MuseItemUtils.hasInInventory(module.getInstallCost(), player.inventory)) {
     Musique.playClientSound(SoundLoader.SOUND_GUI_INSTALL, 1);
     // Now send request to server to make it legit
     MusePacket newpacket =
         new MusePacketInstallModuleRequest(
             (Player) player, targetItem.getSelectedItem().inventorySlot, module.getName());
     player.sendQueue.addToSendQueue(newpacket.getPacket250());
   }
 }
 private void drawItems() {
   ItemStack stack = targetItem.getSelectedItem().getItem();
   IPowerModule module = targetModule.getSelectedModule().getModule();
   List<ItemStack> itemsToDraw = module.getInstallCost();
   double yoffset;
   if (!MuseItemUtils.itemHasModule(stack, module.getName())) {
     yoffset = border.top() + 4;
   } else {
     yoffset = border.bottom() - 20;
   }
   double xoffset = -8.0 * itemsToDraw.size() + (border.left() + border.right()) / 2;
   int i = 0;
   for (ItemStack costItem : itemsToDraw) {
     MuseRenderer.drawItemAt(16 * i++ + xoffset, yoffset, costItem);
   }
 }
 @Override
 public List<String> getToolTip(int x, int y) {
   if (targetItem.getSelectedItem() != null && targetModule.getSelectedModule() != null) {
     ItemStack stack = targetItem.getSelectedItem().getItem();
     IPowerModule module = targetModule.getSelectedModule().getModule();
     List<ItemStack> itemsToCheck = module.getInstallCost();
     double yoffset;
     if (!MuseItemUtils.itemHasModule(stack, module.getName())) {
       yoffset = border.top() + 4;
     } else {
       yoffset = border.bottom() - 20;
     }
     if (yoffset + 16 > y && yoffset < y) {
       double xoffset = -8.0 * itemsToCheck.size() + (border.left() + border.right()) / 2;
       if (xoffset + 16 * itemsToCheck.size() > x && xoffset < x) {
         int index = (int) (x - xoffset) / 16;
         List<String> tip = itemsToCheck.get(index).getTooltip(player, false);
         return tip;
       }
     }
   }
   return null;
 }