Class AbstractModifierEvent<T extends ModifierFunction<M>,M>
java.lang.Object
org.spongepowered.api.event.impl.AbstractEvent
org.spongepowered.api.event.impl.entity.AbstractModifierEvent<T,M>
- Type Parameters:
T
- The modifier type to use
- All Implemented Interfaces:
Event
- Direct Known Subclasses:
AbstractAttackEntityEvent
,AbstractDamageEntityEvent
An abstract base class for implementations of
DamageEntityEvent
.-
Field Summary
Modifier and TypeFieldDescriptionprotected final LinkedHashMap
<M, Tuple<Double, Double>> protected double
Fields inherited from class org.spongepowered.api.event.impl.AbstractEvent
currentOrder
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract T
convertTuple
(M obj, DoubleUnaryOperator function) protected double
finalAmount
(double baseAmount) static <T extends ModifierFunction<M>,
M>
Map<String, Double> finalAmounts
(double baseAmount, List<T> modifiers) Gets the modifiers affecting this event.protected double
recalculate
(double baseAmount) Methods inherited from class org.spongepowered.api.event.impl.AbstractEvent
init
-
Field Details
-
originalFinalAmount
protected double originalFinalAmount -
originalModifiers
-
originalModifierMap
-
modifiers
-
modifierFunctions
-
-
Constructor Details
-
AbstractModifierEvent
public AbstractModifierEvent()
-
-
Method Details
-
init
-
convertTuple
-
recalculate
protected double recalculate(double baseAmount) -
finalAmount
protected double finalAmount(double baseAmount) -
finalAmounts
public static <T extends ModifierFunction<M>,M> Map<String,Double> finalAmounts(double baseAmount, List<T> modifiers) -
modifiers
Gets the modifiers affecting this event.- Returns:
- The list of modifiers
-