Class DurabilityStat
java.lang.Object
studio.magemonkey.divinity.stats.items.api.ItemLoreStat<double[]>
studio.magemonkey.divinity.stats.items.attributes.stats.DurabilityStat
- All Implemented Interfaces:
TypedStat
-
Nested Class Summary
Nested classes/interfaces inherited from interface studio.magemonkey.divinity.stats.items.attributes.api.TypedStat
TypedStat.Type -
Field Summary
Fields inherited from class studio.magemonkey.divinity.stats.items.api.ItemLoreStat
dataType, format, keys, metaId, name, placeholder -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanformatValue(org.bukkit.inventory.ItemStack item, double[] values) doubleClass<double[]> getType()booleanisBroken(org.bukkit.inventory.ItemStack item) booleanisDamaged(org.bukkit.inventory.ItemStack item) booleanisMainItem(org.bukkit.inventory.ItemStack item) Deprecated.booleanbooleanisUnbreakable(org.bukkit.inventory.ItemStack item) booleanreduceDurability(org.bukkit.entity.LivingEntity li, org.bukkit.inventory.ItemStack item, int amount) voidsetCapability(double cap) voidsyncVanillaBar(org.bukkit.inventory.ItemStack item, double current, double maxCustom) Syncs the durability stat with the vanilla durability bar.Methods inherited from class studio.magemonkey.divinity.stats.items.api.ItemLoreStat
add, getFormat, getFormat, getId, getKey, getKeys, getLoreIndex, getMetaId, getMetaId, getName, getPlaceholder, getRaw, hasPlaceholder, isApplied, isSingle, preparePlaceholder, removeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface studio.magemonkey.divinity.stats.items.attributes.api.TypedStat
fineValue, getId, getPlaceholder, hasPlaceholder, isApplied
-
Constructor Details
-
DurabilityStat
-
-
Method Details
-
getParameterClass
- Specified by:
getParameterClassin classItemLoreStat<double[]>
-
getType
-
getCapability
public double getCapability()- Specified by:
getCapabilityin interfaceTypedStat
-
setCapability
public void setCapability(double cap) - Specified by:
setCapabilityin interfaceTypedStat
-
getItemType
- Specified by:
getItemTypein interfaceTypedStat
-
isPercent
public boolean isPercent() -
canBeNegative
public boolean canBeNegative()- Specified by:
canBeNegativein interfaceTypedStat
-
isMainItem
Deprecated.- Specified by:
isMainItemin interfaceTypedStat
-
getDependStat
- Specified by:
getDependStatin interfaceTypedStat
-
isUnbreakable
public boolean isUnbreakable(@NotNull org.bukkit.inventory.ItemStack item) -
isDamaged
public boolean isDamaged(@NotNull org.bukkit.inventory.ItemStack item) -
isBroken
public boolean isBroken(@NotNull org.bukkit.inventory.ItemStack item) -
reduceDurability
public boolean reduceDurability(@NotNull org.bukkit.entity.LivingEntity li, @NotNull org.bukkit.inventory.ItemStack item, int amount) -
formatValue
- Specified by:
formatValuein classItemLoreStat<double[]>
-
syncVanillaBar
public void syncVanillaBar(@NotNull org.bukkit.inventory.ItemStack item, double current, double maxCustom) Syncs the durability stat with the vanilla durability bar. Should be called after any change to the durability stat. Note: This method assumes that the durability stat is already updated with the new values before calling it.- Parameters:
item- the item that needs updatingcurrent- the current durability value on the itemmaxCustom- the max value possible to be set for the item
-