Interface CrateRegistrar


  • public interface CrateRegistrar
    Contains methods used to manipulate and retrieve a crate.
    • Method Detail

      • createReward

        Reward createReward()
        Creates a default reward.
        Returns:
        Reward
      • createReward

        Reward createReward​(String line)
        Creates a reward using a reward line.
        Parameters:
        line - reward line
        Returns:
        Reward
      • getCrate

        Crate getCrate​(org.bukkit.inventory.ItemStack item)
        Retrieves the specified Crate with a item.
        Parameters:
        item - ItemStack
        Returns:
        Crate
      • getCrate

        Crate getCrate​(String str)
        Retrieves the specified Crate given the crate identifier name.
        Parameters:
        str - Crate Identifier
        Returns:
        Crate
      • getCrateFromDisplayName

        List<Crate> getCrateFromDisplayName​(String str)
        Retrieves the specified Crate given the display name.
        Parameters:
        str - Display Name
        Returns:
        Crate
      • getCrates

        List<Crate> getCrates()
        Returns a list of crates
        Returns:
        a list of crates
      • isCrate

        boolean isCrate​(org.bukkit.inventory.ItemStack item)
        Checks if the item represents a crate.
        Parameters:
        item - ItemStack
        Returns:
        true if the item is a crate, false otherwise.
      • add

        void add​(Crate crate)
        Adds a crate to the plugin. This registers the crate and makes it available to use.
        Parameters:
        crate - The crate that you want to add
      • remove

        void remove​(Crate crate)
        Removes a crate from the plugin. This unregisters the crate from the plugin. Actions will no longer be handled by this crate if you do so.
        Parameters:
        crate - The crate that you will remove
      • generateCrateRewards

        List<Reward> generateCrateRewards​(Crate crate,
                                          org.bukkit.entity.Player player)
        Uses the built-in reward generator to pick a prize for a player. The reward has to pass the permission check before it is put into the list.
        Parameters:
        player - The player who should win this reward set.
        Returns:
        List of Reward specifically for a Player
      • open

        void open​(Crate crate,
                  org.bukkit.entity.Player player,
                  org.bukkit.Location location)
      • open

        void open​(Crate crate,
                  org.bukkit.entity.Player player,
                  org.bukkit.Location location,
                  Map<String,​Object> settings)
      • openConfirmationPage

        void openConfirmationPage​(Crate crate,
                                  org.bukkit.entity.Player player,
                                  org.bukkit.Location location)
      • preview

        void preview​(Crate crate,
                     org.bukkit.entity.Player player)
        Previews a crate in a built-in menu.
        Parameters:
        crate - The crate that will be previewed
        player - The player who wants to see the crate
      • previewAll

        void previewAll​(List<Crate> crates,
                        org.bukkit.entity.Player player)
        Previews all crates in a built-in menu.
        Parameters:
        crates - The list of crates to be viewed
        player - The player who wants to see the crate
      • purchase

        boolean purchase​(Crate crate,
                         org.bukkit.entity.Player player,
                         int amount)
        Sends a player amount of this crate and withdraws the cost of the crate.
        Parameters:
        player - The player who wants to purchase the crate.
        amount - The amount that the player wants to purchase.
        Returns:
        true if the transaction is successful, otherwise false.
      • giveCrate

        void giveCrate​(Crate crate,
                       org.bukkit.entity.Player player,
                       int amount)
        Gives the specified player the specified amount of crates.
        Parameters:
        player - The player to give the crate to.
        amount - The amount to give
      • getCrateString

        String getCrateString()