Class AProductProvider<T>

Type Parameters:
T - The type of product that is being auctioned.

public abstract class AProductProvider<T> extends Expansion
  • Constructor Details

    • AProductProvider

      public AProductProvider()
  • Method Details

    • giveProduct

      public abstract void giveProduct(AProduct<T> aProduct, Player player)
      Parameters:
      aProduct - The product to be sold
      player - The player who is buying the product
    • isInvalidProduct

      public abstract boolean isInvalidProduct(AProduct<T> product, Player player)
      Parameters:
      product - The product to be sold.
      player - The player who is selling the product.
      Returns:
      If the product can be sold.
    • isDamagedProduct

      public abstract boolean isDamagedProduct(AProduct<T> product, Player player)
      Parameters:
      product - The product to be sold.
      player - The player who is selling the product.
      Returns:
      If the product is damaged.
    • isCorrect

      public abstract boolean isCorrect(AProduct<T> product, Player player)
      Parameters:
      product - The product to be sold.
      player - The player who is selling the product.
      Returns:
      If the product is valid.
    • isSimilarProduct

      public abstract boolean isSimilarProduct(ASerializableProduct<?> product, ASerializableProduct<?> other)
      Parameters:
      product - The first product to be compared.
      other - The second product to be compared.
      Returns:
      The product.
    • takeProduct

      public abstract boolean takeProduct(AProduct<T> product, Player player)
      Parameters:
      product - The product to be sold.
      player - The player who is selling the product.
    • setupProduct

      public abstract AProduct<T> setupProduct(Long amount, Player player)
      Parameters:
      amount - The amount of products to be sold
      player - The player who is selling the product.
      Returns:
      The product.
    • setupProduct

      public abstract AProduct<T> setupProduct(Long amount, T t)
      Parameters:
      amount - The amount of products to be sold
      t - The product to be sold.
      Returns:
      The product.
    • getSerializableProduct

      public abstract ASerializableProduct<T> getSerializableProduct(byte[] bytes)
      Parameters:
      bytes - The bytes of the product.
      Returns:
      The serialized product.
    • getIcon

      public abstract ItemStack getIcon(AProduct<T> product)
      Parameters:
      product - The product to be sold.
      Returns:
      The item stack of the product.
    • getCategories

      public abstract List<ACategory> getCategories(AProduct<T> product)
      Parameters:
      product - The product to be sold.
      Returns:
      The categories of the product.
    • getCategories

      public abstract List<ACategory> getCategories(T product)
      Parameters:
      product - The product to be sold.
      Returns:
      The categories of the product.
    • getProductName

      public abstract String getProductName(AProduct<T> product, FileConfiguration configuration, FileConfiguration lang, boolean showDisplayName)
      Parameters:
      product - The product to be sold.
      configuration - The configuration of the product.
      lang - The language of the product.
      showDisplayName - If the item has a display name, it'll return the item name. (coloured)
      Returns:
      The name of the product.
    • getItemLore

      public abstract List<String> getItemLore(Auction auction, ConfigurationSection section)
      Parameters:
      auction - The auction that the product is being sold in.
      section - The configuration section of what gui it's using.
      Returns:
      The name of the product.
    • deserializeProduct

      public static ASerializableProduct<?> deserializeProduct(byte[] bytes) throws Exception
      Parameters:
      bytes - The bytes of the product.
      Returns:
      The deserialized product.
      Throws:
      Exception