Class TickingCooldownPower

java.lang.Object
io.github.apace100.apoli.power.Power
io.github.apace100.apoli.power.CooldownPower
dev.jaxydog.astral.content.power.custom.TickingCooldownPower
All Implemented Interfaces:
io.github.apace100.apoli.power.HudRendered
Direct Known Subclasses:
ActionOnKeyPower

public class TickingCooldownPower extends io.github.apace100.apoli.power.CooldownPower
A custom ticking cooldown power, that allows for extra features compared to CooldownPower.
Since:
1.7.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
    The current cooldown progress.

    Fields inherited from class io.github.apace100.apoli.power.CooldownPower

    cooldownDuration, lastUseTime

    Fields inherited from class io.github.apace100.apoli.power.Power

    conditions, entity, type
  • Constructor Summary

    Constructors
    Constructor
    Description
    TickingCooldownPower(io.github.apace100.apoli.power.PowerType<?> type, net.minecraft.entity.LivingEntity entity, int duration, io.github.apace100.apoli.util.HudRender hudRender, @Nullable Predicate<net.minecraft.entity.Entity> tickCondition, @Nullable Consumer<net.minecraft.entity.Entity> minAction, @Nullable Consumer<net.minecraft.entity.Entity> setAction, @Nullable Consumer<net.minecraft.entity.Entity> maxAction)
    Creates a new ticking cooldown power.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    void
    fromTag(net.minecraft.nbt.NbtElement tag)
     
    Returns this power's default factory.
    float
     
    int
     
    void
    modify(int changeInTicks)
     
    void
    setCooldown(int cooldownInTicks)
     
    boolean
     
    void
     
    net.minecraft.nbt.NbtElement
     
    void
    use()
     

    Methods inherited from class io.github.apace100.apoli.power.CooldownPower

    createFactory, getFill, getRenderSettings

    Methods inherited from class io.github.apace100.apoli.power.Power

    addCondition, createSimpleFactory, getType, isActive, onAdded, onGained, onLost, onRemoved, onRespawn, setTicking, setTicking, shouldTick, shouldTickWhenInactive

    Methods inherited from class java.lang.Object

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

    • progress

      protected int progress
      The current cooldown progress.
      Since:
      1.7.0
  • Constructor Details

    • TickingCooldownPower

      public TickingCooldownPower(io.github.apace100.apoli.power.PowerType<?> type, net.minecraft.entity.LivingEntity entity, int duration, io.github.apace100.apoli.util.HudRender hudRender, @Nullable @Nullable Predicate<net.minecraft.entity.Entity> tickCondition, @Nullable @Nullable Consumer<net.minecraft.entity.Entity> minAction, @Nullable @Nullable Consumer<net.minecraft.entity.Entity> setAction, @Nullable @Nullable Consumer<net.minecraft.entity.Entity> maxAction)
      Creates a new ticking cooldown power.
      Parameters:
      type - The power's type.
      entity - The holding entity.
      duration - The duration of the cooldown.
      hudRender - The power's HUD render.
      tickCondition - The condition that allows this cooldown to update.
      minAction - An action run when the cooldown is set.
      setAction - An action run when the cooldown is changed.
      maxAction - An action run when the cooldown is recharged.
      Since:
      1.7.0
  • Method Details

    • getFactory

      public static AstralPowerFactory<TickingCooldownPower> getFactory()
      Returns this power's default factory.
      Returns:
      This power's default factory.
      Since:
      1.7.0
    • canUse

      public boolean canUse()
      Overrides:
      canUse in class io.github.apace100.apoli.power.CooldownPower
    • use

      public void use()
      Overrides:
      use in class io.github.apace100.apoli.power.CooldownPower
    • getProgress

      public float getProgress()
      Overrides:
      getProgress in class io.github.apace100.apoli.power.CooldownPower
    • getRemainingTicks

      public int getRemainingTicks()
      Overrides:
      getRemainingTicks in class io.github.apace100.apoli.power.CooldownPower
    • modify

      public void modify(int changeInTicks)
      Overrides:
      modify in class io.github.apace100.apoli.power.CooldownPower
    • setCooldown

      public void setCooldown(int cooldownInTicks)
      Overrides:
      setCooldown in class io.github.apace100.apoli.power.CooldownPower
    • tick

      public void tick()
      Overrides:
      tick in class io.github.apace100.apoli.power.Power
    • toTag

      public net.minecraft.nbt.NbtElement toTag()
      Overrides:
      toTag in class io.github.apace100.apoli.power.CooldownPower
    • fromTag

      public void fromTag(net.minecraft.nbt.NbtElement tag)
      Overrides:
      fromTag in class io.github.apace100.apoli.power.CooldownPower
    • shouldRender

      public boolean shouldRender()
      Specified by:
      shouldRender in interface io.github.apace100.apoli.power.HudRendered
      Overrides:
      shouldRender in class io.github.apace100.apoli.power.CooldownPower