public interface CrateType
Represents a specific configuration of a crate.
Defines key properties such as the display name, engine configuration, cost, and key requirements.
-
Method Summary
default org.bukkit.inventory.ItemStack
Returns a cached list of rewards that are currently valid.
Gets the type of block this crate uses.
List<String>
Returns the broadcast message sent when a reward is won.
Gets the cost engine (payment method) used to charge players when opening this crate.
String
Retrieves the display name of the crate.
Retrieves the engine data related to this crate.
Gets the engine type associated with this crate.
Returns the type of guaranteed reward associated with this crate type.
default List<String>
default double
Retrieves the hologram properties configuration associated with this instance.
String
Gets the unique identifier for this crate.
Set<String>
Gets the set of key identifiers linked to this crate.
int
Gets the cooldown time (in seconds) between openings of this crate.
double
Gets the money cost required to open the crate.
String
Gets the permission string required to open this crate, if applicable.
Returns a list of registered rewards.
Returns the registered reward with the given identifier.
String
Returns the name of the rewards menu for this crate.
String
Returns the name of the select reward menu.
boolean
Checks if this crate is enabled.
default boolean
Returns whether the guaranteed reward feature is disabled for this crate.
boolean
Checks if a key is required to open this crate.
boolean
Checks whether a permission is required to open this crate.
boolean
Returns whether players can preview the crate item before opening.
boolean
Returns whether multiple players can open this crate simultaneously.
-
Method Details
-
isEnabled
boolean isEnabled()
Checks if this crate is enabled.
If the crate is disabled, it will not be available for players to open.
- Returns:
- true if the crate is enabled, false otherwise.
-
getIdentifier
String getIdentifier()
Gets the unique identifier for this crate.
The identifier is used to reference the crate within the system.
- Returns:
- the unique identifier for the crate.
-
getDisplayName
String getDisplayName()
Retrieves the display name of the crate.
The name will be shown to players, typically in the UI or when interacting with the crate.
- Returns:
- the display name of the crate.
-
getBlockType
Gets the type of block this crate uses.
The block type could determine the appearance and interaction mechanics for the crate.
- Returns:
- the
CrateBlockType used for the crate.
-
getEngineType
Gets the engine type associated with this crate.
The engine type defines how the crate operates (e.g., animation, opening mechanics).
- Returns:
- the
EngineType for this crate.
-
getEngineData
Retrieves the engine data related to this crate.
The engine data contains the specific configurations for how the crate should behave.
- Returns:
- the
EngineData containing the crate's engine configuration.
-
getOpenMoneyCost
double getOpenMoneyCost()
Gets the money cost required to open the crate.
The cost can be a currency or in-game economy value needed to interact with the crate.
- Returns:
- the monetary cost to open this crate.
-
getCostEngineType
Gets the cost engine (payment method) used to charge players when opening this crate.
Not every tier supports pluggable cost engines; unsupported implementations will throw.
- Returns:
- the
CostEngineType for this crate.
-
getOpenCooldownSeconds
int getOpenCooldownSeconds()
Gets the cooldown time (in seconds) between openings of this crate.
- Returns:
- cooldown in seconds
-
isSimultaneousOpeningsEnabled
boolean isSimultaneousOpeningsEnabled()
Returns whether multiple players can open this crate simultaneously.
- Returns:
- true if simultaneous openings are allowed
-
isPreviewItemEnabled
boolean isPreviewItemEnabled()
Returns whether players can preview the crate item before opening.
- Returns:
- true if preview is enabled
-
isPermissionRequired
boolean isPermissionRequired()
Checks whether a permission is required to open this crate.
- Returns:
- true if a permission is required
-
getPermission
String getPermission()
Gets the permission string required to open this crate, if applicable.
- Returns:
- permission string
-
getHologramProperties
Retrieves the hologram properties configuration associated with this instance.
- Returns:
- the
HologramProperties containing all hologram-related settings and data
-
getHologramLines
@ScheduledForRemoval
@Deprecated
default List<String> getHologramLines()
Deprecated.
Returns the hologram text lines defined within the hologram properties.
This method is deprecated and scheduled for removal; use
HologramProperties.get(String) instead.
- Returns:
- a list of hologram lines, or an empty list if none are defined
-
getHologramOffset
@ScheduledForRemoval
@Deprecated
default double getHologramOffset()
Deprecated.
Returns the vertical offset value defined in the hologram properties.
This method is deprecated and scheduled for removal; use
HologramProperties.getOffset() instead.
- Returns:
- the hologram offset value
-
-
-
getBroadcastMessage
List<String> getBroadcastMessage()
Returns the broadcast message sent when a reward is won.
- Returns:
- broadcast message
-
isKeyRequired
boolean isKeyRequired()
Checks if a key is required to open this crate.
- Returns:
- true if a key is required
-
getLinkedKeysIds
Set<String> getLinkedKeysIds()
Gets the set of key identifiers linked to this crate.
These identifiers represent the different keys that can unlock the crate.
- Returns:
- a set of linked key IDs.
-
getGuaranteedRewardType
Returns the type of guaranteed reward associated with this crate type.
- Returns:
- guaranteed reward type
-
isGuaranteedRewardDisabled
default boolean isGuaranteedRewardDisabled()
Returns whether the guaranteed reward feature is disabled for this crate.
- Returns:
-
true if guaranteed rewards are disabled, false otherwise
-
getRegisteredRewards
List<? extends Reward> getRegisteredRewards()
Returns a list of registered rewards.
These rewards may be disabled or invalid, if you
need only available rewards use getAvailableRewards()
- Returns:
- list of valid rewards
-
getAvailableRewards
List<? extends Reward> getAvailableRewards()
Returns a cached list of rewards that are currently valid.
Caches the result to avoid repeatedly filtering the full reward list.
If the cache is invalidated, it will be rebuilt on next access.
- Returns:
- list of valid rewards
-
getRewardByIdentifier
Reward getRewardByIdentifier(String identifier)
Returns the registered reward with the given identifier.
Performs a case-insensitive match against the reward identifiers.
- Parameters:
-
identifier - the identifier of the reward to fetch
- Returns:
- the reward with the matching identifier, or
null if not found
-
createItemStack
default org.bukkit.inventory.ItemStack createItemStack()