Packages com.phoenixplugins.phoenixcrates.api session

Class OpeningContext

Direct Known Subclasses:
OpeningContext.MassSelectiveOpeningContext, OpeningContext.RandomOpeningContext, OpeningContext.SelectiveOpeningContext

public abstract class OpeningContext extends Object
Represents the context of a crate opening session for a player. This includes the player's information and the type of crate opening session (e.g., random or selective).
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Represents a mass selective crate opening session where multiple rewards are chosen.
    static class 
    Represents a random crate opening session for a player.
    static class 
    Represents a selective crate opening session for a player, where a specific reward is chosen.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected Map<? extends Key,Integer>
    The map of keys and their respective quantities consumed in this session.
    protected final UUID
    The player UUID associated with this crate opening session.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.bukkit.entity.Player
    Resolves the player from Bukkit at access-time.
    abstract int
    Abstract method to get the number of required keys for this crate opening session.
    static <T extends Reward>
    OpeningContext
    massSelective(org.bukkit.entity.Player player, List<T> selectedRewards)
    Creates a crate opening context for a mass selective crate opening session.
    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 Details

    • playerId

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

      protected Map<? extends Key,Integer> keysAmount
      The map of keys and their respective quantities consumed in this session.
  • Method Details

    • 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.
      openingQuantity - The number of openings to perform.
      Returns:
      A CrateOpeningContext instance representing the random crate opening session.
    • selective

      public static <T extends Reward> OpeningContext 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.
    • massSelective

      public static <T extends Reward> OpeningContext massSelective(org.bukkit.entity.Player player, List<T> selectedRewards)
      Creates a crate opening context for a mass selective crate opening session.
      Type Parameters:
      T - The type of reward.
      Parameters:
      player - The player participating in the session.
      selectedRewards - The list of rewards selected for the session. May contain duplicates.
      Returns:
      A CrateOpeningContext instance representing the mass selective crate opening session.
Last updated 22 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