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

  • Constructor Details

    • AbstractModifierEvent

      public AbstractModifierEvent()
  • Method Details

    • init

      protected List<T> init(double baseAmount, List<T> functions)
    • convertTuple

      protected abstract T convertTuple(M obj, DoubleUnaryOperator function)
    • 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

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