Class BuffData

java.lang.Object
studio.magemonkey.fabled.api.util.BuffData

public class BuffData extends Object
Represents buffs set on an entity
  • Constructor Details

    • BuffData

      public BuffData(org.bukkit.entity.LivingEntity entity)
      Initializes new buff data for the entity
      Parameters:
      entity - entity to initialize for
  • Method Details

    • getMultiplier

      public double getMultiplier(BuffType buffType, String category)
    • getFlatBonus

      public double getFlatBonus(BuffType buffType, String category)
    • addBuff

      @Deprecated public void addBuff(BuffType type, Buff buff, int ticks)
      Deprecated.
      Buff types are more abstract now, so addBuff(String, Buff, int) should be preferred
      Adds a buff to the buff collection. If a buff already exists with the same key, it will be overwritten.
      Parameters:
      type - type of buff to add
      buff - buff details
      ticks - how long to apply the buff for
    • addBuff

      public void addBuff(String type, Buff buff, int ticks)
      Adds a buff to the buff collection. If a buff already exists with the same key, it will be overwritten.
      Parameters:
      type - type of buff to add
      buff - buff details
      ticks - how long to apply the buff for
    • addBuff

      @Deprecated public void addBuff(BuffType type, String category, Buff buff, int ticks)
      Deprecated.
      Buff types are more abstract now, so addBuff(String, Buff, int) should be preferred
      Adds a buff to the buff collection. If a buff already exists with the same key, it will be overwritten.
      Parameters:
      type - type of buff to add
      category - sub category of the type to apply (e.g. damage classification)
      buff - buff details
      ticks - how long to apply the buff for
    • addBuff

      public void addBuff(String type, String category, Buff buff, int ticks)
      Adds a buff to the buff collection. If a buff already exists with the same key, it will be overwritten.
      Parameters:
      type - type of buff to add
      category - sub category of the type to apply (e.g. damage classification)
      buff - buff details
      ticks - how long to apply the buff for
    • addDamageBuff

      @Deprecated public void addDamageBuff(Buff buff, int ticks)
      Deprecated.
    • addDefenseBuff

      @Deprecated public void addDefenseBuff(Buff buff, int ticks)
      Deprecated.
    • addSkillDamageBuff

      @Deprecated public void addSkillDamageBuff(Buff buff, int ticks)
      Deprecated.
    • addSkillDefenseBuff

      @Deprecated public void addSkillDefenseBuff(Buff buff, int ticks)
      Deprecated.
    • apply

      public double apply(String type, double value)
      Applies all buffs of the given type to the specified value
      Parameters:
      type - type of buff to apply
      value - value to modify
      Returns:
      value after all buff applications
    • apply

      @Deprecated public double apply(BuffType type, double value)
      Deprecated.
      Applies all buffs of the given type to the specified value
      Parameters:
      type - type of buff to apply
      value - value to modify
      Returns:
      value after all buff applications
    • isActive

      public boolean isActive(BuffType type)
    • clearByType

      public void clearByType(BuffType type)
      Clears buffs by the given type
      Parameters:
      type - type of buff
    • apply

      public double apply(BuffType type, String category, double value)
      Applies all buffs of the given type to the specified value
      Parameters:
      type - type of buff to apply
      category - sub category of the buff type to apply (e.g. damage classification)
      value - value to modify
      Returns:
      value after all buff applications
    • modifyDealtDamage

      @Deprecated public double modifyDealtDamage(double damage)
      Deprecated.
    • modifyTakenDamage

      @Deprecated public double modifyTakenDamage(double damage)
      Deprecated.
    • modifySkillDealtDamage

      @Deprecated public double modifySkillDealtDamage(double damage)
      Deprecated.
    • modifySkillTakenDamage

      @Deprecated public double modifySkillTakenDamage(double damage)
      Deprecated.
    • clear

      public void clear()
      Clears all buffs on the entity and stops associated tasks.