Interface UpgradeLevel


public interface UpgradeLevel
Represents a specific tier of upgrade to which one may have upgraded to.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canAfford(Player player)
    Returns if a player could afford to purchase an UpgradeLevel.
    double
    Returns the amplifier applied to this upgrade level.
    int
    Gets the duration (in seconds) of an UpgradeLevel.
    @Nullable Integer
    Returns the slot at which it'll be placed at after the rendering of the upgrade shop layout GUI Can be null if it shouldn't do that
    Returns the default icon that's being used upgrade shop
    int
    Returns level number of this upgrade level
    int
    getPriceAmount(Arena arena, Team team)
    Returns the actual price that a team has to pay for this upgrade.
    int
    Returns the actual price that a player has to pay for this upgrade.
    Returns the DropType required to purchase the item
    int
    Returns amount of a specific DropType required to purchase this UpgradeLevel
    Returns UpgradeTriggerHandler used by this UpgradeLevel
    Returns UpgradeTriggerHandler used by this UpgradeLevel
    Returns upgrade that this upgrade level belongs to
    boolean
    Returns whether this UpgradeLevel is a trap.
    void
    setAmplifier(double amplifier)
    Sets the amplifier applied to this upgrade level.
    void
    setDuration(int duration)
    Sets the duration (in seconds) of an UpgradeLevel.
    void
    setForceSlot(@Nullable Integer forceSlot)
    Define at which it shall be forced at after the rendering of the upgrade shop GUI
    Can be null if it shouldn't do that
    void
    Returns the id that's being used in e.g. the shop config
    void
    Sets the DropType required to purchase the item
    void
    Sets the amount of a specific DropType required to purchase this UpgradeLevel.
    void
    Set the UpgradeTriggerHandler used by this UpgradeLevel
    void
    Set the id of the new UpgradeTriggerHandler used by this UpgradeLevel
  • Method Details

    • getUpgrade

      Upgrade getUpgrade()
      Returns upgrade that this upgrade level belongs to
      Returns:
      The upgrade that owns this level
    • getLevel

      int getLevel()
      Returns level number of this upgrade level
      Returns:
      The level of this item
    • getIcon

      ItemStack getIcon()
      Returns the default icon that's being used upgrade shop
      Returns:
      The id of this item
    • setIcon

      void setIcon(ItemStack icon)
      Returns the id that's being used in e.g. the shop config
      Parameters:
      icon - id of this item
    • getForceSlot

      @Nullable @Nullable Integer getForceSlot()
      Returns the slot at which it'll be placed at after the rendering of the upgrade shop layout GUI Can be null if it shouldn't do that
      Returns:
      The slot at which it shall be forced at
    • setForceSlot

      void setForceSlot(@Nullable @Nullable Integer forceSlot)
      Define at which it shall be forced at after the rendering of the upgrade shop GUI
      Can be null if it shouldn't do that
      Parameters:
      forceSlot - The new value
    • setPriceDropType

      void setPriceDropType(DropType dropType)
      Sets the DropType required to purchase the item
      Parameters:
      dropType - the price of this upgrade
    • getPriceDropType

      DropType getPriceDropType()
      Returns the DropType required to purchase the item
      Returns:
      the price of this upgrade
    • setDuration

      void setDuration(int duration)
      Sets the duration (in seconds) of an UpgradeLevel. Not all upgrade handlers require a duration
      Parameters:
      duration - the duration (in seconds) of this UpgradeLevel
    • getDuration

      int getDuration()
      Gets the duration (in seconds) of an UpgradeLevel. Not all upgrade handlers require a duration. Returns 0 if this is the case
      Returns:
      the duration (in seconds) of this UpgradeLevel
    • setRegularPriceAmount

      void setRegularPriceAmount(int amount)
      Sets the amount of a specific DropType required to purchase this UpgradeLevel.

      The actual price may vary by factors such as e.g. Upgrade.isPriceAutoScaling().
      Use getPriceAmount(Player) or getPriceAmount(Arena, Team) for a more practical price amount.

      Parameters:
      amount - the new price amount of this UpgradeLevel
    • getPriceAmount

      int getPriceAmount(Player player)
      Returns the actual price that a player has to pay for this upgrade.

      The actual price may vary by factors such as e.g. Upgrade.isPriceAutoScaling().

      Returns:
      the current price amount of this UpgradeLevel
    • getPriceAmount

      int getPriceAmount(Arena arena, Team team)
      Returns the actual price that a team has to pay for this upgrade.

      The actual price may vary by factors such as e.g. Upgrade.isPriceAutoScaling().

      Returns:
      The current practical price amount of this UpgradeLevel
    • getRegularPriceAmount

      int getRegularPriceAmount()
      Returns amount of a specific DropType required to purchase this UpgradeLevel
      Returns:
      the current price amount of this UpgradeLevel
    • getAmplifier

      double getAmplifier()
      Returns the amplifier applied to this upgrade level. Used to determine how powerful an upgrade should be
      Returns:
      the amplifier applied to this UpgradeLevel
    • setAmplifier

      void setAmplifier(double amplifier)
      Sets the amplifier applied to this upgrade level. Used to determine how powerful an upgrade should be
      Parameters:
      amplifier - the new amplifier
    • isTrap

      boolean isTrap()
      Returns whether this UpgradeLevel is a trap. Will also return false if the handler is null
      Returns:
      If this UpgradeLevel is a trap
    • getTriggerHandler

      @Nullable @Nullable UpgradeTriggerHandler getTriggerHandler()
      Returns UpgradeTriggerHandler used by this UpgradeLevel
      Returns:
      The UpgradeTriggerHandler used by this UpgradeLevel.null when it hasn't been registered yet
    • getTriggerHandlerId

      String getTriggerHandlerId()
      Returns UpgradeTriggerHandler used by this UpgradeLevel
      Returns:
      The UpgradeTriggerHandler used by this UpgradeLevel.
    • setTriggerHandler

      void setTriggerHandler(UpgradeTriggerHandler handler)
      Set the UpgradeTriggerHandler used by this UpgradeLevel
      Parameters:
      handler - The new trigger handler
    • setTriggerHandlerId

      void setTriggerHandlerId(String handlerId)
      Set the id of the new UpgradeTriggerHandler used by this UpgradeLevel
      Parameters:
      handlerId - The new trigger handler id
    • canAfford

      boolean canAfford(Player player)
      Returns if a player could afford to purchase an UpgradeLevel.
      Returns:
      if a player has enough materials to purchase this level