Program: 51593
Project: 51593
Buggy source:
@Override public void managerMode(InventoryClickEvent event){
  boolean top=event.getView().convertSlot(event.getRawSlot()) == event.getRawSlot();
  int slot=event.getSlot();
  if (slot < 0) {
    event.setCancelled(true);
    switchInventory(getBasicManageModeByWool());
    return;
  }
  DecimalFormat f=new DecimalFormat("String_Node_Str");
  if (top) {
    setInventoryClicked(true);
    if (isManagementSlot(slot,3)) {
      if (isWool(event.getCurrentItem(),itemsConfig.getItemManagement(2))) {
        if (!permissionsManager.has(player,"String_Node_Str")) {
          locale.sendMessage(player,"String_Node_Str");
        }
 else {
          setTraderStatus(TraderStatus.MANAGE_PRICE);
          switchInventory(getBasicManageModeByWool(),"String_Node_Str");
          getInventory().setItem(getInventory().getSize() - 2,itemsConfig.getItemManagement(6));
          getInventory().setItem(getInventory().getSize() - 3,new ItemStack(Material.AIR));
          locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str");
        }
      }
 else       if (isWool(event.getCurrentItem(),itemsConfig.getItemManagement(6))) {
        if (isSellModeByWool())         this.setTraderStatus(TraderStatus.MANAGE_SELL);
        if (isBuyModeByWool())         this.setTraderStatus(TraderStatus.MANAGE_BUY);
        switchInventory(getBasicManageModeByWool(),"String_Node_Str");
        getInventory().setItem(getInventory().getSize() - 2,itemsConfig.getItemManagement(2));
        getInventory().setItem(getInventory().getSize() - 3,itemsConfig.getItemManagement(4));
        locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str");
      }
 else       if (isWool(event.getCurrentItem(),itemsConfig.getItemManagement(4))) {
        if (!permissionsManager.has(player,"String_Node_Str")) {
          locale.sendMessage(player,"String_Node_Str");
        }
 else {
          setTraderStatus(TraderStatus.MANAGE_LIMIT_GLOBAL);
          switchInventory(getBasicManageModeByWool(),"String_Node_Str");
          getInventory().setItem(getInventory().getSize() - 3,itemsConfig.getItemManagement(6));
          getInventory().setItem(getInventory().getSize() - 2,itemsConfig.getItemManagement(5));
          locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str");
        }
      }
 else       if (isWool(event.getCurrentItem(),itemsConfig.getItemManagement(5))) {
        if (!permissionsManager.has(player,"String_Node_Str")) {
          locale.sendMessage(player,"String_Node_Str");
        }
 else {
          setTraderStatus(TraderStatus.MANAGE_LIMIT_PLAYER);
          switchInventory(getBasicManageModeByWool(),"String_Node_Str");
          getInventory().setItem(getInventory().getSize() - 3,itemsConfig.getItemManagement(6));
          getInventory().setItem(getInventory().getSize() - 2,itemsConfig.getItemManagement(4));
          locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str");
        }
      }
 else       if (isWool(event.getCurrentItem(),itemsConfig.getItemManagement(1))) {
        if (!permissionsManager.has(player,"String_Node_Str")) {
          locale.sendMessage(player,"String_Node_Str");
        }
 else {
          switchInventory(TraderStatus.MANAGE_BUY);
          locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str");
        }
      }
 else       if (isWool(event.getCurrentItem(),itemsConfig.getItemManagement(0))) {
        if (!permissionsManager.has(player,"String_Node_Str")) {
          locale.sendMessage(player,"String_Node_Str");
        }
 else {
          switchInventory(TraderStatus.MANAGE_SELL);
          locale.sendMessage(player,"String_Node_Str");
        }
      }
 else       if (isWool(event.getCurrentItem(),itemsConfig.getItemManagement(7))) {
        saveManagedAmounts();
        switchInventory(TraderStatus.MANAGE_SELL);
        locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str");
      }
      event.setCancelled(true);
      return;
    }
 else {
      if (event.isShiftClick()) {
        if (equalsTraderStatus(TraderStatus.MANAGE_LIMIT_GLOBAL)) {
          if (event.getCursor().getType().equals(Material.AIR)) {
            if (selectItem(slot,getBasicManageModeByWool()).hasSelectedItem())             locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",String.valueOf(getSelectedItem().getLimits().timeout("String_Node_Str")));
          }
 else {
            if (selectItem(slot,getBasicManageModeByWool()).hasSelectedItem()) {
              if (getSelectedItem().getLimits().get("String_Node_Str") == null)               getSelectedItem().getLimits().set("String_Node_Str",new Limit(0,-1));
              if (event.isRightClick()) {
                getSelectedItem().getLimits().get("String_Node_Str").changeTimeout(-calculateTimeout(event.getCursor()));
              }
 else {
                getSelectedItem().getLimits().get("String_Node_Str").changeTimeout(calculateTimeout(event.getCursor()));
              }
              NBTTagEditor.removeDescription(event.getCurrentItem());
              TraderStockPart.setLore(event.getCurrentItem(),TraderStockPart.getLimitLore(getSelectedItem(),getTraderStatus().name(),player));
              locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",String.valueOf(getSelectedItem().getLimits().timeout("String_Node_Str")));
            }
          }
          selectItem(null);
          event.setCancelled(true);
          return;
        }
        if (equalsTraderStatus(TraderStatus.MANAGE_LIMIT_PLAYER)) {
          if (event.getCursor().getType().equals(Material.AIR)) {
            if (selectItem(slot,getBasicManageModeByWool()).hasSelectedItem())             locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",String.valueOf(getSelectedItem().getLimits().timeout("String_Node_Str")));
          }
 else {
            if (selectItem(slot,getBasicManageModeByWool()).hasSelectedItem()) {
              if (getSelectedItem().getLimits().get("String_Node_Str") == null)               getSelectedItem().getLimits().set("String_Node_Str",new Limit(0,-1));
              if (event.isRightClick()) {
                getSelectedItem().getLimits().get("String_Node_Str").changeTimeout(-calculateTimeout(event.getCursor()));
              }
 else {
                getSelectedItem().getLimits().get("String_Node_Str").changeTimeout(calculateTimeout(event.getCursor()));
              }
              NBTTagEditor.removeDescription(event.getCurrentItem());
              TraderStockPart.setLore(event.getCurrentItem(),TraderStockPart.getPlayerLimitLore(getSelectedItem(),getTraderStatus().name(),player));
              locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",String.valueOf(getSelectedItem().getLimits().timeout("String_Node_Str")));
            }
          }
          selectItem(null);
          event.setCancelled(true);
          return;
        }
        if (event.isLeftClick()) {
          if (equalsTraderStatus(TraderStatus.MANAGE_SELL)) {
            if (selectItem(slot,TraderStatus.MANAGE_SELL).hasSelectedItem() && permissionsManager.has(player,"String_Node_Str")) {
              switchInventory(getSelectedItem());
              setTraderStatus(TraderStatus.MANAGE_SELL_AMOUNT);
            }
          }
        }
 else {
        }
        event.setCancelled(true);
      }
 else {
        if (equalsTraderStatus(getBasicManageModeByWool())) {
          if (event.isRightClick()) {
            if (!permissionsManager.has(player,"String_Node_Str")) {
              locale.sendMessage(player,"String_Node_Str");
              selectItem(null);
              event.setCancelled(true);
              return;
            }
            if (selectItem(slot,getBasicManageModeByWool()).hasSelectedItem()) {
              if (getSelectedItem().stackPrice()) {
                getSelectedItem().setStackPrice(false);
                locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
              }
 else {
                getSelectedItem().setStackPrice(true);
                locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
              }
              NBTTagEditor.removeDescription(event.getCurrentItem());
              TraderStockPart.setLore(event.getCurrentItem(),TraderStockPart.getManageLore(getSelectedItem(),getTraderStatus().name(),player));
              getSelectedItem().setAsPatternItem(false);
            }
            selectItem(null);
            event.setCancelled(true);
            return;
          }
          if (hasSelectedItem()) {
            StockItem item=getSelectedItem();
            if (item.getSlot() == -1) {
              item.setAmount(event.getCursor().getAmount());
              if (this.isBuyModeByWool()) {
                trait.getStock().addItem("String_Node_Str",item);
                getStock().addItem("String_Node_Str",item);
              }
              if (this.isSellModeByWool()) {
                trait.getStock().addItem("String_Node_Str",item);
                getStock().addItem("String_Node_Str",item);
              }
              locale.sendMessage(player,"String_Node_Str");
            }
            if (selectItem(slot,getBasicManageModeByWool()).hasSelectedItem()) {
              getSelectedItem().setSlot(-2);
              locale.sendMessage(player,"String_Node_Str");
            }
            item.setSlot(slot);
            item.setAsPatternItem(false);
            locale.sendMessage(player,"String_Node_Str");
          }
 else {
            if (selectItem(slot,getBasicManageModeByWool()).hasSelectedItem()) {
              getSelectedItem().setSlot(-2);
              locale.sendMessage(player,"String_Node_Str");
            }
          }
          return;
        }
 else         if (equalsTraderStatus(TraderStatus.MANAGE_SELL_AMOUNT)) {
          if (!equalsSelected(event.getCursor(),true,false) && !event.getCursor().getType().equals(Material.AIR)) {
            locale.sendMessage(player,"String_Node_Str");
            event.setCancelled(true);
          }
          if (!event.getCursor().getType().equals(Material.AIR))           getSelectedItem().setAsPatternItem(false);
          return;
        }
 else         if (equalsTraderStatus(TraderStatus.MANAGE_PRICE)) {
          if (event.getCursor().getType().equals(Material.AIR)) {
            if (selectItem(slot,getBasicManageModeByWool()).hasSelectedItem())             locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",f.format(getSelectedItem().getRawPrice()));
          }
 else {
            if (selectItem(slot,getBasicManageModeByWool()).hasSelectedItem()) {
              if (event.isRightClick())               getSelectedItem().lowerPrice(calculatePrice(event.getCursor()));
 else               getSelectedItem().increasePrice(calculatePrice(event.getCursor()));
              getSelectedItem().setAsPatternItem(false);
              getSelectedItem().setPatternPrice(false);
              NBTTagEditor.removeDescription(event.getCurrentItem());
              TraderStockPart.setLore(event.getCurrentItem(),TraderStockPart.getPriceLore(getSelectedItem(),0,getBasicManageModeByWool().toString(),getStock().getPatterns(),player));
              locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",f.format(getSelectedItem().getRawPrice()));
            }
          }
          selectItem(null);
          event.setCancelled(true);
        }
 else         if (equalsTraderStatus(TraderStatus.MANAGE_LIMIT_GLOBAL)) {
          if (event.getCursor().getType().equals(Material.AIR)) {
            if (selectItem(slot,getBasicManageModeByWool()).hasSelectedItem()) {
              locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",String.valueOf(getSelectedItem().getLimits().get("String_Node_Str").getLimit()));
            }
          }
 else {
            if (selectItem(slot,getBasicManageModeByWool()).hasSelectedItem()) {
              if (getSelectedItem().getLimits().get("String_Node_Str") == null)               getSelectedItem().getLimits().set("String_Node_Str",new Limit(0,-1));
              if (event.isRightClick())               getSelectedItem().getLimits().get("String_Node_Str").changeLimit(-calculateLimit(event.getCursor()));
 else               getSelectedItem().getLimits().get("String_Node_Str").changeLimit(calculateLimit(event.getCursor()));
              NBTTagEditor.removeDescription(event.getCurrentItem());
              TraderStockPart.setLore(event.getCurrentItem(),TraderStockPart.getLimitLore(getSelectedItem(),getTraderStatus().name(),player));
              getSelectedItem().setAsPatternItem(false);
              locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",String.valueOf(getSelectedItem().getLimits().get("String_Node_Str").getLimit()));
            }
          }
          selectItem(null);
          event.setCancelled(true);
        }
 else         if (equalsTraderStatus(TraderStatus.MANAGE_LIMIT_PLAYER)) {
          if (event.getCursor().getType().equals(Material.AIR)) {
            if (selectItem(slot,getBasicManageModeByWool()).hasSelectedItem()) {
              locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",String.valueOf(getSelectedItem().getLimits().get("String_Node_Str").getLimit()));
            }
          }
 else {
            if (selectItem(slot,getBasicManageModeByWool()).hasSelectedItem()) {
              if (getSelectedItem().getLimits().get("String_Node_Str") == null)               getSelectedItem().getLimits().set("String_Node_Str",new Limit(0,-1));
              if (event.isRightClick())               getSelectedItem().getLimits().get("String_Node_Str").changeLimit(-calculateLimit(event.getCursor()));
 else               getSelectedItem().getLimits().get("String_Node_Str").changeLimit(calculateLimit(event.getCursor()));
              NBTTagEditor.removeDescription(event.getCurrentItem());
              TraderStockPart.setLore(event.getCurrentItem(),TraderStockPart.getPlayerLimitLore(getSelectedItem(),getTraderStatus().name(),player));
              getSelectedItem().setAsPatternItem(false);
              locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",String.valueOf(getSelectedItem().getLimits().get("String_Node_Str").getLimit()));
            }
          }
          selectItem(null);
          event.setCancelled(true);
        }
      }
    }
  }
 else {
    if (equalsTraderStatus(getBasicManageModeByWool())) {
      if (getInventoryClicked() && hasSelectedItem()) {
        if (equalsTraderStatus(TraderStatus.MANAGE_SELL))         trait.getStock().removeItem("String_Node_Str",getSelectedItem().getSlot());
        if (equalsTraderStatus(TraderStatus.MANAGE_BUY))         trait.getStock().removeItem("String_Node_Str",getSelectedItem().getSlot());
        selectItem(null);
        locale.sendMessage(player,"String_Node_Str");
      }
 else {
        if (event.getCurrentItem().getTypeId() != 0) {
          selectItem(toStockItem(event.getCurrentItem()));
          locale.sendMessage(player,"String_Node_Str");
        }
      }
    }
    setInventoryClicked(false);
  }
}

Fixed version (ground truth):
@Override public void managerMode(InventoryClickEvent event){
  boolean top=event.getView().convertSlot(event.getRawSlot()) == event.getRawSlot();
  int slot=event.getSlot();
  if (slot < 0) {
    event.setCancelled(true);
    switchInventory(getBasicManageModeByWool());
    return;
  }
  DecimalFormat f=new DecimalFormat("String_Node_Str");
  if (top) {
    setInventoryClicked(true);
    if (isManagementSlot(slot,3)) {
      if (isWool(event.getCurrentItem(),itemsConfig.getItemManagement(2))) {
        if (!permissionsManager.has(player,"String_Node_Str")) {
          locale.sendMessage(player,"String_Node_Str");
        }
 else {
          setTraderStatus(TraderStatus.MANAGE_PRICE);
          switchInventory(getBasicManageModeByWool(),"String_Node_Str");
          getInventory().setItem(getInventory().getSize() - 2,itemsConfig.getItemManagement(6));
          getInventory().setItem(getInventory().getSize() - 3,new ItemStack(Material.AIR));
          locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str");
        }
      }
 else       if (isWool(event.getCurrentItem(),itemsConfig.getItemManagement(6))) {
        if (isSellModeByWool())         this.setTraderStatus(TraderStatus.MANAGE_SELL);
        if (isBuyModeByWool())         this.setTraderStatus(TraderStatus.MANAGE_BUY);
        switchInventory(getBasicManageModeByWool(),"String_Node_Str");
        getInventory().setItem(getInventory().getSize() - 2,itemsConfig.getItemManagement(2));
        getInventory().setItem(getInventory().getSize() - 3,itemsConfig.getItemManagement(4));
        locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str");
      }
 else       if (isWool(event.getCurrentItem(),itemsConfig.getItemManagement(4))) {
        if (!permissionsManager.has(player,"String_Node_Str")) {
          locale.sendMessage(player,"String_Node_Str");
        }
 else {
          setTraderStatus(TraderStatus.MANAGE_LIMIT_GLOBAL);
          switchInventory(getBasicManageModeByWool(),"String_Node_Str");
          getInventory().setItem(getInventory().getSize() - 3,itemsConfig.getItemManagement(6));
          getInventory().setItem(getInventory().getSize() - 2,itemsConfig.getItemManagement(5));
          locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str");
        }
      }
 else       if (isWool(event.getCurrentItem(),itemsConfig.getItemManagement(5))) {
        if (!permissionsManager.has(player,"String_Node_Str")) {
          locale.sendMessage(player,"String_Node_Str");
        }
 else {
          setTraderStatus(TraderStatus.MANAGE_LIMIT_PLAYER);
          switchInventory(getBasicManageModeByWool(),"String_Node_Str");
          getInventory().setItem(getInventory().getSize() - 3,itemsConfig.getItemManagement(6));
          getInventory().setItem(getInventory().getSize() - 2,itemsConfig.getItemManagement(4));
          locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str");
        }
      }
 else       if (isWool(event.getCurrentItem(),itemsConfig.getItemManagement(1))) {
        if (!permissionsManager.has(player,"String_Node_Str")) {
          locale.sendMessage(player,"String_Node_Str");
        }
 else {
          switchInventory(TraderStatus.MANAGE_BUY);
          locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str");
        }
      }
 else       if (isWool(event.getCurrentItem(),itemsConfig.getItemManagement(0))) {
        if (!permissionsManager.has(player,"String_Node_Str")) {
          locale.sendMessage(player,"String_Node_Str");
        }
 else {
          switchInventory(TraderStatus.MANAGE_SELL);
          locale.sendMessage(player,"String_Node_Str");
        }
      }
 else       if (isWool(event.getCurrentItem(),itemsConfig.getItemManagement(7))) {
        saveManagedAmounts();
        switchInventory(TraderStatus.MANAGE_SELL);
        locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str");
      }
      event.setCancelled(true);
      return;
    }
 else {
      if (event.isShiftClick()) {
        if (equalsTraderStatus(TraderStatus.MANAGE_LIMIT_GLOBAL)) {
          if (event.getCursor().getType().equals(Material.AIR)) {
            if (selectItem(slot,getBasicManageModeByWool()).hasSelectedItem())             locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",String.valueOf(getSelectedItem().getLimits().timeout("String_Node_Str")));
          }
 else {
            if (selectItem(slot,getBasicManageModeByWool()).hasSelectedItem()) {
              if (getSelectedItem().getLimits().get("String_Node_Str") == null)               getSelectedItem().getLimits().set("String_Node_Str",new Limit(0,-1));
              if (event.isRightClick()) {
                getSelectedItem().getLimits().get("String_Node_Str").changeTimeout(-calculateTimeout(event.getCursor()));
              }
 else {
                getSelectedItem().getLimits().get("String_Node_Str").changeTimeout(calculateTimeout(event.getCursor()));
              }
              NBTTagEditor.removeDescription(event.getCurrentItem());
              TraderStockPart.setLore(event.getCurrentItem(),TraderStockPart.getLimitLore(getSelectedItem(),getTraderStatus().name(),player));
              locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",String.valueOf(getSelectedItem().getLimits().timeout("String_Node_Str")));
            }
          }
          selectItem(null);
          event.setCancelled(true);
          return;
        }
        if (equalsTraderStatus(TraderStatus.MANAGE_LIMIT_PLAYER)) {
          if (event.getCursor().getType().equals(Material.AIR)) {
            if (selectItem(slot,getBasicManageModeByWool()).hasSelectedItem())             locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",String.valueOf(getSelectedItem().getLimits().timeout("String_Node_Str")));
          }
 else {
            if (selectItem(slot,getBasicManageModeByWool()).hasSelectedItem()) {
              if (getSelectedItem().getLimits().get("String_Node_Str") == null)               getSelectedItem().getLimits().set("String_Node_Str",new Limit(0,-1));
              if (event.isRightClick()) {
                getSelectedItem().getLimits().get("String_Node_Str").changeTimeout(-calculateTimeout(event.getCursor()));
              }
 else {
                getSelectedItem().getLimits().get("String_Node_Str").changeTimeout(calculateTimeout(event.getCursor()));
              }
              NBTTagEditor.removeDescription(event.getCurrentItem());
              TraderStockPart.setLore(event.getCurrentItem(),TraderStockPart.getPlayerLimitLore(getSelectedItem(),getTraderStatus().name(),player));
              locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",String.valueOf(getSelectedItem().getLimits().timeout("String_Node_Str")));
            }
          }
          selectItem(null);
          event.setCancelled(true);
          return;
        }
        if (event.isLeftClick()) {
          if (equalsTraderStatus(TraderStatus.MANAGE_SELL)) {
            if (selectItem(slot,TraderStatus.MANAGE_SELL).hasSelectedItem() && permissionsManager.has(player,"String_Node_Str")) {
              switchInventory(getSelectedItem());
              setTraderStatus(TraderStatus.MANAGE_SELL_AMOUNT);
            }
          }
        }
 else {
        }
        event.setCancelled(true);
      }
 else {
        if (equalsTraderStatus(getBasicManageModeByWool())) {
          if (event.isRightClick()) {
            if (!permissionsManager.has(player,"String_Node_Str")) {
              locale.sendMessage(player,"String_Node_Str");
              selectItem(null);
              event.setCancelled(true);
              return;
            }
            if (selectItem(slot,getBasicManageModeByWool()).hasSelectedItem()) {
              if (getSelectedItem().stackPrice()) {
                getSelectedItem().setStackPrice(false);
                locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
              }
 else {
                getSelectedItem().setStackPrice(true);
                locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
              }
              NBTTagEditor.removeDescription(event.getCurrentItem());
              TraderStockPart.setLore(event.getCurrentItem(),TraderStockPart.getManageLore(getSelectedItem(),getTraderStatus().name(),player));
              getSelectedItem().setAsPatternItem(false);
            }
            selectItem(null);
            event.setCancelled(true);
            return;
          }
          if (hasSelectedItem()) {
            StockItem item=getSelectedItem();
            if (item.getSlot() == -1) {
              item.setAmount(event.getCursor().getAmount());
              if (this.isBuyModeByWool()) {
                trait.getStock().addItem("String_Node_Str",item);
                getStock().addItem("String_Node_Str",item);
              }
              if (this.isSellModeByWool()) {
                trait.getStock().addItem("String_Node_Str",item);
                getStock().addItem("String_Node_Str",item);
              }
              locale.sendMessage(player,"String_Node_Str");
            }
            if (selectItem(slot,getBasicManageModeByWool()).hasSelectedItem()) {
              getSelectedItem().setSlot(-2);
              locale.sendMessage(player,"String_Node_Str");
            }
            item.setSlot(slot);
            item.setAsPatternItem(false);
            locale.sendMessage(player,"String_Node_Str");
          }
 else {
            if (selectItem(slot,getBasicManageModeByWool()).hasSelectedItem()) {
              getSelectedItem().setSlot(-2);
              locale.sendMessage(player,"String_Node_Str");
            }
          }
          return;
        }
 else         if (equalsTraderStatus(TraderStatus.MANAGE_SELL_AMOUNT)) {
          if (!equalsSelected(event.getCursor(),true,false) && !event.getCursor().getType().equals(Material.AIR)) {
            locale.sendMessage(player,"String_Node_Str");
            event.setCancelled(true);
          }
          if (!event.getCursor().getType().equals(Material.AIR))           getSelectedItem().setAsPatternItem(false);
          return;
        }
 else         if (equalsTraderStatus(TraderStatus.MANAGE_PRICE)) {
          if (event.getCursor().getType().equals(Material.AIR)) {
            if (selectItem(slot,getBasicManageModeByWool()).hasSelectedItem())             locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",f.format(getSelectedItem().getRawPrice()));
          }
 else {
            if (selectItem(slot,getBasicManageModeByWool()).hasSelectedItem()) {
              if (event.isRightClick())               getSelectedItem().lowerPrice(calculatePrice(event.getCursor()));
 else               getSelectedItem().increasePrice(calculatePrice(event.getCursor()));
              getSelectedItem().setAsPatternItem(false);
              getSelectedItem().setPatternPrice(false);
              NBTTagEditor.removeDescription(event.getCurrentItem());
              event.setCurrentItem(TraderStockPart.setLore(event.getCurrentItem(),TraderStockPart.getPriceLore(getSelectedItem(),0,getBasicManageModeByWool().toString(),getStock().getPatterns(),player)));
              locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",f.format(getSelectedItem().getRawPrice()));
            }
          }
          selectItem(null);
          event.setCancelled(true);
        }
 else         if (equalsTraderStatus(TraderStatus.MANAGE_LIMIT_GLOBAL)) {
          if (event.getCursor().getType().equals(Material.AIR)) {
            if (selectItem(slot,getBasicManageModeByWool()).hasSelectedItem()) {
              locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",String.valueOf(getSelectedItem().getLimits().get("String_Node_Str").getLimit()));
            }
          }
 else {
            if (selectItem(slot,getBasicManageModeByWool()).hasSelectedItem()) {
              if (getSelectedItem().getLimits().get("String_Node_Str") == null)               getSelectedItem().getLimits().set("String_Node_Str",new Limit(0,-1));
              if (event.isRightClick())               getSelectedItem().getLimits().get("String_Node_Str").changeLimit(-calculateLimit(event.getCursor()));
 else               getSelectedItem().getLimits().get("String_Node_Str").changeLimit(calculateLimit(event.getCursor()));
              NBTTagEditor.removeDescription(event.getCurrentItem());
              TraderStockPart.setLore(event.getCurrentItem(),TraderStockPart.getLimitLore(getSelectedItem(),getTraderStatus().name(),player));
              getSelectedItem().setAsPatternItem(false);
              locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",String.valueOf(getSelectedItem().getLimits().get("String_Node_Str").getLimit()));
            }
          }
          selectItem(null);
          event.setCancelled(true);
        }
 else         if (equalsTraderStatus(TraderStatus.MANAGE_LIMIT_PLAYER)) {
          if (event.getCursor().getType().equals(Material.AIR)) {
            if (selectItem(slot,getBasicManageModeByWool()).hasSelectedItem()) {
              locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",String.valueOf(getSelectedItem().getLimits().get("String_Node_Str").getLimit()));
            }
          }
 else {
            if (selectItem(slot,getBasicManageModeByWool()).hasSelectedItem()) {
              if (getSelectedItem().getLimits().get("String_Node_Str") == null)               getSelectedItem().getLimits().set("String_Node_Str",new Limit(0,-1));
              if (event.isRightClick())               getSelectedItem().getLimits().get("String_Node_Str").changeLimit(-calculateLimit(event.getCursor()));
 else               getSelectedItem().getLimits().get("String_Node_Str").changeLimit(calculateLimit(event.getCursor()));
              NBTTagEditor.removeDescription(event.getCurrentItem());
              TraderStockPart.setLore(event.getCurrentItem(),TraderStockPart.getPlayerLimitLore(getSelectedItem(),getTraderStatus().name(),player));
              getSelectedItem().setAsPatternItem(false);
              locale.sendMessage(player,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",String.valueOf(getSelectedItem().getLimits().get("String_Node_Str").getLimit()));
            }
          }
          selectItem(null);
          event.setCancelled(true);
        }
      }
    }
  }
 else {
    if (equalsTraderStatus(getBasicManageModeByWool())) {
      if (getInventoryClicked() && hasSelectedItem()) {
        if (equalsTraderStatus(TraderStatus.MANAGE_SELL))         trait.getStock().removeItem("String_Node_Str",getSelectedItem().getSlot());
        if (equalsTraderStatus(TraderStatus.MANAGE_BUY))         trait.getStock().removeItem("String_Node_Str",getSelectedItem().getSlot());
        selectItem(null);
        locale.sendMessage(player,"String_Node_Str");
      }
 else {
        if (event.getCurrentItem().getTypeId() != 0) {
          selectItem(toStockItem(event.getCurrentItem()));
          locale.sendMessage(player,"String_Node_Str");
        }
      }
    }
    setInventoryClicked(false);
  }
}