コード例 #1
0
 private ItemStack getIcon(PlayerShopOffer offer) {
   if (offer.getType().equals(OfferType.SELL)) {
     return getSellIcon(offer);
   } else {
     return getBuyIcon(offer);
   }
 }
コード例 #2
0
 private void handleTrade(Player player, InventoryClickEvent event, PlayerShopOffer offer) {
   if (offer.getType().equals(OfferType.SELL)) {
     if (getSession().getPermissionsProvider().has(player, ASPermissionKey.BUY_ITEMS)) {
       PlayerSellOfferMenu.open(this, (PlayerSellOffer) offer, player);
     } else {
       getSession().getTranslator().$(player, ASMessageKey.NO_PERMISSION);
     }
   } else {
     if (getSession().getPermissionsProvider().has(player, ASPermissionKey.SELL_ITEMS)) {
       PlayerBuyOfferMenu.open(this, (PlayerBuyOffer) offer, player);
     } else {
       getSession().getTranslator().$(player, ASMessageKey.NO_PERMISSION);
     }
   }
 }