Class MultiplicativeModifier

java.lang.Object
de.Keyle.MyPet.api.skill.experience.modifier.ExperienceModifier
de.Keyle.MyPet.api.skill.experience.modifier.MultiplicativeModifier

public class MultiplicativeModifier extends ExperienceModifier
An experience modifier that multiplies the incoming experience by a configurable factor.

The modifier value defaults to 1.0 (no change). Values above 1.0 increase experience; values between 0.0 and 1.0 decrease it.

Unlike GlobalModifier, this modifier carries its own per-instance multiplier rather than reading from global configuration.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a multiplicative modifier with a factor of 1.0 (no-op).
    MultiplicativeModifier(double modifier)
    Creates a multiplicative modifier with the specified factor.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    The amount multiplied into the incoming experience.
    double
    modify(double experience, double baseExperience)
    Applies this modifier to the given experience value.
    void
    setModifier(double modifier)
    The amount multiplied into the incoming experience.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MultiplicativeModifier

      public MultiplicativeModifier(double modifier)
      Creates a multiplicative modifier with the specified factor.
      Parameters:
      modifier - the multiplication factor (e.g. 1.5 for +50%)
    • MultiplicativeModifier

      public MultiplicativeModifier()
      Creates a multiplicative modifier with a factor of 1.0 (no-op).
  • Method Details

    • modify

      public double modify(double experience, double baseExperience)
      Applies this modifier to the given experience value. Multiplies the experience by the configured factor.
      Specified by:
      modify in class ExperienceModifier
      Parameters:
      experience - the experience value as modified by prior modifiers in the chain
      baseExperience - the original unmodified experience from the mob kill
      Returns:
      the modified experience value to pass to the next modifier (or to award)
    • setModifier

      public void setModifier(double modifier)
      The amount multiplied into the incoming experience.
      Parameters:
      modifier - the new value
    • getModifier

      public double getModifier()
      The amount multiplied into the incoming experience.
      Returns:
      the current value