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 of DamageEntityEvent.
  • Field Details

    • originalFinalAmount

      protected double originalFinalAmount
    • originalModifiers

      protected List<Tuple<M,Double>> originalModifiers
    • originalModifierMap

      protected Map<M,Double> originalModifierMap
    • modifiers

      protected final LinkedHashMap<M,Double> modifiers
    • modifierFunctions

      protected final List<T extends ModifierFunction<M>> modifierFunctions
  • Constructor Details

    • AbstractModifierEvent

      public AbstractModifierEvent()
  • Method Details

    • init

      protected ImmutableList<T> init(double originalValue, List<T> originalFunctions)
    • convertTuple

      protected abstract T convertTuple(M obj, DoubleUnaryOperator function)
    • recalculateDamages

      protected void recalculateDamages(double baseAmount)
    • finalAmount

      protected double finalAmount(double baseAmount)
    • modifiers

      public List<T> modifiers()
      Gets the modifiers affecting this event.
      Returns:
      The list of modifiers