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
progressFields inherited from class io.github.apace100.apoli.power.CooldownPower
cooldownDuration, lastUseTimeFields inherited from class io.github.apace100.apoli.power.Power
conditions, entity, type -
Constructor Summary
ConstructorsConstructorDescriptionActionOnKeyPower(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 TypeMethodDescriptionio.github.apace100.apoli.power.Active.KeygetKey()static AstralPowerFactory<ActionOnKeyPower> Returns this power's default factory.voidonUse()voidsetKey(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, useMethods inherited from class io.github.apace100.apoli.power.CooldownPower
createFactory, getFill, getRenderSettingsMethods inherited from class io.github.apace100.apoli.power.Power
addCondition, createSimpleFactory, getType, isActive, onAdded, onGained, onLost, onRemoved, onRespawn, setTicking, setTicking, shouldTick, shouldTickWhenInactive
-
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
Returns this power's default factory.- Returns:
- This power's default factory.
- Since:
- 1.7.0
-
onUse
public void onUse()- Specified by:
onUsein interfaceio.github.apace100.apoli.power.Active
-
getKey
public io.github.apace100.apoli.power.Active.Key getKey()- Specified by:
getKeyin interfaceio.github.apace100.apoli.power.Active
-
setKey
public void setKey(io.github.apace100.apoli.power.Active.Key key) - Specified by:
setKeyin interfaceio.github.apace100.apoli.power.Active
-