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
FieldsFields 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
ConstructorsConstructorDescriptionTickingCooldownPower(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
Methods 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
-
Field Details
-
progress
protected int progressThe 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
Returns this power's default factory.- Returns:
- This power's default factory.
- Since:
- 1.7.0
-
canUse
public boolean canUse()- Overrides:
canUsein classio.github.apace100.apoli.power.CooldownPower
-
use
public void use()- Overrides:
usein classio.github.apace100.apoli.power.CooldownPower
-
getProgress
public float getProgress()- Overrides:
getProgressin classio.github.apace100.apoli.power.CooldownPower
-
getRemainingTicks
public int getRemainingTicks()- Overrides:
getRemainingTicksin classio.github.apace100.apoli.power.CooldownPower
-
modify
public void modify(int changeInTicks) - Overrides:
modifyin classio.github.apace100.apoli.power.CooldownPower
-
setCooldown
public void setCooldown(int cooldownInTicks) - Overrides:
setCooldownin classio.github.apace100.apoli.power.CooldownPower
-
tick
public void tick()- Overrides:
tickin classio.github.apace100.apoli.power.Power
-
toTag
public net.minecraft.nbt.NbtElement toTag()- Overrides:
toTagin classio.github.apace100.apoli.power.CooldownPower
-
fromTag
public void fromTag(net.minecraft.nbt.NbtElement tag) - Overrides:
fromTagin classio.github.apace100.apoli.power.CooldownPower
-
shouldRender
public boolean shouldRender()- Specified by:
shouldRenderin interfaceio.github.apace100.apoli.power.HudRendered- Overrides:
shouldRenderin classio.github.apace100.apoli.power.CooldownPower
-