Package eu.bedwarsia.ezcrates.api
Interface EzCratesAPI
- All Known Implementing Classes:
EzCratesAPIProvider
public interface EzCratesAPI
Public interface to interact with the EzCrates service layer.
-
Method Summary
Modifier and TypeMethodDescriptionvoidIncrements key balance for a user.Lists all loaded language codes configured in EzCrates.org.bukkit.inventory.ItemStackgetCrateDisplayItem(String crateType) Retrieves the display item representation of a crate type.Lists all loaded crate IDs.Gets the server-wide default language.static EzCratesAPIStatic instance accessor pattern for other plugins.intGets total keys available for a user for a specific crate.getPlayerLanguage(UUID playerUuid) Gets the persistent language code of a player (e.g., "en", "fr").booleanGifts a specific quantity of keys from a sender to a receiver.voidgiveRandomReward(org.bukkit.entity.Player player, String crateType) Awards a randomly rolled prize to a player and sends appropriate events/animations.voidopenPreviewGUI(org.bukkit.entity.Player player, String crateType) Displays the graphical interface showing potential crate outcomes.voidremoveKeys(UUID playerUuid, String crateType, int amount) Decrements key balance for a user, not falling below zero.voidSets the key balance for a user.voidsetPlayerLanguage(UUID playerUuid, String languageCode) Sets the persistent language code for a player.booleanAttempts to subtract a single key.translate(org.bukkit.entity.Player player, String messageKey, boolean usePrefix, Object... placeholders) Translates a message code using the player's set language.
-
Method Details
-
getInstance
Static instance accessor pattern for other plugins. -
getPlayerLanguage
Gets the persistent language code of a player (e.g., "en", "fr"). -
setPlayerLanguage
Sets the persistent language code for a player. -
getDefaultLanguage
String getDefaultLanguage()Gets the server-wide default language. -
getAvailableLanguages
Lists all loaded language codes configured in EzCrates. -
translate
String translate(org.bukkit.entity.Player player, String messageKey, boolean usePrefix, Object... placeholders) Translates a message code using the player's set language. -
getKeys
Gets total keys available for a user for a specific crate. -
setKeys
Sets the key balance for a user. -
addKeys
Increments key balance for a user. -
removeKeys
Decrements key balance for a user, not falling below zero. -
takeKey
Attempts to subtract a single key. Returns true if success, false if none available. -
giftKeys
Gifts a specific quantity of keys from a sender to a receiver. -
getCrateTypes
Lists all loaded crate IDs. -
getCrateDisplayItem
Retrieves the display item representation of a crate type. -
giveRandomReward
Awards a randomly rolled prize to a player and sends appropriate events/animations. -
openPreviewGUI
Displays the graphical interface showing potential crate outcomes.
-