Exemple #1
0
  /**
   * Set number of stacked items.
   *
   * @param newCount the number of items on this stack, in case its more then one a text is
   *     displayed next to the item that shown how many items are on the stack
   */
  public void setCount(@Nullable ItemCount newCount) {
    count = newCount;

    // write number to text for display
    if (ItemCount.isGreaterOne(count)) {
      number = new TextTag(count.getShortText(Lang.getInstance().getLocale()), Color.YELLOW);
    } else {
      number = null;
    }
  }
 /**
  * Create a new instance of that merchant item.
  *
  * @param itemIndex the index of the item in the list of items that was send by the server
  * @param itemType the type of the item
  * @param id the ID of the item
  * @param itemName the name of the item
  * @param itemPrice the price of the item in copper coins
  */
 public MerchantItem(
     int itemIndex, MerchantItemType itemType, ItemId id, String itemName, long itemPrice) {
   this(itemIndex, itemType, id, itemName, itemPrice, ItemCount.getInstance(1));
 }