Package de.marcely.bedwars.api.cosmetics
Interface CosmeticsAPI
public interface CosmeticsAPI
The main API class of the MBedwars' Cosmetics&Coins add-on.
-
Method Summary
Modifier and TypeMethodDescriptionstatic CosmeticsAPI
get()
Get the instance of the API.@Nullable CosmeticItem
Gets a cosmetic by itsCosmeticItem.getId()
.Returns all available cosmetics.Returns all available currencies.@Nullable Currency
Gets a currency by itsCurrency.getId()
.void
getPlayerData
(Player player, Consumer<CosmeticPlayer> callback) Loads and returns the player's data.Get all players that have a shop open.Returns all available rarities.@Nullable Rarity
getRarityById
(String id) Gets a rarity by itsRarity.getId()
.@Nullable Shop
getShopById
(String id) Get a shop (page) by itsShop.getId()
.@Nullable Shop
getShopOpen
(Player player) Get the shop (page) that the player has open.getShops()
Returns all configured shop (pages).boolean
hasShopOpen
(Player player) Get if the player has a shop open.
-
Method Details
-
getCosmetics
Collection<CosmeticItem> getCosmetics()Returns all available cosmetics.- Returns:
- All available cosmetics
-
getCosmeticById
Gets a cosmetic by itsCosmeticItem.getId()
.- Parameters:
id
- The id to match- Returns:
- The cosmetic or
null
if not found
-
getRarities
Collection<Rarity> getRarities()Returns all available rarities.- Returns:
- All available rarities
-
getRarityById
Gets a rarity by itsRarity.getId()
.- Parameters:
id
- The id to match- Returns:
- The rarity or
null
if not found
-
getCurrencies
Collection<Currency> getCurrencies()Returns all available currencies.- Returns:
- All available currencies
-
getCurrencyById
Gets a currency by itsCurrency.getId()
.- Parameters:
id
- The id to match- Returns:
- The currency or
null
if not found
-
getPlayerData
Loads and returns the player's data.Player data is loaded asynchronously and the callback is called on the server's main-thread when the data is loaded.
- Parameters:
player
- The player to load the data forcallback
- The callback to call when the data is loaded
-
getShops
Collection<Shop> getShops()Returns all configured shop (pages).- Returns:
- All configured shops
-
getShopById
Get a shop (page) by itsShop.getId()
.- Parameters:
id
- The id to match- Returns:
- The shop or
null
if not found
-
hasShopOpen
Get if the player has a shop open.- Parameters:
player
- The player to check- Returns:
true
if the player has a shop open,false
otherwise
-
getShopOpen
Get the shop (page) that the player has open.- Parameters:
player
- The player to check- Returns:
- The shop that the player has open,
null
if the player has no shop open
-
getPlayersWithShopOpen
Collection<Player> getPlayersWithShopOpen()Get all players that have a shop open.- Returns:
- All players that have a shop open
-
get
Get the instance of the API.- Returns:
- The instance of the API
-