Class BuffManager

java.lang.Object
studio.magemonkey.fabled.api.util.BuffManager
All Implemented Interfaces:
studio.magemonkey.codex.registry.provider.BuffProvider

public class BuffManager extends Object implements studio.magemonkey.codex.registry.provider.BuffProvider
The manager for temporary entity buff data
  • Constructor Details

    • BuffManager

      public BuffManager()
  • Method Details

    • getInstance

      public static BuffManager getInstance()
    • getBuffData

      public static BuffData getBuffData(org.bukkit.entity.LivingEntity entity)
      Retrieves the buff data for an entity. This returns null if no existing data is found.
      Parameters:
      entity - entity to retrieve the data for
      Returns:
      the buff data for the entity
    • getBuffData

      public static BuffData getBuffData(org.bukkit.entity.LivingEntity entity, boolean create)
      Retrieves the buff data for an entity, optionally creating new data if none currently exists. If set to false, this will return null if no data currently exists.
      Parameters:
      entity - entity to get the buff data for
      create - whether to create new data if it doesn't exist
      Returns:
      the buff data for an enemy
    • clearData

      public static void clearData(org.bukkit.entity.LivingEntity entity)
      Clears the buffs for an entity
      Parameters:
      entity - entity to clear the buffs for
    • addBuff

      public static void addBuff(org.bukkit.entity.LivingEntity entity, BuffType type, Buff buff, int ticks)
      Adds an offensive buff to the entity
      Parameters:
      entity - entity to give the buff to
      type - type of buff to add
      buff - buff to add
      ticks - ticks to apply the buff for
    • addBuff

      public static void addBuff(org.bukkit.entity.LivingEntity entity, BuffType type, String category, Buff buff, int ticks)
      Adds an offensive buff to the entity
      Parameters:
      entity - entity to give the buff to
      type - type of buff to add
      category - sub category of the buff to add
      buff - buff to add
      ticks - ticks to apply the buff for
    • addDamageBuff

      @Deprecated public static void addDamageBuff(org.bukkit.entity.LivingEntity entity, Buff buff, int ticks)
    • addDefenseBuff

      @Deprecated public static void addDefenseBuff(org.bukkit.entity.LivingEntity entity, Buff buff, int ticks)
    • addSkillDamageBuff

      @Deprecated public static void addSkillDamageBuff(org.bukkit.entity.LivingEntity entity, Buff buff, int ticks)
    • addSkillDefenseBuff

      @Deprecated public static void addSkillDefenseBuff(org.bukkit.entity.LivingEntity entity, Buff buff, int ticks)
    • apply

      @Deprecated(forRemoval=true, since="1.0.4-R0.16-SNAPSHOT") public static double apply(org.bukkit.entity.LivingEntity entity, BuffType type, double amount)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use BuffRegistry.scaleValue(String, LivingEntity, double) instead
      Modifies the amount of dealt damage using damage buff multipliers and bonuses.
      Parameters:
      entity - entity to use the data of
      type - type of buffs to apply
      amount - base amount to modify
      Returns:
      modified number
    • apply

      @Deprecated(forRemoval=true, since="1.0.4-R0.16-SNAPSHOT") public static double apply(org.bukkit.entity.LivingEntity entity, BuffType type, String category, double amount)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use BuffRegistry.scaleValue(String, LivingEntity, double) instead
      Modifies the amount of dealt damage using damage buff multipliers and bonuses.
      Parameters:
      entity - entity to use the data of
      type - type of buffs to apply
      category - sub category of the buffs to apply
      amount - base amount to modify
      Returns:
      modified number
    • scaleValue

      public double scaleValue(String name, org.bukkit.entity.LivingEntity player, double value)
      Specified by:
      scaleValue in interface studio.magemonkey.codex.registry.provider.BuffProvider
    • modifyDealtDamage

      @Deprecated public static double modifyDealtDamage(org.bukkit.entity.LivingEntity entity, double damage)
      Deprecated.
    • modifyTakenDefense

      @Deprecated public static double modifyTakenDefense(org.bukkit.entity.LivingEntity entity, double damage)
      Deprecated.
    • modifySkillDealtDamage

      @Deprecated public static double modifySkillDealtDamage(org.bukkit.entity.LivingEntity entity, double damage)
      Deprecated.
    • modifySkillTakenDefense

      @Deprecated public static double modifySkillTakenDefense(org.bukkit.entity.LivingEntity entity, double damage)
      Deprecated.
    • getData

      public Map<UUID,BuffData> getData()