Package fr.maxlego08.zauctionhouse.api
Interface AuctionItem
public interface AuctionItem
-
Method Summary
Modifier and TypeMethodDescriptionbuildTransaction(long price) Builds a transaction for the auction item at the specified price.booleancanBuy()Checks if the item can be bought.org.bukkit.inventory.ItemStackcreateItem(org.bukkit.entity.Player player, Message message) Creates an item stack with specific player and message attributes.intGets the amount of items in the item stack.org.bukkit.OfflinePlayergetBuyer()Gets the buyer of the auction item as anOfflinePlayer.Gets the UUID of the buyer.Gets the UUID of the buyer.Gets the economy type used in the auction.Gets the name of the economy type used.longGets the expiration time of the auction item.org.bukkit.inventory.ItemStackGets the item stack representing the auction item.List<org.bukkit.inventory.ItemStack>Gets the list of item stacks associated with the auction item.longgetPrice()Gets the price of the auction item.intGets the priority of the auction item.org.bukkit.OfflinePlayerGets the seller of the auction item as anOfflinePlayer.Gets the name of the seller.Gets the UUID of the seller.Gets the server name associated with the auction item.Gets the storage type of the auction item.getType()Gets the type of the auction.Gets the unique identifier for the item.voidgiveIf(org.bukkit.entity.Player player, Predicate<AuctionItem> predicate) Gives the auction item to a player if the specified predicate is satisfied.booleanhasFreeSpace(org.bukkit.entity.Player player) Checks if the player has free space for the item.booleanChecks if the item is already being bought.booleanChecks if the auction item has expired.booleanMatches the auction item with a specified filter and string.Formats the price of the auction item as a string.Serializes the item stack to a string.Serializes the list of item stacks to a list of strings.voidsetAlreadyBuying(boolean b) Sets whether the item is already being bought.voidSets the buyer of the auction item using their UUID.voidsetCanBuy(boolean b) Sets whether the item can be bought.voidsetExpireAt(long expireAt) Sets the expiration time of the auction item.voidsetPrice(long price) Sets the price of the auction item.voidsetStorageType(StorageType storageType) Sets the storage type of the auction item.statusFormat(UUID uniqueId) Formats the status of the auction item based on the specified unique ID.Formats the remaining time of the auction item as a string.
-
Method Details
-
getUniqueId
UUID getUniqueId()Gets the unique identifier for the item.- Returns:
- the UUID of the item.
-
getItemStack
org.bukkit.inventory.ItemStack getItemStack()Gets the item stack representing the auction item.- Returns:
- the
ItemStack.
-
getType
AuctionType getType()Gets the type of the auction.- Returns:
- the
AuctionType.
-
getPrice
long getPrice()Gets the price of the auction item.- Returns:
- the price.
-
setPrice
void setPrice(long price) Sets the price of the auction item.- Parameters:
price- the price to set.
-
getEconomy
AuctionEconomy getEconomy()Gets the economy type used in the auction.- Returns:
- the
AuctionEconomy.
-
getEconomyName
String getEconomyName()Gets the name of the economy type used.- Returns:
- the economy name.
-
getSeller
org.bukkit.OfflinePlayer getSeller()Gets the seller of the auction item as anOfflinePlayer.- Returns:
- the seller.
-
getBuyer
org.bukkit.OfflinePlayer getBuyer()Gets the buyer of the auction item as anOfflinePlayer.- Returns:
- the buyer.
-
setBuyer
Sets the buyer of the auction item using their UUID.- Parameters:
uuid- the UUID of the buyer.
-
getSellerUniqueId
UUID getSellerUniqueId()Gets the UUID of the seller.- Returns:
- the UUID of the seller.
-
getBuyerUniqueId
UUID getBuyerUniqueId()Gets the UUID of the buyer.- Returns:
- the UUID of the buyer.
-
getExpireAt
long getExpireAt()Gets the expiration time of the auction item.- Returns:
- the expiration time in milliseconds.
-
setExpireAt
void setExpireAt(long expireAt) Sets the expiration time of the auction item.- Parameters:
expireAt- the expiration time in milliseconds.
-
serializedItem
String serializedItem()Serializes the item stack to a string.- Returns:
- the serialized item stack.
-
createItem
Creates an item stack with specific player and message attributes.- Parameters:
player- the player for whom the item is created.message- the message associated with the item.- Returns:
- the created
ItemStack.
-
canBuy
boolean canBuy()Checks if the item can be bought.- Returns:
- true if the item can be bought, false otherwise.
-
setCanBuy
void setCanBuy(boolean b) Sets whether the item can be bought.- Parameters:
b- true if the item can be bought, false otherwise.
-
isAlreadyBuying
boolean isAlreadyBuying()Checks if the item is already being bought.- Returns:
- true if the item is already being bought, false otherwise.
-
setAlreadyBuying
void setAlreadyBuying(boolean b) Sets whether the item is already being bought.- Parameters:
b- true if the item is already being bought, false otherwise.
-
getAmount
int getAmount()Gets the amount of items in the item stack.- Returns:
- the amount of items.
-
buildTransaction
Builds a transaction for the auction item at the specified price.- Parameters:
price- the price for the transaction.- Returns:
- the
Transaction.
-
getItemStacks
List<org.bukkit.inventory.ItemStack> getItemStacks()Gets the list of item stacks associated with the auction item.- Returns:
- a list of
ItemStacks.
-
serializedItems
Serializes the list of item stacks to a list of strings.- Returns:
- a list of serialized item stacks.
-
hasFreeSpace
boolean hasFreeSpace(org.bukkit.entity.Player player) Checks if the player has free space for the item.- Parameters:
player- the player to check.- Returns:
- true if the player has free space, false otherwise.
-
match
Matches the auction item with a specified filter and string.- Parameters:
optional- the optional filter to match.string- the string to match.- Returns:
- true if the item matches the filter and string, false otherwise.
-
isExpired
boolean isExpired()Checks if the auction item has expired.- Returns:
- true if the item has expired, false otherwise.
-
getStorageType
StorageType getStorageType()Gets the storage type of the auction item.- Returns:
- the
StorageType.
-
setStorageType
Sets the storage type of the auction item.- Parameters:
storageType- the storage type to set.
-
getSellerName
String getSellerName()Gets the name of the seller.- Returns:
- the seller's name.
-
giveIf
Gives the auction item to a player if the specified predicate is satisfied.- Parameters:
player- the player to give the item to.predicate- the predicate to check.
-
getPriority
int getPriority()Gets the priority of the auction item.- Returns:
- the priority.
-
priceFormat
String priceFormat()Formats the price of the auction item as a string.- Returns:
- the formatted price.
-
timeFormat
String timeFormat()Formats the remaining time of the auction item as a string.- Returns:
- the formatted time.
-
statusFormat
Formats the status of the auction item based on the specified unique ID.- Parameters:
uniqueId- the unique ID to check the status against.- Returns:
- the formatted status.
-
getBuyerUUID
UUID getBuyerUUID()Gets the UUID of the buyer.- Returns:
- the UUID of the buyer.
-
getServer
String getServer()Gets the server name associated with the auction item.- Returns:
- the server name.
-