Contents
Class ImpactModifiers
java.lang.Object
com.hypixel.hytale.server.core.modules.projectile.component.ImpactModifiers
- All Implemented Interfaces:
Component<EntityStore>, Cloneable
The resolved ability attributes and rune on-hit effects of an ability cast. Snapshotted
onto the cast chain's context when an ability chain starts (so cast-time interactions
and selectors can read them) and stamped as a component onto spawned carriers like
projectiles and ability entities (their chains run with fresh contexts, so cast-time
state only reaches them through the entity itself). Attributes start from the
core ability's declared values and each matching support's AttributeModifiers apply
left to right.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MetaKey<ImpactModifiers> The cast's resolved modifiers, carried on the chain's context from the moment the chain starts.static final MetaKey<ImpactModifiers> The modifiers of the ability whose DamageEntity dealt this damage, so on-damage systems (rune on-hit effects) read the cast's values without knowing whether the damage came from a projectile, an ability entity, or the caster's own chain.Fields inherited from interface Component
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()static ImpactModifierscollect(InteractionContext context, Ref<EntityStore> casterRef, ComponentAccessor<EntityStore> componentAccessor) Collects the resolved modifiers for a projectile launched by an ability cast, ornullwhen the cast isn't an ability cast or there is nothing to carry.floatgetAttribute(String name, float fallback) static ComponentType<EntityStore, ImpactModifiers> String[]static ImpactModifiersresolve(InteractionContext context, Ref<EntityStore> actingRef, ComponentAccessor<EntityStore> componentAccessor) Resolves the modifiers an interaction should use: the cast snapshot carried on the chain's context when the chain is an ability cast, otherwise the acting entity's component (e.g. a projectile carrying its launch's modifiers into its impact chains).static voidsnapshotForCast(InteractionContext context, ComponentAccessor<EntityStore> componentAccessor) Snapshots the resolved cast modifiers onto the chain's context when an ability chain starts, so the cast's interactions, selectors, and forks read the fresh values from their first tick.Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Component
cloneSerializable
-
Field Details
-
CAST_SNAPSHOT
The cast's resolved modifiers, carried on the chain's context from the moment the chain starts. Forked contexts inherit it, so a cast's hit chains read the same values. -
DAMAGE_MODIFIERS
The modifiers of the ability whose DamageEntity dealt this damage, so on-damage systems (rune on-hit effects) read the cast's values without knowing whether the damage came from a projectile, an ability entity, or the caster's own chain. Absent for damage that did not come from an ability.
-
-
Constructor Details
-
ImpactModifiers
-
ImpactModifiers
-
-
Method Details
-
getComponentType
-
collect
@Nullable public static ImpactModifiers collect(@Nonnull InteractionContext context, @Nonnull Ref<EntityStore> casterRef, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Collects the resolved modifiers for a projectile launched by an ability cast, ornullwhen the cast isn't an ability cast or there is nothing to carry. -
snapshotForCast
public static void snapshotForCast(@Nonnull InteractionContext context, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Snapshots the resolved cast modifiers onto the chain's context when an ability chain starts, so the cast's interactions, selectors, and forks read the fresh values from their first tick. Non-ability chains never touch the snapshot. The caster entity itself carries no snapshot: chains that outlive the cast take their copy at grant time instead (e.g. an ability charges buff). -
resolve
@Nullable public static ImpactModifiers resolve(@Nonnull InteractionContext context, @Nonnull Ref<EntityStore> actingRef, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Resolves the modifiers an interaction should use: the cast snapshot carried on the chain's context when the chain is an ability cast, otherwise the acting entity's component (e.g. a projectile carrying its launch's modifiers into its impact chains). -
getAttribute
- Returns:
- the resolved value of the named attribute, or
fallbackwhen the ability doesn't declare it.
-
getAttributes
-
getOnHitEffectIds
-
getElementalCauseId
-
clone
- Specified by:
clonein interfaceComponent<EntityStore>- Returns:
- a clone instance of the original component instance.
-