Program: 51687
Project: 51687
Buggy source:
@Override public void managerMode(InventoryClickEvent event){
  boolean top=event.getView().convertSlot(event.getRawSlot()) == event.getRawSlot();
  Player p=(Player)event.getWhoClicked();
  DecimalFormat f=new DecimalFormat("String_Node_Str");
  if (top) {
    setInventoryClicked(true);
    if (event.getSlot() >= getInventory().getSize() - 3) {
      if (isWool(event.getCurrentItem(),(byte)0) && event.getSlot() == getInventory().getSize() - 2) {
        setTraderStatus(TraderStatus.PLAYER_MANAGE_PRICE);
        getInventory().setItem(getInventory().getSize() - 2,new ItemStack(Material.WOOL,1,(short)0,(byte)15));
        getInventory().setItem(getInventory().getSize() - 3,new ItemStack(Material.AIR));
      }
 else       if (isWool(event.getCurrentItem(),(byte)15)) {
        if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)3))         setTraderStatus(TraderStatus.PLAYER_MANAGE_BUY);
        if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)5))         setTraderStatus(TraderStatus.PLAYER_MANAGE_SELL);
        getInventory().setItem(getInventory().getSize() - 2,new ItemStack(Material.WOOL,1,(short)0,(byte)0));
        getInventory().setItem(getInventory().getSize() - 3,new ItemStack(Material.WOOL,1,(short)0,(byte)0));
      }
 else       if (isWool(event.getCurrentItem(),(byte)0) && event.getSlot() == getInventory().getSize() - 3) {
        setTraderStatus(TraderStatus.PLAYER_MANAGE_LIMIT);
        getInventory().setItem(getInventory().getSize() - 3,new ItemStack(Material.WOOL,1,(short)0,(byte)13));
        getInventory().setItem(getInventory().getSize() - 2,new ItemStack(Material.AIR));
      }
 else       if (isWool(event.getCurrentItem(),(byte)13)) {
        if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)3))         setTraderStatus(TraderStatus.PLAYER_MANAGE_BUY);
        if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)5))         setTraderStatus(TraderStatus.PLAYER_MANAGE_SELL);
        getInventory().setItem(getInventory().getSize() - 3,new ItemStack(Material.WOOL,1,(short)0,(byte)0));
        getInventory().setItem(getInventory().getSize() - 2,new ItemStack(Material.WOOL,1,(short)0,(byte)0));
      }
 else       if (isWool(event.getCurrentItem(),(byte)5)) {
        switchInventory(TraderStatus.PLAYER_MANAGE_BUY);
      }
 else       if (isWool(event.getCurrentItem(),(byte)3)) {
        switchInventory(TraderStatus.PLAYER_MANAGE_SELL);
      }
 else       if (isWool(event.getCurrentItem(),(byte)14)) {
        saveManagedAmouts();
        switchInventory(TraderStatus.PLAYER_MANAGE_SELL);
      }
      event.setCancelled(true);
    }
 else {
      if (event.isShiftClick()) {
        if (getTraderStatus().equals(TraderStatus.PLAYER_MANAGE_LIMIT)) {
          if (event.getCursor().getType().equals(Material.AIR)) {
            if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)3)) {
              if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_BUY).hasSelectedItem())               p.sendMessage(ChatColor.GOLD + "String_Node_Str" + getSelectedItem().getTimeout());
            }
 else             if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)5))             if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_SELL).hasSelectedItem())             p.sendMessage(ChatColor.GOLD + "String_Node_Str" + getSelectedItem().getTimeout());
          }
 else {
            if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)3)) {
              if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_BUY).hasSelectedItem()) {
                if (event.isRightClick())                 getSelectedItem().changeTimeout(-calculateLimit(event.getCursor()));
 else                 getSelectedItem().changeTimeout(calculateLimit(event.getCursor()));
                p.sendMessage(ChatColor.GOLD + "String_Node_Str" + getSelectedItem().getTimeout());
              }
            }
 else             if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)5))             if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_SELL).hasSelectedItem()) {
              if (event.isRightClick())               getSelectedItem().changeTimeout(-calculateLimit(event.getCursor()));
 else               getSelectedItem().changeTimeout(calculateLimit(event.getCursor()));
              p.sendMessage(ChatColor.GOLD + "String_Node_Str" + getSelectedItem().getTimeout());
            }
          }
          event.setCancelled(true);
        }
        if (event.isLeftClick()) {
          if (equalsTraderStatus(TraderStatus.PLAYER_MANAGE_SELL)) {
            if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_SELL).hasSelectedItem()) {
              switchInventory(getSelectedItem());
              setTraderStatus(TraderStatus.PLAYER_MANAGE_SELL_AMOUNT);
            }
          }
        }
 else {
          if (equalsTraderStatus(TraderStatus.PLAYER_MANAGE_SELL)) {
            if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_SELL).hasSelectedItem()) {
              if (getSelectedItem().hasStackPrice()) {
                getSelectedItem().setStackPrice(true);
                p.sendMessage(ChatColor.GOLD + "String_Node_Str");
              }
 else {
                getSelectedItem().setStackPrice(true);
                p.sendMessage(ChatColor.GOLD + "String_Node_Str");
              }
            }
          }
 else           if (equalsTraderStatus(TraderStatus.PLAYER_MANAGE_BUY)) {
            if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_BUY).hasSelectedItem()) {
              if (getSelectedItem().hasStackPrice()) {
                getSelectedItem().setStackPrice(true);
                p.sendMessage(ChatColor.GOLD + "String_Node_Str");
              }
 else {
                getSelectedItem().setStackPrice(true);
                p.sendMessage(ChatColor.GOLD + "String_Node_Str");
              }
            }
          }
        }
        event.setCancelled(true);
      }
 else {
        if (equalsTraderStatus(TraderStatus.PLAYER_MANAGE_SELL)) {
          if (event.isRightClick()) {
            p.sendMessage(ChatColor.GOLD + "String_Node_Str");
            event.setCancelled(true);
            return;
          }
          if (hasSelectedItem()) {
            StockItem item=getSelectedItem();
            if (item.getSlot() == -1) {
              item.resetAmounts(event.getCursor().getAmount());
              getTraderStock().addItem(true,item);
            }
            if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_SELL).hasSelectedItem())             getSelectedItem().setSlot(-2);
            item.setSlot(event.getSlot());
          }
 else {
            if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_SELL).hasSelectedItem())             getSelectedItem().setSlot(-2);
          }
          return;
        }
 else         if (getTraderStatus().equals(TraderStatus.PLAYER_MANAGE_SELL_AMOUNT)) {
          if (!equalsSelected(event.getCursor(),true,false) && !event.getCursor().getType().equals(Material.AIR)) {
            p.sendMessage(ChatColor.GOLD + "String_Node_Str");
            event.setCancelled(true);
          }
          return;
        }
 else         if (equalsTraderStatus(TraderStatus.PLAYER_MANAGE_BUY)) {
          if (event.isRightClick()) {
            p.sendMessage(ChatColor.GOLD + "String_Node_Str");
            event.setCancelled(true);
            return;
          }
          if (hasSelectedItem()) {
            StockItem item=getSelectedItem();
            if (item.getSlot() == -1) {
              item.resetAmounts(event.getCursor().getAmount());
              getTraderStock().addItem(false,item);
            }
            if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_BUY).hasSelectedItem())             getSelectedItem().setSlot(-2);
            item.setSlot(event.getSlot());
          }
 else {
            if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_BUY).hasSelectedItem())             ;
            getSelectedItem().setSlot(-2);
          }
          return;
        }
 else         if (getTraderStatus().equals(TraderStatus.PLAYER_MANAGE_PRICE)) {
          if (event.getCursor().getType().equals(Material.AIR)) {
            if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)3)) {
              if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_BUY).hasSelectedItem())               p.sendMessage(ChatColor.GOLD + "String_Node_Str" + f.format(getSelectedItem().getRawPrice()));
            }
 else             if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)5))             if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_SELL).hasSelectedItem())             p.sendMessage(ChatColor.GOLD + "String_Node_Str" + f.format(getSelectedItem().getRawPrice()));
          }
 else {
            if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)3)) {
              if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_BUY).hasSelectedItem()) {
                if (event.isRightClick())                 getSelectedItem().lowerPrice(calculatePrice(event.getCursor()));
 else                 getSelectedItem().increasePrice(calculatePrice(event.getCursor()));
                p.sendMessage(ChatColor.GOLD + "String_Node_Str" + f.format(getSelectedItem().getRawPrice()));
              }
            }
 else             if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)5))             if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_SELL).hasSelectedItem()) {
              if (event.isRightClick())               getSelectedItem().lowerPrice(calculatePrice(event.getCursor()));
 else               getSelectedItem().increasePrice(calculatePrice(event.getCursor()));
              p.sendMessage(ChatColor.GOLD + "String_Node_Str" + f.format(getSelectedItem().getRawPrice()));
            }
          }
          event.setCancelled(true);
        }
 else         if (getTraderStatus().equals(TraderStatus.PLAYER_MANAGE_LIMIT)) {
          if (event.getCursor().getType().equals(Material.AIR)) {
            if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)3)) {
              if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_BUY).hasSelectedItem())               p.sendMessage(ChatColor.GOLD + "String_Node_Str" + getSelectedItem().getLimit());
            }
 else             if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)5))             if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_SELL).hasSelectedItem())             p.sendMessage(ChatColor.GOLD + "String_Node_Str" + getSelectedItem().getLimit());
          }
 else {
            if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)3)) {
              if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_BUY).hasSelectedItem()) {
                if (event.isRightClick())                 getSelectedItem().changeLimit(-calculateLimit(event.getCursor()));
 else                 getSelectedItem().changeLimit(calculateLimit(event.getCursor()));
                p.sendMessage(ChatColor.GOLD + "String_Node_Str" + getSelectedItem().getLimit());
              }
            }
 else             if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)5))             if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_SELL).hasSelectedItem()) {
              if (event.isRightClick())               getSelectedItem().changeLimit(-calculateLimit(event.getCursor()));
 else               getSelectedItem().changeLimit(calculateLimit(event.getCursor()));
              p.sendMessage(ChatColor.GOLD + "String_Node_Str" + getSelectedItem().getLimit());
            }
          }
          event.setCancelled(true);
        }
      }
    }
  }
 else {
    if (equalsTraderStatus(TraderStatus.PLAYER_MANAGE_SELL) || equalsTraderStatus(TraderStatus.PLAYER_MANAGE_BUY)) {
      if (getInventoryClicked() && hasSelectedItem()) {
        if (equalsTraderStatus(TraderStatus.PLAYER_MANAGE_SELL))         getTraderStock().removeItem(true,getSelectedItem().getSlot());
        if (equalsTraderStatus(TraderStatus.PLAYER_MANAGE_BUY))         getTraderStock().removeItem(false,getSelectedItem().getSlot());
        selectItem(null);
      }
 else {
        selectItem(toStockItem(event.getCurrentItem()));
      }
    }
    setInventoryClicked(false);
  }
}

Fixed version (ground truth):
@Override public void managerMode(InventoryClickEvent event){
  boolean top=event.getView().convertSlot(event.getRawSlot()) == event.getRawSlot();
  Player p=(Player)event.getWhoClicked();
  DecimalFormat f=new DecimalFormat("String_Node_Str");
  if (top) {
    setInventoryClicked(true);
    if (event.getSlot() >= getInventory().getSize() - 3) {
      if (isWool(event.getCurrentItem(),(byte)0) && event.getSlot() == getInventory().getSize() - 2) {
        setTraderStatus(TraderStatus.PLAYER_MANAGE_PRICE);
        getInventory().setItem(getInventory().getSize() - 2,new ItemStack(Material.WOOL,1,(short)0,(byte)15));
        getInventory().setItem(getInventory().getSize() - 3,new ItemStack(Material.AIR));
      }
 else       if (isWool(event.getCurrentItem(),(byte)15)) {
        if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)3))         setTraderStatus(TraderStatus.PLAYER_MANAGE_BUY);
        if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)5))         setTraderStatus(TraderStatus.PLAYER_MANAGE_SELL);
        getInventory().setItem(getInventory().getSize() - 2,new ItemStack(Material.WOOL,1,(short)0,(byte)0));
        getInventory().setItem(getInventory().getSize() - 3,new ItemStack(Material.WOOL,1,(short)0,(byte)0));
      }
 else       if (isWool(event.getCurrentItem(),(byte)0) && event.getSlot() == getInventory().getSize() - 3) {
        setTraderStatus(TraderStatus.PLAYER_MANAGE_LIMIT);
        getInventory().setItem(getInventory().getSize() - 3,new ItemStack(Material.WOOL,1,(short)0,(byte)13));
        getInventory().setItem(getInventory().getSize() - 2,new ItemStack(Material.AIR));
      }
 else       if (isWool(event.getCurrentItem(),(byte)13)) {
        if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)3))         setTraderStatus(TraderStatus.PLAYER_MANAGE_BUY);
        if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)5))         setTraderStatus(TraderStatus.PLAYER_MANAGE_SELL);
        getInventory().setItem(getInventory().getSize() - 3,new ItemStack(Material.WOOL,1,(short)0,(byte)0));
        getInventory().setItem(getInventory().getSize() - 2,new ItemStack(Material.WOOL,1,(short)0,(byte)0));
      }
 else       if (isWool(event.getCurrentItem(),(byte)5)) {
        switchInventory(TraderStatus.PLAYER_MANAGE_BUY);
      }
 else       if (isWool(event.getCurrentItem(),(byte)3)) {
        switchInventory(TraderStatus.PLAYER_MANAGE_SELL);
      }
 else       if (isWool(event.getCurrentItem(),(byte)14)) {
        saveManagedAmouts();
        switchInventory(TraderStatus.PLAYER_MANAGE_SELL);
      }
      event.setCancelled(true);
    }
 else {
      if (event.isShiftClick()) {
        if (equalsTraderStatus(TraderStatus.PLAYER_MANAGE_LIMIT)) {
          if (event.getCursor().getType().equals(Material.AIR)) {
            if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)3)) {
              if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_BUY).hasSelectedItem())               p.sendMessage(ChatColor.GOLD + "String_Node_Str" + getSelectedItem().getTimeout());
            }
 else             if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)5))             if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_SELL).hasSelectedItem())             p.sendMessage(ChatColor.GOLD + "String_Node_Str" + getSelectedItem().getTimeout());
          }
 else {
            if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)3)) {
              if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_BUY).hasSelectedItem()) {
                if (event.isRightClick())                 getSelectedItem().changeTimeout(-calculateLimit(event.getCursor()));
 else                 getSelectedItem().changeTimeout(calculateLimit(event.getCursor()));
                p.sendMessage(ChatColor.GOLD + "String_Node_Str" + getSelectedItem().getTimeout());
              }
            }
 else             if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)5))             if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_SELL).hasSelectedItem()) {
              if (event.isRightClick())               getSelectedItem().changeTimeout(-calculateLimit(event.getCursor()));
 else               getSelectedItem().changeTimeout(calculateLimit(event.getCursor()));
              p.sendMessage(ChatColor.GOLD + "String_Node_Str" + getSelectedItem().getTimeout());
            }
          }
          event.setCancelled(true);
        }
        if (event.isLeftClick()) {
          if (equalsTraderStatus(TraderStatus.PLAYER_MANAGE_SELL)) {
            if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_SELL).hasSelectedItem()) {
              switchInventory(getSelectedItem());
              setTraderStatus(TraderStatus.PLAYER_MANAGE_SELL_AMOUNT);
            }
          }
        }
 else {
          if (equalsTraderStatus(TraderStatus.PLAYER_MANAGE_SELL)) {
            if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_SELL).hasSelectedItem()) {
              if (getSelectedItem().hasStackPrice()) {
                getSelectedItem().setStackPrice(true);
                p.sendMessage(ChatColor.GOLD + "String_Node_Str");
              }
 else {
                getSelectedItem().setStackPrice(true);
                p.sendMessage(ChatColor.GOLD + "String_Node_Str");
              }
            }
          }
 else           if (equalsTraderStatus(TraderStatus.PLAYER_MANAGE_BUY)) {
            if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_BUY).hasSelectedItem()) {
              if (getSelectedItem().hasStackPrice()) {
                getSelectedItem().setStackPrice(true);
                p.sendMessage(ChatColor.GOLD + "String_Node_Str");
              }
 else {
                getSelectedItem().setStackPrice(true);
                p.sendMessage(ChatColor.GOLD + "String_Node_Str");
              }
            }
          }
        }
        event.setCancelled(true);
      }
 else {
        if (equalsTraderStatus(TraderStatus.PLAYER_MANAGE_SELL)) {
          if (event.isRightClick()) {
            p.sendMessage(ChatColor.GOLD + "String_Node_Str");
            event.setCancelled(true);
            return;
          }
          if (hasSelectedItem()) {
            StockItem item=getSelectedItem();
            if (item.getSlot() == -1) {
              item.resetAmounts(event.getCursor().getAmount());
              getTraderStock().addItem(true,item);
            }
            if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_SELL).hasSelectedItem())             getSelectedItem().setSlot(-2);
            item.setSlot(event.getSlot());
          }
 else {
            if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_SELL).hasSelectedItem())             getSelectedItem().setSlot(-2);
          }
          return;
        }
 else         if (equalsTraderStatus(TraderStatus.PLAYER_MANAGE_SELL_AMOUNT)) {
          if (!equalsSelected(event.getCursor(),true,false) && !event.getCursor().getType().equals(Material.AIR)) {
            p.sendMessage(ChatColor.GOLD + "String_Node_Str");
            event.setCancelled(true);
          }
          return;
        }
 else         if (equalsTraderStatus(TraderStatus.PLAYER_MANAGE_BUY)) {
          if (event.isRightClick()) {
            p.sendMessage(ChatColor.GOLD + "String_Node_Str");
            event.setCancelled(true);
            return;
          }
          if (hasSelectedItem()) {
            StockItem item=getSelectedItem();
            if (item.getSlot() == -1) {
              item.resetAmounts(event.getCursor().getAmount());
              getTraderStock().addItem(false,item);
            }
            if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_BUY).hasSelectedItem())             getSelectedItem().setSlot(-2);
            item.setSlot(event.getSlot());
          }
 else {
            if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_BUY).hasSelectedItem())             ;
            getSelectedItem().setSlot(-2);
          }
          return;
        }
 else         if (equalsTraderStatus(TraderStatus.PLAYER_MANAGE_PRICE)) {
          if (event.getCursor().getType().equals(Material.AIR)) {
            if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)3)) {
              if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_BUY).hasSelectedItem())               p.sendMessage(ChatColor.GOLD + "String_Node_Str" + f.format(getSelectedItem().getRawPrice()));
            }
 else             if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)5))             if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_SELL).hasSelectedItem())             p.sendMessage(ChatColor.GOLD + "String_Node_Str" + f.format(getSelectedItem().getRawPrice()));
          }
 else {
            if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)3)) {
              if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_BUY).hasSelectedItem()) {
                if (event.isRightClick())                 getSelectedItem().lowerPrice(calculatePrice(event.getCursor()));
 else                 getSelectedItem().increasePrice(calculatePrice(event.getCursor()));
                p.sendMessage(ChatColor.GOLD + "String_Node_Str" + f.format(getSelectedItem().getRawPrice()));
              }
            }
 else             if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)5))             if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_SELL).hasSelectedItem()) {
              if (event.isRightClick())               getSelectedItem().lowerPrice(calculatePrice(event.getCursor()));
 else               getSelectedItem().increasePrice(calculatePrice(event.getCursor()));
              p.sendMessage(ChatColor.GOLD + "String_Node_Str" + f.format(getSelectedItem().getRawPrice()));
            }
          }
          event.setCancelled(true);
        }
 else         if (equalsTraderStatus(TraderStatus.PLAYER_MANAGE_LIMIT)) {
          if (event.getCursor().getType().equals(Material.AIR)) {
            if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)3)) {
              if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_BUY).hasSelectedItem())               p.sendMessage(ChatColor.GOLD + "String_Node_Str" + getSelectedItem().getLimit());
            }
 else             if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)5))             if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_SELL).hasSelectedItem())             p.sendMessage(ChatColor.GOLD + "String_Node_Str" + getSelectedItem().getLimit());
          }
 else {
            if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)3)) {
              if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_BUY).hasSelectedItem()) {
                if (event.isRightClick())                 getSelectedItem().changeLimit(-calculateLimit(event.getCursor()));
 else                 getSelectedItem().changeLimit(calculateLimit(event.getCursor()));
                p.sendMessage(ChatColor.GOLD + "String_Node_Str" + getSelectedItem().getLimit());
              }
            }
 else             if (isWool(getInventory().getItem(getInventory().getSize() - 1),(byte)5))             if (selectItem(event.getSlot(),TraderStatus.PLAYER_MANAGE_SELL).hasSelectedItem()) {
              if (event.isRightClick())               getSelectedItem().changeLimit(-calculateLimit(event.getCursor()));
 else               getSelectedItem().changeLimit(calculateLimit(event.getCursor()));
              p.sendMessage(ChatColor.GOLD + "String_Node_Str" + getSelectedItem().getLimit());
            }
          }
          event.setCancelled(true);
        }
      }
    }
  }
 else {
    if (equalsTraderStatus(TraderStatus.PLAYER_MANAGE_SELL) || equalsTraderStatus(TraderStatus.PLAYER_MANAGE_BUY)) {
      if (getInventoryClicked() && hasSelectedItem()) {
        if (equalsTraderStatus(TraderStatus.PLAYER_MANAGE_SELL))         getTraderStock().removeItem(true,getSelectedItem().getSlot());
        if (equalsTraderStatus(TraderStatus.PLAYER_MANAGE_BUY))         getTraderStock().removeItem(false,getSelectedItem().getSlot());
        selectItem(null);
      }
 else {
        selectItem(toStockItem(event.getCurrentItem()));
      }
    }
    setInventoryClicked(false);
  }
}