Package com.tomkeuper.bedwars.api
Interface BedWars.ShopUtil
- Enclosing interface:
BedWars
public static interface BedWars.ShopUtil
The ShopUtil interface provides utility methods for managing player's money, currency, and purchases in the shop.
-
Method Summary
Modifier and TypeMethodDescriptionint
calculateMoney
(org.bukkit.entity.Player player, org.bukkit.Material currency) Retrieves the amount of money a player has in the specified currency.org.bukkit.Material
getCurrency
(String currency) Retrieves the currency material based on its name.org.bukkit.ChatColor
getCurrencyColor
(org.bukkit.Material currency) Retrieves the color associated with the specified currency material.getCurrencyMsgPath
(IContentTier contentTier) Retrieves the currency message path for the specified content tier.Retrieves the player quick buy cache instance.getRomanNumber
(int n) Retrieves the Roman numeral representation of the specified integer.Retrieves the shop cache instance.Retrieves the shop manager instance.void
takeMoney
(org.bukkit.entity.Player player, org.bukkit.Material currency, int amount) Takes the specified amount of money from the player in the specified currency.
-
Method Details
-
calculateMoney
int calculateMoney(org.bukkit.entity.Player player, org.bukkit.Material currency) Retrieves the amount of money a player has in the specified currency.- Parameters:
player
- the playercurrency
- the currency material- Returns:
- the amount of money the player has
-
getCurrency
Retrieves the currency material based on its name.- Parameters:
currency
- the currency name- Returns:
- the currency material, or
Material.AIR
if it is a vault currency
-
getCurrencyColor
org.bukkit.ChatColor getCurrencyColor(org.bukkit.Material currency) Retrieves the color associated with the specified currency material.- Parameters:
currency
- the currency material- Returns:
- the color associated with the currency
-
getCurrencyMsgPath
Retrieves the currency message path for the specified content tier.- Parameters:
contentTier
- the content tier- Returns:
- the currency message path
-
getRomanNumber
Retrieves the Roman numeral representation of the specified integer.- Parameters:
n
- the integer value (1-10)- Returns:
- the Roman numeral representation
-
takeMoney
void takeMoney(org.bukkit.entity.Player player, org.bukkit.Material currency, int amount) Takes the specified amount of money from the player in the specified currency.- Parameters:
player
- the playercurrency
- the currency materialamount
- the amount of money to take
-
getShopManager
IShopManager getShopManager()Retrieves the shop manager instance.- Returns:
- the shop manager
-
getShopCache
IShopCache getShopCache()Retrieves the shop cache instance.- Returns:
- the shop cache
-
getPlayerQuickBuyCache
IPlayerQuickBuyCache getPlayerQuickBuyCache()Retrieves the player quick buy cache instance.- Returns:
- the player quick buy cache
-