Class ActionOnKeyPower

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

public class ActionOnKeyPower extends TickingCooldownPower implements io.github.apace100.apoli.power.Active
A custom action-on-key power, that allows for extra features when compared to ActiveCooldownPower.
Since:
1.7.0
  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.github.apace100.apoli.power.Active

    io.github.apace100.apoli.power.Active.Key
  • Field Summary

    Fields inherited from class dev.jaxydog.astral.content.power.custom.TickingCooldownPower

    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
    ActionOnKeyPower(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, Consumer<net.minecraft.entity.Entity> activeFunction)
    Creates a new ticking cooldown power.
  • Method Summary

    Modifier and Type
    Method
    Description
    io.github.apace100.apoli.power.Active.Key
     
    Returns this power's default factory.
    void
     
    void
    setKey(io.github.apace100.apoli.power.Active.Key key)
     

    Methods inherited from class dev.jaxydog.astral.content.power.custom.TickingCooldownPower

    canUse, fromTag, getFactory, getProgress, getRemainingTicks, modify, setCooldown, shouldRender, tick, toTag, 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
  • Constructor Details

    • ActionOnKeyPower

      public ActionOnKeyPower(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, Consumer<net.minecraft.entity.Entity> activeFunction)
      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.
      activeFunction - An action run when the key is pressed.
      Since:
      1.7.0
  • Method Details

    • getKeyFactory

      public static AstralPowerFactory<ActionOnKeyPower> getKeyFactory()
      Returns this power's default factory.
      Returns:
      This power's default factory.
      Since:
      1.7.0
    • onUse

      public void onUse()
      Specified by:
      onUse in interface io.github.apace100.apoli.power.Active
    • getKey

      public io.github.apace100.apoli.power.Active.Key getKey()
      Specified by:
      getKey in interface io.github.apace100.apoli.power.Active
    • setKey

      public void setKey(io.github.apace100.apoli.power.Active.Key key)
      Specified by:
      setKey in interface io.github.apace100.apoli.power.Active