public class IslandUpgradeEvent extends IslandEvent implements org.bukkit.event.Cancellable
island
Constructor and Description |
---|
IslandUpgradeEvent(SuperiorPlayer superiorPlayer,
Island island,
java.lang.String upgradeName,
java.util.List<java.lang.String> commands,
UpgradeCost upgradeCost)
|
IslandUpgradeEvent(SuperiorPlayer superiorPlayer,
Island island,
Upgrade upgrade,
UpgradeLevel upgradeLevel,
java.util.List<java.lang.String> commands,
UpgradeCost upgradeCost)
The constructor for the event.
|
Modifier and Type | Method and Description |
---|---|
double |
getAmountToWithdraw()
Deprecated.
See getCost()
|
java.util.List<java.lang.String> |
getCommands()
Get the commands that will be ran upon upgrade.
|
java.math.BigDecimal |
getCost()
Get the amount that will be withdrawn.
|
SuperiorPlayer |
getPlayer()
Get the player who upgraded the island.
|
Upgrade |
getUpgrade()
Get the name of the upgrade.
|
UpgradeCost |
getUpgradeCost()
Get the upgrade cost that is used.
|
UpgradeLevel |
getUpgradeLevel()
Get the level that will be upgraded to.
|
java.lang.String |
getUpgradeName()
Get the name of the upgrade.
|
boolean |
isCancelled() |
void |
setAmountToWithdraw(double amountToWithdraw)
Deprecated.
See setCost(BigDecimal)
|
void |
setCancelled(boolean cancelled) |
void |
setCost(java.math.BigDecimal cost)
Set the amount that will be withdrawn.
|
void |
setUpgradeCost(UpgradeCost upgradeCost)
Set a new upgrade cost to be used.
|
getHandlerList, getHandlers, getIsland
@Deprecated public IslandUpgradeEvent(@Nullable SuperiorPlayer superiorPlayer, Island island, java.lang.String upgradeName, java.util.List<java.lang.String> commands, @Nullable UpgradeCost upgradeCost)
IslandUpgradeEvent(SuperiorPlayer, Island, Upgrade, UpgradeLevel, List, UpgradeCost)
superiorPlayer
- The player who upgraded the island. Can be null if ran by the console.island
- The island that was upgraded.upgradeName
- The name of the upgrade.commands
- The commands that will be ran upon upgrade.upgradeCost
- The cost of the upgradepublic IslandUpgradeEvent(@Nullable SuperiorPlayer superiorPlayer, Island island, Upgrade upgrade, UpgradeLevel upgradeLevel, java.util.List<java.lang.String> commands, @Nullable UpgradeCost upgradeCost)
superiorPlayer
- The player who upgraded the island.
Can be null if ran by the console.island
- The island that was upgraded.upgrade
- The upgrade.upgradeLevel
- The level that will be upgraded into.commands
- The commands that will be running upon upgrade.upgradeCost
- The cost of the upgrade.
If null, there was no cost for the upgrade (For example, setupgrade command).@Nullable public SuperiorPlayer getPlayer()
public java.lang.String getUpgradeName()
public Upgrade getUpgrade()
public UpgradeLevel getUpgradeLevel()
public java.util.List<java.lang.String> getCommands()
@Nullable public UpgradeCost getUpgradeCost()
public void setUpgradeCost(@Nullable UpgradeCost upgradeCost)
upgradeCost
- The new upgrade cost.@Deprecated public double getAmountToWithdraw()
@Deprecated public void setAmountToWithdraw(double amountToWithdraw)
public java.math.BigDecimal getCost()
public void setCost(java.math.BigDecimal cost) throws java.lang.IllegalStateException
cost
- The new amount to be withdrawn.java.lang.IllegalStateException
- If the upgradeCost is null. Use setUpgradeCost(UpgradeCost)
instead.public boolean isCancelled()
isCancelled
in interface org.bukkit.event.Cancellable
public void setCancelled(boolean cancelled)
setCancelled
in interface org.bukkit.event.Cancellable