Package org.spongepowered.api.data.type
Interface ShieldItemDamageFunction.MultiplyAdd
- Enclosing interface:
ShieldItemDamageFunction<T>
public static interface ShieldItemDamageFunction.MultiplyAdd
The final amount of damage will be
constantDamage + fractionalDamage * attackDamage-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface -
Method Summary
Modifier and TypeMethodDescriptionbuilder()doubleReturns the constant amount of damage taken.doubleReturns fractional amount of damage to take, where a factor of 1 means that the amount of durability lost is equal to attack damage, and a factor of 0 that no durability is lost.doubleReturns the minimum amount of damage blocked attack must have had, for the item to take damage at all.
-
Method Details
-
builder
-
minAttackDamage
double minAttackDamage()Returns the minimum amount of damage blocked attack must have had, for the item to take damage at all.- Returns:
- minimum attack damage required for any durability loss
-
constantDamage
double constantDamage()Returns the constant amount of damage taken.- Returns:
- a constant amount of damage to take
-
fractionalDamage
double fractionalDamage()Returns fractional amount of damage to take, where a factor of 1 means that the amount of durability lost is equal to attack damage, and a factor of 0 that no durability is lost.- Returns:
- fractional amount of damage to take
-