Promotion background
Easter Season IS HERE!
10% off limited time offer!
Ends in
00
H
00
M
00
S
limited time offer SAVE 10% NOW →
Packages com.phoenixplugins.phoenixcrates.api session
com.phoenixplugins.phoenixcrates.api.session

Class OpeningContext

  • java.lang.Object
    • com.phoenixplugins.phoenixcrates.api.session.OpeningContext
    • Nested Class Summary

      Modifier and Type Class and Description
      static class  OpeningContext.RandomOpeningContext
      Represents a random crate opening session for a player.
      static class  OpeningContext.SelectiveOpeningContext
      Represents a selective crate opening session for a player, where a specific reward is chosen.
    • Field Summary

      Modifier and Type Field and Description
      protected Map<? extends Key,Integer> keysAmount 
      protected UUID playerId
      The player UUID associated with this crate opening session.
    • Method Summary

      Modifier and Type Method and Description
      org.bukkit.entity.Player getPlayer()
      Resolves the player from Bukkit at access-time.
      abstract int getRequiredKeys()
      Abstract method to get the number of required keys for this crate opening session.
      static OpeningContext random(org.bukkit.entity.Player player, boolean requireKeyInMainHand, int openingQuantity)
      Creates a crate opening context for a random crate opening session.
      static <T extends Reward>
      OpeningContext
      selective(org.bukkit.entity.Player player, T selectedReward)
      Creates a crate opening context for a selective crate opening session.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • playerId

        protected final UUID playerId
        The player UUID associated with this crate opening session.
      • keysAmount

        protected Map<? extends Key,Integer> keysAmount
    • Method Detail

      • getPlayer

        public org.bukkit.entity.Player getPlayer()
        Resolves the player from Bukkit at access-time.
        Returns:
        Online player for this context.
        Throws:
        IllegalStateException - when the player cannot be resolved.
      • getRequiredKeys

        public abstract int getRequiredKeys()
        Abstract method to get the number of required keys for this crate opening session.
        Returns:
        The number of keys required for the session.
      • random

        public static OpeningContext random(org.bukkit.entity.Player player,
                                            boolean requireKeyInMainHand,
                                            int openingQuantity)
        Creates a crate opening context for a random crate opening session.
        Parameters:
        player - The player participating in the session.
        requireKeyInMainHand - Whether the key is required to be in the player's main hand.
        Returns:
        A CrateOpeningContext instance representing the random crate opening session.
      • selective

        public static <T extends RewardOpeningContext selective(org.bukkit.entity.Player player,
                                                                  T selectedReward)
        Creates a crate opening context for a selective crate opening session.
        Type Parameters:
        T - The type of reward.
        Parameters:
        player - The player participating in the session.
        selectedReward - The specific crate reward selected for the session.
        Returns:
        A CrateOpeningContext instance representing the selective crate opening session.
Last updated about 3 hours ago
My Cart (0 items)

Oops... looks like the spiders padded through here

Add products to your cart and remove them from here Lets buy
This site uses cookies to personalize content, enhance your experience. By continuing, you agree to our cookie use. Learn more