Class TargetComponent

java.lang.Object
studio.magemonkey.fabled.dynamic.EffectComponent
studio.magemonkey.fabled.dynamic.target.TargetComponent
Direct Known Subclasses:
AreaTarget, ConeTarget, LinearTarget, LocationTarget, NearestTarget, OffsetTarget, RememberTarget, SelfTarget, SingleTarget, WorldTarget

public abstract class TargetComponent extends EffectComponent
Fabled © 2024 studio.magemonkey.fabled.dynamic.target.TargetComponent
  • Field Details

    • MAX

      protected static final String MAX
      See Also:
    • everyone

      protected boolean everyone
    • allies

      protected boolean allies
    • throughWall

      protected boolean throughWall
    • invulnerable

      protected boolean invulnerable
    • self

  • Constructor Details

    • TargetComponent

      public TargetComponent()
  • Method Details

    • getType

      public ComponentType getType()
      Description copied from class: EffectComponent
      Retrieves the type of the component
      Specified by:
      getType in class EffectComponent
      Returns:
      component type
    • execute

      public boolean execute(org.bukkit.entity.LivingEntity caster, int level, List<org.bukkit.entity.LivingEntity> targets, boolean force)
      Executes the component
      Specified by:
      execute in class EffectComponent
      Parameters:
      caster - caster of the skill
      level - level of the skill
      targets - targets to apply to
      force - whether the execution is being forced
      Returns:
      true if applied to something, false otherwise
    • load

      public void load(DynamicSkill skill, studio.magemonkey.codex.mccore.config.parse.DataSection config)
      Description copied from class: EffectComponent
      Loads component data from the configuration
      Overrides:
      load in class EffectComponent
      Parameters:
      skill - owning skill of the component
      config - config data to load from
    • getTargets

      public abstract List<org.bukkit.entity.LivingEntity> getTargets(org.bukkit.entity.LivingEntity caster, int level, List<org.bukkit.entity.LivingEntity> targets)
    • playPreview

      public void playPreview(List<Runnable> onPreviewStop, org.bukkit.entity.Player caster, int level, Supplier<List<org.bukkit.entity.LivingEntity>> targetSupplier)
      Starts the component's preview effects. Removal of any registered listeners, tasks, entities, or other temporary effects should be included in a Runnable added to the provided List.
      Overrides:
      playPreview in class EffectComponent
      Parameters:
      onPreviewStop - List of Runnables to add to
      caster - caster reference
      level - the level of the skill to preview for
      targetSupplier - targets to preview on
    • determineTargets

      public List<org.bukkit.entity.LivingEntity> determineTargets(org.bukkit.entity.LivingEntity caster, int level, List<org.bukkit.entity.LivingEntity> from, Function<org.bukkit.entity.LivingEntity,List<org.bukkit.entity.LivingEntity>> conversion)