Class GlobalModifier

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

public class GlobalModifier extends ExperienceModifier
An experience modifier that multiplies incoming experience by the server-wide global factor.

The multiplier is read from MyPetGlobal.LevelSystem.Experience.Modifier.GLOBAL at each invocation, so changes to the configuration value take effect immediately without re-registering this modifier.

A global factor of 1.0 means no change; 2.0 doubles all experience; 0.5 halves it.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a modifier that reads the server-wide experience factor.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    modify(double experience, double baseExperience)
    Applies this modifier to the given experience value.

    Methods inherited from class java.lang.Object

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

    • GlobalModifier

      public GlobalModifier()
      Creates a modifier that reads the server-wide experience factor.
  • Method Details

    • modify

      public double modify(double experience, double baseExperience)
      Applies this modifier to the given experience value. Scales the experience by the global multiplier from configuration.
      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)