Ejemplo n.º 1
0
 private ItemStack getSellIcon(PlayerShopOffer offer) {
   ItemStack icon = new ItemStack(offer.getItem().getItemStack());
   icon.setAmount(1);
   String priceLine =
       ChatColor.GRAY
           + getSession().getTranslator().$(ASMessageKey.SHOP_INV_ICON_SELL)
           + ChatColor.RED
           + " "
           + OffersUtils.getFormatedPrice(offer.getPrice());
   String amountLine = ChatColor.GRAY + "x" + offer.getItem().getAmount();
   String ownerLine = ChatColor.GRAY + shop.getOwnerName();
   InventoryUtils.appendLore(icon, priceLine, amountLine, ownerLine);
   return icon;
 }
Ejemplo n.º 2
0
 public void updateIcon(int slot) {
   PlayerShopOffer offer = shop.getOffers().get(slot);
   if (offer != null)
     for (PlayerShopOffer o : offer.getItem().getOffers())
       inventory.setItem(o.getSlot(), getIcon(o));
 }