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
public abstract class AbstractModifierEvent<T extends ModifierFunction<M>,M> extends AbstractEvent
An abstract base class for implementations ofDamageEntityEvent
.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<T>
modifierFunctions
protected java.util.LinkedHashMap<M,java.lang.Double>
modifiers
protected double
originalFinalAmount
protected java.util.Map<M,java.lang.Double>
originalModifierMap
protected java.util.List<Tuple<M,java.lang.Double>>
originalModifiers
-
Fields inherited from class org.spongepowered.api.event.impl.AbstractEvent
currentOrder
-
-
Constructor Summary
Constructors Constructor Description AbstractModifierEvent()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract T
convertTuple(M obj, java.util.function.DoubleUnaryOperator function)
protected double
finalAmount(double baseAmount)
protected ImmutableList<T>
init(double originalValue, java.util.List<T> originalFunctions)
java.util.List<T>
modifiers()
Gets the modifiers affecting this event.protected void
recalculateDamages(double baseAmount)
-
Methods inherited from class org.spongepowered.api.event.impl.AbstractEvent
init
-
-
-
-
Field Detail
-
originalFinalAmount
protected double originalFinalAmount
-
originalModifierMap
protected java.util.Map<M,java.lang.Double> originalModifierMap
-
modifiers
protected final java.util.LinkedHashMap<M,java.lang.Double> modifiers
-
modifierFunctions
protected final java.util.List<T extends ModifierFunction<M>> modifierFunctions
-
-
Method Detail
-
init
protected ImmutableList<T> init(double originalValue, java.util.List<T> originalFunctions)
-
convertTuple
protected abstract T convertTuple(M obj, java.util.function.DoubleUnaryOperator function)
-
recalculateDamages
protected void recalculateDamages(double baseAmount)
-
finalAmount
protected double finalAmount(double baseAmount)
-
modifiers
public java.util.List<T> modifiers()
Gets the modifiers affecting this event.- Returns:
- The list of modifiers
-
-