Interface XPrisonAutoSellAPI
public interface XPrisonAutoSellAPI
API interface for the AutoSell feature.
Provides methods for managing selling blocks, pricing, and player earnings.
-
Method Summary
Modifier and TypeMethodDescriptiondouble
getCurrentEarnings
(org.bukkit.entity.Player player) Gets the current total earnings of a player from auto-selling.double
getPriceForBlock
(org.bukkit.block.Block block) Gets the price for a given block.double
getPriceForItem
(SellRegion region, org.bukkit.inventory.ItemStack item) Gets the price of a specific item in a given sell region.getSellRegionAtLocation
(org.bukkit.Location location) Gets the sell region at a specified location.Gets a collection of all loaded and active sell regions.boolean
hasAutoSellEnabled
(org.bukkit.entity.Player p) Checks if a player has auto-sell enabled.void
sellBlocks
(org.bukkit.entity.Player player, List<org.bukkit.block.Block> blocks) Sells the specified list of blocks on behalf of the player.
-
Method Details
-
getCurrentEarnings
double getCurrentEarnings(org.bukkit.entity.Player player) Gets the current total earnings of a player from auto-selling.- Parameters:
player
- the player whose earnings to retrieve- Returns:
- the current earnings of the player
-
getPriceForItem
Gets the price of a specific item in a given sell region.- Parameters:
region
- the sell region to check pricing initem
- the item to get the price for- Returns:
- the price of the item in the specified region
-
getPriceForBlock
double getPriceForBlock(org.bukkit.block.Block block) Gets the price for a given block.- Parameters:
block
- the block to get the price for- Returns:
- the price of the block
-
sellBlocks
Sells the specified list of blocks on behalf of the player.- Parameters:
player
- the player selling the blocksblocks
- the list of blocks to sell
-
hasAutoSellEnabled
boolean hasAutoSellEnabled(org.bukkit.entity.Player p) Checks if a player has auto-sell enabled.- Parameters:
p
- the player to check- Returns:
true
if auto-sell is enabled for the player,false
otherwise
-
getSellRegions
Collection<SellRegion> getSellRegions()Gets a collection of all loaded and active sell regions.- Returns:
- a collection of all sell regions
-
getSellRegionAtLocation
Gets the sell region at a specified location.- Parameters:
location
- the location to check- Returns:
- the sell region at the given location, or
null
if none exists there
-