Interface Crate

  • All Superinterfaces:

    public interface Crate
    extends org.bukkit.configuration.serialization.ConfigurationSerializable
    Represents a crate
    • Method Detail

      • getCrateName

        String getCrateName()
        Returns the name of the crate.
        This is the first order key of the crate configuration.
        the name of the crate
      • getDisplayName

        String getDisplayName()
        Returns the display name specified by the user.
        the user set name
      • getDisplayItem

        org.bukkit.inventory.ItemStack getDisplayItem()
        Returns the display item that is specified to be used
        in virtual menus.
        the display item
      • hasDisplayName

        boolean hasDisplayName()
        Checks whether this crate has a display name.
        true if the display name is not null, false otherwise.
      • hasDisplayItem

        boolean hasDisplayItem()
        Checks whether this crate has a display item.
        true if the display item is not null, false otherwise.
      • getType

        CrateType getType()
        Returns the type that determines the minecraft action
        that activates the crate.
      • getItem

        org.bukkit.inventory.ItemStack getItem()
        Returns the item that is given in-game to the player.
        the physical item
      • getCost

        double getCost()
        Returns the cost of a crate. The amount is set to zero if the amount is less than zero.
        the cost
      • setCost

        void setCost​(double amount)
              throws IllegalArgumentException
        Sets the cost of the crate
        amount - the cost of the crate.
        This value must be greater than or equal to zero.
        IllegalArgumentException - If the cost is negative.
      • getAnimationType

        AnimationType getAnimationType()
        Returns the animation that open when the crate activation is triggered.
      • addReward

        void addReward​(Reward reward)
        Adds a reward to the prize list. Calls Reward.setParent(Crate), and sets the parent to this crate.
        reward - The reward to add
      • removeReward

        boolean removeReward​(Reward reward)
        Removes a reward from the prize list.
        reward - The reward to remove
        true if reward was removed, false otherwise.
      • setRewards

        void setRewards​(List<Reward> rewards)
        Sets the list of rewards to a new list
        rewards - The list to set
      • getRewards

        List<Reward> getRewards()
        Returns the list of rewards. If there are no rewards, it returns the empty list.
        List of Reward
      • getConstantRewards

        List<Reward> getConstantRewards()
        Returns the list of rewards that will be given to the player no matter what. If there are no rewards, it returns the empty list.
        List of Reward
      • getMinimumRewards

        int getMinimumRewards()
        Returns the user-set attribute used to generate prizes. If the minimum is greater than the maximum, it'll return the maximum.
        minimum number of rewards.
      • getMaximumRewards

        int getMaximumRewards()
        Returns the user-set attribute used to generate prizes. If the maximum is less than the minimum, it'll return the minimum.
        maximum number of rewards.
      • getPreviewRows

        int getPreviewRows()
        Returns the number of rows in a preview menu.
        the number of rows.
      • getPreviewSlots

        int getPreviewSlots()
        Returns the number of slots in a preview menu.
        the number of slots.
      • setAnimationType

        void setAnimationType​(AnimationType type)
        Sets the animation to a AnimationType
        type - the type of animation
      • setDisplayItem

        void setDisplayItem​(org.bukkit.inventory.ItemStack item)
        Sets the display item which is displayed in virtual menus.
        item - the ItemStack
      • setItem

        void setItem​(org.bukkit.inventory.ItemStack item)
        Sets the item which is given to a player.
        item - the ItemStack
      • is

        boolean is​(org.bukkit.inventory.ItemStack item)
        Checks if an ItemStack equals this crate's item.
        The matching scheme is based on a configuration setting in the config.yml.
        The strictest setting will match with NBT. The lightest setting will compare the item's meta.
        item - the ItemStack to compare
        true if the item matches, false otherwise.
      • isBuyable

        boolean isBuyable()
        Returns whether this crate is for sale.
        true if the crate is for sale, false otherwise.
      • isPreviewable

        boolean isPreviewable()
        Returns whether this crate is previewable.
        true if the crate is previewable, false otherwise.
      • hasConfirmationToggle

        boolean hasConfirmationToggle()
        Returns whether the crate has an confirmation toggle.
        true if there is an confirmation toggle, false otherwise.
      • setConfirmationToggle

        void setConfirmationToggle​(boolean bool)
        Sets the toggle that enables or disables the confirmation menu.
        bool - the toggle.
      • setAcceptButton

        void setAcceptButton​(org.bukkit.inventory.ItemStack acceptButton)
      • getAcceptButton

        org.bukkit.inventory.ItemStack getAcceptButton()
      • setDeclineButton

        void setDeclineButton​(org.bukkit.inventory.ItemStack declineButton)
      • getDeclineButton

        org.bukkit.inventory.ItemStack getDeclineButton()
      • getHolographicText

        List<String> getHolographicText()
        Returns the set of strings used in an holographic.
        a list of strings, otherwise the empty list.
      • setHolographicText

        void setHolographicText​(List<String> texts)
        Sets the holographic text. This may be set to null to represent an empty holographic display.
        texts - a list of strings. This may be set to null.
      • runEffect

        void runEffect​(org.bukkit.Location location,
                       Category category)
      • runEffect

        void runEffect​(org.bukkit.Location location,
                       Category category,
                       org.bukkit.entity.Player player)
        Starts all effects with the given Category at the given location. If the effect category is PERSISTENT, the effect will not run if there is a previous set of effects already running at that location. If a player is specified, the effect will only be shown for the target player.
        location - the location at which the effects start.
        category - the category that triggers the effect.
        player - the player to show the effects to.
      • onRewards

        void onRewards​(org.bukkit.entity.Player player,
                       List<Reward> rewards)
        Called whenever a player triggers a win for this crate.
        player - the player who activated the crate.
        rewards - the set of rewards that was generated.
      • onRewards

        void onRewards​(org.bukkit.entity.Player player,
                       List<Reward> rewards,
                       org.bukkit.Location location)
      • onRewards

        void onRewards​(org.bukkit.entity.Player player,
                       List<Reward> rewards,
                       org.bukkit.Location location,
                       Consumer consumer)
      • setOpenMessage

        void setOpenMessage​(List<String> openMessage)
      • getBroadcastMessage

        List<String> getBroadcastMessage()
      • setBroadcastMessage

        void setBroadcastMessage​(List<String> broadcast)
      • isPlaceable

        boolean isPlaceable()
        Returns whether the crate is a placeable item.
        true if the item is placeable, false otherwise.