Package org.spongepowered.api.data.type
Interface ShieldDamageReduction.MultiplyAdd
- Enclosing interface:
ShieldDamageReduction<T>
public static interface ShieldDamageReduction.MultiplyAdd
The final amount of blocked damage will be
constantReduction + fractionalReduction * damage-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()doubleReturns the constant amount of damage to be blocked.Returns thedamage typesthis reduction applies to.doubleReturns fractional amount of damage to block, where a factor of 1 means that all damage is blocked, and a factor of 0 that no damage is blocked.doubleReturns the maximum angle between the users facing direction and the direction of the incoming attack.
-
Method Details
-
builder
-
damageTypes
Optional<Set<DamageType>> damageTypes()Returns thedamage typesthis reduction applies to.Optional.empty()means this reduction is not restricted to any given damage type.- Returns:
- the affected damage types
-
horizontalBlockingAngle
double horizontalBlockingAngle()Returns the maximum angle between the users facing direction and the direction of the incoming attack.- Returns:
- the maximum angle
-
constantReduction
double constantReduction()Returns the constant amount of damage to be blocked.- Returns:
- a constant amount of damage to block
-
fractionalReduction
double fractionalReduction()Returns fractional amount of damage to block, where a factor of 1 means that all damage is blocked, and a factor of 0 that no damage is blocked.- Returns:
- fractional amount of damage to block
-