Package com.olziedev.playerauctions.api
Class PlayerAuctionsAPI
java.lang.Object
com.olziedev.playerauctions.api.PlayerAuctionsAPI
- All Implemented Interfaces:
- PluginAPI
The main class for accessing and using the API.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionabstract voidcreatePlayerAuction(double price, ACurrency currency, String internalCurrency, APlayer seller, AProduct<?> product, boolean bid, Consumer<Auction> callback) Creates a player auction with the product specified.abstract voidcreatePlayerAuction(double price, APlayer seller, AProduct<?> product, boolean bid, Consumer<Auction> callback) Creates a player auction with the product specified.abstract voidcreateSafePlayerAuction(double price, Long amount, ACurrency currency, String internalCurrency, APlayer seller, AProductProvider<?> productProvider, boolean bid, Consumer<Auction> callback) Creates a player auction with product specified.abstract voidcreateSafePlayerAuction(double price, Long amount, APlayer seller, AProductProvider<?> productProvider, boolean bid, Consumer<Auction> callback) Creates a player auction with product specified.abstract ACategorygetAuctionCategory(String category) abstract APlayergetAuctionPlayer(UUID uuid) abstract AuctionSortTypeabstract CommandRegistryabstract AProductProvider<?> static PlayerAuctionsAPIstatic voidWaits for the instance of the API when it is ready.abstract AuctiongetPlayerAuction(long id, CommandSender sender) getPlayerAuctions(CommandSender sender) abstract AuctionupdateAuction(long id, UUID uuid) Updates the current auction with its new data, if the auction doesn't exist then a new auction object will be created and added to the cache automatically.abstract APlayerupdateAuctionPlayer(UUID uuid) Updates the current player with its new data, if the player isn't in cache then it won't do anything and return null.Methods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.olziedev.playerauctions.api.PluginAPIcreateConfigItem, getExpansionRegistry, getPlugin, sendMessage
- 
Constructor Details- 
PlayerAuctionsAPIpublic PlayerAuctionsAPI()
 
- 
- 
Method Details- 
getInstance- Returns:
- The instance of the API.
 
- 
getInstanceWaits for the instance of the API when it is ready.- Parameters:
- api- Callback with the instance of the API.
 
- 
getPlayerAuction- Parameters:
- id- The id of the auction to get.
- sender- The command sender, this is to check if they can see specific auctions or not.
- Returns:
- The requested auction object.
 
- 
createPlayerAuctionpublic abstract void createPlayerAuction(double price, APlayer seller, AProduct<?> product, boolean bid, Consumer<Auction> callback) Creates a player auction with the product specified.- Parameters:
- price- The price of the auction.
- seller- The seller of the auction.
- product- The product to use.
- bid- If the auction type is a bid.
- callback- Callback of the created auction instance.
 
- 
createPlayerAuctionpublic abstract void createPlayerAuction(double price, ACurrency currency, String internalCurrency, APlayer seller, AProduct<?> product, boolean bid, Consumer<Auction> callback) Creates a player auction with the product specified.- Parameters:
- price- The price of the auction.
- currency- The currency to use for this auction, can be null to use the default currency or use- createPlayerAuction(double, APlayer, AProduct, boolean, Consumer).
- internalCurrency- The internal currency to use for this auction, can be null to use the default currency or use- createPlayerAuction(double, APlayer, AProduct, boolean, Consumer).
- seller- The seller of the auction.
- product- The product to use.
- bid- If the auction type is a bid.
- callback- Callback of the created auction instance.
 
- 
createSafePlayerAuctionpublic abstract void createSafePlayerAuction(double price, Long amount, APlayer seller, AProductProvider<?> productProvider, boolean bid, Consumer<Auction> callback) Creates a player auction with product specified. (using the checks the sell command uses).- Parameters:
- price- The price of the auction.
- amount- The amount of the product, can be null to just use the actual amount of the product.
- seller- The seller of the auction.
- productProvider- The product provider to use.
- bid- If the auction type is a bid.
- callback- Callback of the created auction instance.
 
- 
createSafePlayerAuctionpublic abstract void createSafePlayerAuction(double price, Long amount, ACurrency currency, String internalCurrency, APlayer seller, AProductProvider<?> productProvider, boolean bid, Consumer<Auction> callback) Creates a player auction with product specified. (using the checks the sell command uses).- Parameters:
- price- The price of the auction.
- amount- The amount of the product, can be null to just use the actual amount of the product.
- currency- The currency to use for this auction.
- internalCurrency- The internal currency to use for this auction.
- seller- The seller of the auction.
- productProvider- The product provider to use.
- bid- If the auction type is a bid.
- callback- Callback of the created auction instance.
 
- 
getDefaultProductProvider- Returns:
- The default product provider to use when creating auctions.
 
- 
getPlayerAuctions- Returns:
- List of the active auctions on the server.
 
- 
getPlayerAuctions- Parameters:
- sender- The command sender, this is to check if they can see specific auctions or not.
- Returns:
- List of the active auctions on the server.
 
- 
updateAuctionUpdates the current auction with its new data, if the auction doesn't exist then a new auction object will be created and added to the cache automatically.- Parameters:
- id- An existing auction that needs to be updated.
- uuid- The owner of the existing auction.
- Returns:
- The new updated cache version of the auction object.
 
- 
updateAuctionPlayerUpdates the current player with its new data, if the player isn't in cache then it won't do anything and return null.- Parameters:
- uuid- The player's UUID to update.
- Returns:
- The new updated cache version of the player object.
 
- 
getAuctionCategory- Parameters:
- category- The category name.
- Returns:
- The requested category object.
 
- 
getAuctionCategories- Returns:
- List of the currently loaded auction categories.
 
- 
getAuctionPlayer- Parameters:
- uuid- The uuid of a player to get.
- Returns:
- The requested auction player object.
 
- 
getAuctionPlayers- Returns:
- List of the currently loaded auction players.
 
- 
getCommandRegistry- Returns:
- The command registry to manage the plugin sub-commands.
 
- 
getAuctionSortType- Returns:
- The default auction sort type from the configuration.
 
 
-