Class AProductProvider<T>
java.lang.Object
com.olziedev.playerauctions.api.expansion.PluginExpansion
com.olziedev.playerauctions.api.expansion.Expansion
com.olziedev.playerauctions.api.expansion.AProductProvider<T>
- Type Parameters:
T
- The type of product that is being auctioned.
-
Field Summary
Fields inherited from class com.olziedev.playerauctions.api.expansion.PluginExpansion
config, expansionConfig, file, integrated, plugin, registry, version
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ASerializableProduct<?>
deserializeProduct
(byte[] bytes) getCategories
(AProduct<T> product) getCategories
(T product) abstract ItemStack
getItemLore
(Auction auction, ConfigurationSection section) abstract String
getProductName
(AProduct<T> product, FileConfiguration configuration, FileConfiguration lang, boolean showDisplayName) abstract ASerializableProduct<T>
getSerializableProduct
(byte[] bytes) abstract void
giveProduct
(AProduct<T> aProduct, Player player) abstract boolean
abstract boolean
isDamagedProduct
(AProduct<T> product, Player player) abstract boolean
isInvalidProduct
(AProduct<T> product, Player player) abstract boolean
isSimilarProduct
(ASerializableProduct<?> product, ASerializableProduct<?> other) setupProduct
(Long amount, Player player) setupProduct
(Long amount, T t) abstract boolean
takeProduct
(AProduct<T> product, Player player)
-
Constructor Details
-
AProductProvider
public AProductProvider()
-
-
Method Details
-
giveProduct
- Parameters:
aProduct
- The product to be soldplayer
- The player who is buying the product
-
isInvalidProduct
- Parameters:
product
- The product to be sold.player
- The player who is selling the product.- Returns:
- If the product can be sold.
-
isDamagedProduct
- Parameters:
product
- The product to be sold.player
- The player who is selling the product.- Returns:
- If the product is damaged.
-
isCorrect
- 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
- Parameters:
product
- The product to be sold.player
- The player who is selling the product.
-
setupProduct
- Parameters:
amount
- The amount of products to be soldplayer
- The player who is selling the product.- Returns:
- The product.
-
setupProduct
- Parameters:
amount
- The amount of products to be soldt
- The product to be sold.- Returns:
- The product.
-
getSerializableProduct
- Parameters:
bytes
- The bytes of the product.- Returns:
- The serialized product.
-
getIcon
- Parameters:
product
- The product to be sold.- Returns:
- The item stack of the product.
-
getCategories
- Parameters:
product
- The product to be sold.- Returns:
- The categories of the product.
-
getCategories
- 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
- 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
- Parameters:
bytes
- The bytes of the product.- Returns:
- The deserialized product.
- Throws:
Exception
-