Interface CosmeticsAPI


public interface CosmeticsAPI
The main API class of the MBedwars' Cosmetics&Coins add-on.
  • Method Details

    • getCosmetics

      Collection<CosmeticItem> getCosmetics()
      Returns all available cosmetics.
      Returns:
      All available cosmetics
    • getCosmeticById

      @Nullable @Nullable CosmeticItem getCosmeticById(String id)
      Gets a cosmetic by its CosmeticItem.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

      @Nullable @Nullable Rarity getRarityById(String id)
      Gets a rarity by its Rarity.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

      @Nullable @Nullable Currency getCurrencyById(String id)
      Gets a currency by its Currency.getId().
      Parameters:
      id - The id to match
      Returns:
      The currency or null if not found
    • getPlayerData

      void getPlayerData(Player player, Consumer<CosmeticPlayer> callback)
      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 for
      callback - The callback to call when the data is loaded
    • getShops

      Collection<Shop> getShops()
      Returns all configured shop (pages).
      Returns:
      All configured shops
    • getShopById

      @Nullable @Nullable Shop getShopById(String id)
      Get a shop (page) by its Shop.getId().
      Parameters:
      id - The id to match
      Returns:
      The shop or null if not found
    • hasShopOpen

      boolean hasShopOpen(Player player)
      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

      @Nullable @Nullable Shop getShopOpen(Player player)
      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

      static CosmeticsAPI get()
      Get the instance of the API.
      Returns:
      The instance of the API