Interface UpgradeLevel
public interface UpgradeLevel
Represents a specific tier of upgrade to which one may have upgraded to.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
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 thatgetIcon()
Returns the default icon that's being used upgrade shopint
getLevel()
Returns level number of this upgrade levelint
getPriceAmount
(Arena arena, Team team) Returns the actual price that a team has to pay for this upgrade.int
getPriceAmount
(Player player) Returns the actual price that a player has to pay for this upgrade.Returns the DropType required to purchase the itemint
Returns amount of a specific DropType required to purchase this UpgradeLevel@Nullable UpgradeTriggerHandler
Returns UpgradeTriggerHandler used by this UpgradeLevelReturns UpgradeTriggerHandler used by this UpgradeLevelReturns upgrade that this upgrade level belongs toboolean
isTrap()
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 thatvoid
Returns the id that's being used in e.g. the shop configvoid
setPriceDropType
(DropType dropType) Sets the DropType required to purchase the itemvoid
setRegularPriceAmount
(int amount) Sets the amount of a specific DropType required to purchase this UpgradeLevel.void
setTriggerHandler
(UpgradeTriggerHandler handler) Set the UpgradeTriggerHandler used by this UpgradeLevelvoid
setTriggerHandlerId
(String handlerId) 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
Returns the id that's being used in e.g. the shop config- Parameters:
icon
- id of this item
-
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
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
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()
.
UsegetPriceAmount(Player)
orgetPriceAmount(Arena, Team)
for a more practical price amount.- Parameters:
amount
- the new price amount of this UpgradeLevel
-
getPriceAmount
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
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 returnfalse
if the handler is null- Returns:
- If this UpgradeLevel is a trap
-
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
Set the UpgradeTriggerHandler used by this UpgradeLevel- Parameters:
handler
- The new trigger handler
-
setTriggerHandlerId
Set the id of the new UpgradeTriggerHandler used by this UpgradeLevel- Parameters:
handlerId
- The new trigger handler id
-
canAfford
Returns if a player could afford to purchase an UpgradeLevel.- Returns:
- if a player has enough materials to purchase this level
-