Contents
Class AbilityChargeActivator
java.lang.Object
com.hypixel.hytale.builtin.abilities.trigger.AbilityChargeActivator
The shared body of the ability charge systems: finds the armed
AbilityCharges.Entry
records whose buff is still active and whose ability allows the held item, then spends a
charge on each and runs its per-activation interaction server-simulated on the carrier.-
Method Summary
Modifier and TypeMethodDescriptionstatic voidactivate(Ref<EntityStore> ref, AbilityCharges.Entry entry, Ref<EntityStore> targetRef, CommandBuffer<EntityStore> commandBuffer) Spends one charge ofentryand runs its per-activation interaction.static List<AbilityCharges.Entry> getArmed(Ref<EntityStore> ref, AbilityChargeTrigger trigger, CommandBuffer<EntityStore> commandBuffer)
-
Method Details
-
getArmed
@Nonnull public static List<AbilityCharges.Entry> getArmed(@Nonnull Ref<EntityStore> ref, @Nonnull AbilityChargeTrigger trigger, @Nonnull CommandBuffer<EntityStore> commandBuffer) - Returns:
- the carrier's entries for
triggerthat can activate right now, empty when none. Entries whose buff expired on its own are dropped here.
-
activate
public static void activate(@Nonnull Ref<EntityStore> ref, @Nonnull AbilityCharges.Entry entry, @Nullable Ref<EntityStore> targetRef, @Nonnull CommandBuffer<EntityStore> commandBuffer) Spends one charge ofentryand runs its per-activation interaction. When the last charge goes, the buff effect and the entry are removed, and the component with it once no entry remains.- Parameters:
targetRef- the hit entity for an OnHit activation, exposed to the interaction as its target entity.nullfor OnPrimaryActivation.
-