Class BuffRegistry

java.lang.Object
studio.magemonkey.codex.registry.BuffRegistry

public class BuffRegistry extends Object
  • Constructor Details

    • BuffRegistry

      public BuffRegistry()
  • Method Details

    • registerProvider

      public static void registerProvider(studio.magemonkey.codex.registry.provider.BuffProvider provider)
    • unregisterProvider

      public static void unregisterProvider(studio.magemonkey.codex.registry.provider.BuffProvider provider)
    • unregisterProvider

      public static void unregisterProvider(Class<? extends studio.magemonkey.codex.registry.provider.BuffProvider> provider)
    • scaleValue

      public static double scaleValue(String name, @NotNull org.bukkit.entity.LivingEntity entity, double value)
    • scaleDamageForDefense

      public static double scaleDamageForDefense(String name, org.bukkit.entity.LivingEntity entity, double damage)
      Scales the damage dealt directly for the target entity. This method should be used when modifications to the damage need to be made outside the vanilla "defense" calculations. The primary example of this is Fabled's shield system. Damage is reduced directly instead of being defended. This is essentially used for absorption effects.

      It is important to note that we are _specifically_ not using the scaleValue(java.lang.String, org.bukkit.entity.LivingEntity, double) method here, as this method will only scale the value if the BuffProvider overrides the implementation.

      Parameters:
      name - name of the buff
      entity - entity to scale the damage for
      damage - damage being dealt
      Returns:
      the modified damage