Class EzCratesAPIProvider

java.lang.Object
eu.bedwarsia.ezcrates.api.EzCratesAPIProvider
All Implemented Interfaces:
EzCratesAPI

public final class EzCratesAPIProvider extends Object implements EzCratesAPI
  • Method Details

    • register

      public static void register(eu.bedwarsia.ezcrates.EzCrates plugin)
    • unregister

      public static void unregister()
    • getInstance

      public static EzCratesAPI getInstance()
    • getPlayerLanguage

      public String getPlayerLanguage(UUID playerUuid)
      Description copied from interface: EzCratesAPI
      Gets the persistent language code of a player (e.g., "en", "fr").
      Specified by:
      getPlayerLanguage in interface EzCratesAPI
    • setPlayerLanguage

      public void setPlayerLanguage(UUID playerUuid, String languageCode)
      Description copied from interface: EzCratesAPI
      Sets the persistent language code for a player.
      Specified by:
      setPlayerLanguage in interface EzCratesAPI
    • getDefaultLanguage

      public String getDefaultLanguage()
      Description copied from interface: EzCratesAPI
      Gets the server-wide default language.
      Specified by:
      getDefaultLanguage in interface EzCratesAPI
    • getAvailableLanguages

      public List<String> getAvailableLanguages()
      Description copied from interface: EzCratesAPI
      Lists all loaded language codes configured in EzCrates.
      Specified by:
      getAvailableLanguages in interface EzCratesAPI
    • translate

      public String translate(org.bukkit.entity.Player player, String messageKey, boolean usePrefix, Object... placeholders)
      Description copied from interface: EzCratesAPI
      Translates a message code using the player's set language.
      Specified by:
      translate in interface EzCratesAPI
    • getKeys

      public int getKeys(UUID playerUuid, String crateType)
      Description copied from interface: EzCratesAPI
      Gets total keys available for a user for a specific crate.
      Specified by:
      getKeys in interface EzCratesAPI
    • setKeys

      public void setKeys(UUID playerUuid, String crateType, int amount)
      Description copied from interface: EzCratesAPI
      Sets the key balance for a user.
      Specified by:
      setKeys in interface EzCratesAPI
    • addKeys

      public void addKeys(UUID playerUuid, String crateType, int amount)
      Description copied from interface: EzCratesAPI
      Increments key balance for a user.
      Specified by:
      addKeys in interface EzCratesAPI
    • removeKeys

      public void removeKeys(UUID playerUuid, String crateType, int amount)
      Description copied from interface: EzCratesAPI
      Decrements key balance for a user, not falling below zero.
      Specified by:
      removeKeys in interface EzCratesAPI
    • takeKey

      public boolean takeKey(UUID playerUuid, String crateType)
      Description copied from interface: EzCratesAPI
      Attempts to subtract a single key. Returns true if success, false if none available.
      Specified by:
      takeKey in interface EzCratesAPI
    • giftKeys

      public boolean giftKeys(UUID senderUuid, UUID receiverUuid, String crateType, int amount)
      Description copied from interface: EzCratesAPI
      Gifts a specific quantity of keys from a sender to a receiver.
      Specified by:
      giftKeys in interface EzCratesAPI
    • getCrateTypes

      public Set<String> getCrateTypes()
      Description copied from interface: EzCratesAPI
      Lists all loaded crate IDs.
      Specified by:
      getCrateTypes in interface EzCratesAPI
    • getCrateDisplayItem

      public org.bukkit.inventory.ItemStack getCrateDisplayItem(String crateType)
      Description copied from interface: EzCratesAPI
      Retrieves the display item representation of a crate type.
      Specified by:
      getCrateDisplayItem in interface EzCratesAPI
    • giveRandomReward

      public void giveRandomReward(org.bukkit.entity.Player player, String crateType)
      Description copied from interface: EzCratesAPI
      Awards a randomly rolled prize to a player and sends appropriate events/animations.
      Specified by:
      giveRandomReward in interface EzCratesAPI
    • openPreviewGUI

      public void openPreviewGUI(org.bukkit.entity.Player player, String crateType)
      Description copied from interface: EzCratesAPI
      Displays the graphical interface showing potential crate outcomes.
      Specified by:
      openPreviewGUI in interface EzCratesAPI