public interface Cost
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkSupported(MageController controller,
String... fallbackTypes)
Convert this to cost to a different type if the current cost is not supported.
|
void |
convert(MageController controller,
String newType)
Change the type of this cost, converting the amount using global conversion configurations.
|
void |
deduct(Mage mage)
Deduct these costs from the specified Mage
|
void |
deduct(Mage mage,
CasterProperties caster,
CostReducer reducer)
Deduct these costs from the specified Mage
|
void |
deduct(Mage mage,
Wand wand)
Deduct these costs from the specified Mage
|
void |
deduct(Mage mage,
Wand wand,
CostReducer reducer)
Deduct these costs from the specified Mage
|
double |
getBalance(Mage mage,
CasterProperties caster)
Get the amount of this cost type a Mage has.
|
String |
getDescription(Messages messages)
Get a human-readable description of this cost.
|
String |
getDescription(Messages messages,
CostReducer reducer)
Get a human-readable description of this cost.
|
String |
getFullDescription(Messages messages)
Get a human-readable description of this cost.
|
String |
getFullDescription(Messages messages,
CostReducer reducer)
Get a human-readable description of this cost.
|
org.bukkit.inventory.ItemStack |
getItemStack()
Get a copy of the item represented by this cost.
|
String |
getType()
This will return the currency type key or item key.
|
boolean |
give(Mage mage,
CasterProperties caster)
Give these costs to the specified Mage
|
boolean |
has(Mage mage)
Whether or not a mage has the required costs.
|
boolean |
has(Mage mage,
CasterProperties caster,
CostReducer reducer)
Whether or not a mage has the required costs.
|
boolean |
has(Mage mage,
Wand wand)
Whether or not a mage has the required costs.
|
boolean |
has(Mage mage,
Wand wand,
CostReducer reducer)
Whether or not a mage has the required costs.
|
boolean |
isEmpty()
Whether or not this record has any costs associated with it.
|
boolean |
isEmpty(CostReducer reducer)
Whether or not this record has any costs associated with it.
|
boolean |
isItem()
Check to see if this Cost is an ItemStack
|
void |
scale(double scale)
Multiply this cost by a scale value.
|
boolean isEmpty()
boolean isEmpty(CostReducer reducer)
reducer - The CostReducer to use for calculating costsboolean has(Mage mage, CasterProperties caster, CostReducer reducer)
mage - The mage to check for costscaster - A optional caster, to be used for mana costsreducer - An optional scale for costsboolean has(Mage mage, Wand wand, CostReducer reducer)
mage - The mage to check for costswand - A optional wand, to be used for mana costsreducer - An optional scale for costsboolean has(Mage mage, Wand wand)
mage - The mage to check for costswand - A optional wand, to be used for mana costsboolean has(Mage mage)
mage - The mage to check for costsvoid deduct(Mage mage, CasterProperties caster, CostReducer reducer)
mage - The mage to check for costscaster - A optional caster, to be used for mana costsreducer - An optional scale for costsvoid deduct(Mage mage, Wand wand)
mage - The mage to check for costswand - A optional wand, to be used for mana costsvoid deduct(Mage mage, Wand wand, CostReducer reducer)
mage - The mage to check for costswand - A optional wand, to be used for mana costsreducer - An optional scale for costsvoid deduct(Mage mage)
mage - The mage to check for costsboolean give(Mage mage, CasterProperties caster)
mage - The mage to give these costs tocaster - A optional caster, to be used for mana costsdouble getBalance(Mage mage, CasterProperties caster)
mage - The mage to checkcaster - A optional caster, to be used for mana costsString getDescription(Messages messages, CostReducer reducer)
For XP, display text will be determined by the CostReducer if it uses Mana.
This does not include the amount, and only the label - e.g. "Bread" or "Mana" or "XP".
messages - The Messages class for looking up localizationsreducer - An optional scale for costsString getDescription(Messages messages)
For XP, display text will be determined by the CostReducer if it uses Mana.
This does not include the amount, and only the label - e.g. "Bread" or "Mana" or "XP".
messages - The Messages class for looking up localizationsString getFullDescription(Messages messages, CostReducer reducer)
For XP, display text will be determined by the CostReducer if it uses Mana.
This includes the amount as well as the label - e.g. "2 Bread" or "30 Mana" or "50 XP".
messages - The Messages class for looking up localizationsreducer - An optional scale for costsString getFullDescription(Messages messages)
For XP, display text will be determined by the CostReducer if it uses Mana.
This includes the amount as well as the label - e.g. "2 Bread" or "30 Mana" or "50 XP".
messages - The Messages class for looking up localizations@Nonnull String getType()
org.bukkit.inventory.ItemStack getItemStack()
This will return null for non-item costs.
boolean isItem()
void scale(double scale)
scale - The cost multiplier.boolean checkSupported(@Nonnull MageController controller, @Nonnull String... fallbackTypes)
controller - The controller to use to check for currency supportfallbackTypes - The types to use if this costs' type is not supportedvoid convert(@Nonnull MageController controller, @Nonnull String newType)
controller - The controller to look up conversion ratesnewType - The new type of this cost.Copyright © 2021 elMakers. All rights reserved.