public static boolean canPlayerAffordTradingFee(Player player,int price){
  BigDecimal fee=calculateFee(player,price);
  List<Item> allEquipped=player.getAllEquipped("money");
  int ownedMoney=0;
  for (  Item item : allEquipped) {
    Money m=(Money)item;
    ownedMoney+=m.getQuantity();
  }
  return fee.intValue() <= ownedMoney;
}

public static boolean canPlayerAffordTradingFee ( Player player , int price ) { BigDecimal fee = calculateFee ( player , price ) ; List < Item > allEquipped = player . getAllEquipped ( "money" ) ; int ownedMoney = 0 ; for ( Item item : allEquipped ) { Money m = ( Money ) item ; ownedMoney += m . getQuantity ( ) ; } return fee . intValue ( ) <= ownedMoney ; }
checks if a player can afford the trading fee depending on price
