Contents
Class AbilityCharges
java.lang.Object
com.hypixel.hytale.builtin.abilities.trigger.AbilityCharges
- All Implemented Interfaces:
Component<EntityStore>, Cloneable
The buffs granted by ability casts that run an authored interaction each time their trigger
fires (see
AbilityChargeTrigger; today both triggers are weapon attacks) until their
charges or the buff run out. One carrier holds one AbilityCharges.Entry per buff effect, so buffs from
different abilities (a poison imbue and a wind strike) coexist and each spends its own charges.
Recasting an ability replaces its own entry only. The interaction runs server-simulated on the
carrier with the cast's ImpactModifiers snapshot in context, so its nodes resolve the
rune values the cast did, whatever was cast since.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classOne granted buff: its effect, what spends a charge, and the interaction each charge runs. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intRemaining value of a buff with no charge limit: it lasts as long as its effect.Fields inherited from interface Component
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()get(int effectIndex) static ComponentType<EntityStore, AbilityCharges> booleanisEmpty()voidput(AbilityCharges.Entry entry) Arms a buff.voidremove(int effectIndex) Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Component
cloneSerializable
-
Field Details
-
UNLIMITED
public static final int UNLIMITEDRemaining value of a buff with no charge limit: it lasts as long as its effect.- See Also:
-
-
Constructor Details
-
AbilityCharges
public AbilityCharges() -
AbilityCharges
-
-
Method Details
-
getComponentType
-
put
Arms a buff. An entry for the same effect is replaced, so a recast starts its charges over. -
get
-
remove
public void remove(int effectIndex) -
isEmpty
public boolean isEmpty() -
getEntries
- Returns:
- a snapshot of the armed entries, safe to iterate while entries are removed.
-
clone
- Specified by:
clonein interfaceComponent<EntityStore>- Returns:
- a clone instance of the original component instance.
-