Packages com.phoenixplugins.phoenixcrates.api reward

Interface AlternativeReward

All Superinterfaces:
BaseReward

public interface AlternativeReward extends BaseReward
Represents an alternative reward that can be given to a player. Alternative rewards are used when the primary reward is not available or as a fallback option. This interface implements the BaseReward interface to provide shared functionality.
  • Method Details

    • isEnabled

      boolean isEnabled()
      Checks if this alternative reward is enabled. If the reward is disabled, it won't be awarded to players.
      Returns:
      true if the alternative reward is enabled, false otherwise.
    • getItem

      @Deprecated Item getItem()
      Deprecated.

      This method is deprecated and will be removed in the future. Instead of using getItem(), you should use getDisplayItem().

      It is recommended to start using getDisplayItem() immediately for better compatibility with future versions.

      Returns:
      the ItemStack representing the alternative reward (deprecated method).
    • isVirtual

      @Deprecated boolean isVirtual()
      Deprecated.

      This method is deprecated and will be removed in the future. Instead of using isVirtual(), you should use getDisplayItem() or getWinItems().

      This method is only provided for compatibility with the older system and should not be used going forward.

      Returns:
      whether the reward is virtual (deprecated).
    • getDisplayItem

      default Item getDisplayItem()
      Retrieves the display item for this alternative reward. The display item is shown as a visual representation of the reward, such as an icon in the UI.
      Specified by:
      getDisplayItem in interface BaseReward
      Returns:
      an Optional containing the display ItemStack, or empty if no display item is set.
    • getWinItems

      default List<? extends Item> getWinItems()
      Gets the list of items the player will win when they receive this alternative reward. This can be a list of ItemStacks that represent physical items given to the player.
      Specified by:
      getWinItems in interface BaseReward
      Returns:
      a list of ItemStacks representing the reward items.
    • isAlternative

      default boolean isAlternative()
      Overrides the method from BaseReward to indicate if this is an alternative reward.
      Specified by:
      isAlternative in interface BaseReward
      Returns:
      true, since this is always an alternative reward.
    • getIdentifier

      default String getIdentifier()
      Description copied from interface: BaseReward
      Gets the unique identifier for this crate reward. The identifier is typically used to reference or track the reward within the crate system.
      Specified by:
      getIdentifier in interface BaseReward
      Returns:
      the unique identifier for the reward.
    • getWeight

      default double getWeight()
      Description copied from interface: BaseReward
      Gets the weight of this reward used for weighted-random selection. Higher weight = higher probability relative to other rewards.
      Specified by:
      getWeight in interface BaseReward
      Returns:
      the weight value of this reward.
Last updated 10 days ago
My Cart
Spider

Your cart is empty

Looks like the spiders padded through here. Pick a plugin and it will show up here. Continue shopping