Contents
- Description
- Field Summary
- Constructor Summary
- Method Summary
- Field Details
- Constructor Details
- Method Details
- tick(CommandBuffer, Ref, EntityEffect, EntityStatMap, float)
- getDamageMultiplier()
- setDamageMultiplier(float)
- getOwner()
- setOwner(Ref)
- getEntityEffectIndex()
- getInitialDuration()
- getRemainingDuration()
- isInfinite()
- isDebuff()
- isInvulnerable()
- getDeathMessage(Damage, Ref, ComponentAccessor)
- getSourceType()
- toString()
Class ActiveEntityEffect
java.lang.Object
com.hypixel.hytale.server.core.entity.effect.ActiveEntityEffect
- All Implemented Interfaces:
Damage.Source
Represents a single active entity effect on an entity effect controller.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BuilderCodec<ActiveEntityEffect> The codec used to parseActiveEntityEffectinstances. -
Constructor Summary
ConstructorsConstructorDescriptionEmpty Constructor for aActiveEntityEffectinstance.ActiveEntityEffect(String entityEffectId, int entityEffectIndex, boolean infinite, boolean invulnerable) Constructor for aActiveEntityEffectinstance, with a set default duration.ActiveEntityEffect(String entityEffectId, int entityEffectIndex, float duration, boolean debuff, String statusEffectIcon, boolean invulnerable) Constructor for aActiveEntityEffectinstance.ActiveEntityEffect(String entityEffectId, int entityEffectIndex, float initialDuration, float remainingDuration, boolean infinite, boolean debuff, String statusEffectIcon, float sinceLastDamage, boolean hasBeenDamaged, DamageCalculatorSystems.Sequence sequentialHits, boolean invulnerable) Default Constructor for aActiveEntityEffectinstance. -
Method Summary
Modifier and TypeMethodDescriptionfloatgetDeathMessage(Damage info, Ref<EntityStore> targetRef, ComponentAccessor<EntityStore> componentAccessor) Generates a death message from this source and any information provided ininfo.intfloatgetOwner()floatbooleanisDebuff()booleanbooleanvoidsetDamageMultiplier(float damageMultiplier) voidsetOwner(Ref<EntityStore> owner) voidtick(CommandBuffer<EntityStore> commandBuffer, Ref<EntityStore> ref, EntityEffect entityEffect, EntityStatMap entityStatMapComponent, float dt) Called to tick this specific active entity effect.toString()
-
Field Details
-
CODEC
The codec used to parseActiveEntityEffectinstances.
-
-
Constructor Details
-
ActiveEntityEffect
public ActiveEntityEffect()Empty Constructor for aActiveEntityEffectinstance.Used by the codec to instantiate
ActiveEntityEffectinstances. -
ActiveEntityEffect
public ActiveEntityEffect(@Nonnull String entityEffectId, int entityEffectIndex, float initialDuration, float remainingDuration, boolean infinite, boolean debuff, @Nullable String statusEffectIcon, float sinceLastDamage, boolean hasBeenDamaged, @Nonnull DamageCalculatorSystems.Sequence sequentialHits, boolean invulnerable) Default Constructor for aActiveEntityEffectinstance.- Parameters:
entityEffectId- The asset ID of the affiliated entity effect asset.entityEffectIndex- The asset index of the affiliated entity effect asset.initialDuration- The initial duration of the entity effect.remainingDuration- The remaining duration of the entity effect.infinite- Whether this entity effect is infinite.debuff- Whether this entity effect is a debuff.statusEffectIcon- The status effect icon to display for this entity effect.sinceLastDamage- The time since the player was last damaged.hasBeenDamaged- Whether the entity has been damaged by this active entity effect.sequentialHits- The sequential hits of this entity effect.invulnerable- Whether the entity is invulnerable while active.
-
ActiveEntityEffect
public ActiveEntityEffect(@Nonnull String entityEffectId, int entityEffectIndex, float duration, boolean debuff, @Nullable String statusEffectIcon, boolean invulnerable) Constructor for aActiveEntityEffectinstance.- Parameters:
entityEffectId- The asset ID of the affiliated entity effect asset.entityEffectIndex- The asset index of the affiliated entity effect asset.duration- The duration of the entity effect.debuff- Whether this entity effect is a debuff.statusEffectIcon- The status effect icon to display for this entity effect.invulnerable- Whether the entity is invulnerable while active.
-
ActiveEntityEffect
public ActiveEntityEffect(@Nonnull String entityEffectId, int entityEffectIndex, boolean infinite, boolean invulnerable) Constructor for aActiveEntityEffectinstance, with a set default duration.- Parameters:
entityEffectId- The asset ID of the affiliated entity effect asset.entityEffectIndex- The asset index of the affiliated entity effect asset.infinite- Whether this entity effect is infinite.invulnerable- Whether the entity is invulnerable while active.
-
-
Method Details
-
tick
public void tick(@Nonnull CommandBuffer<EntityStore> commandBuffer, @Nonnull Ref<EntityStore> ref, @Nonnull EntityEffect entityEffect, @Nonnull EntityStatMap entityStatMapComponent, float dt) Called to tick this specific active entity effect.- Parameters:
commandBuffer- The command buffer for store access.ref- The entity store ref of the affiliated living entity.entityEffect- The affiliated entity effect asset.entityStatMapComponent- TheEntityStatMapcomponent of the affiliated living entity.dt- The current delta time of this frame.
-
getDamageMultiplier
public float getDamageMultiplier() -
setDamageMultiplier
public void setDamageMultiplier(float damageMultiplier) -
getOwner
- Returns:
- the entity that owns this effect (the one that applied it), or
nullwhen unknown.
-
setOwner
-
getEntityEffectIndex
public int getEntityEffectIndex()- Returns:
- the index of the entity effect asset.
-
getInitialDuration
public float getInitialDuration()- Returns:
- the initial duration, in seconds, of this active entity effect.
-
getRemainingDuration
public float getRemainingDuration()- Returns:
- the remaining duration, in seconds, of this active entity effect.
-
isInfinite
public boolean isInfinite()- Returns:
trueif this effect is infinite,falseotherwise.
-
isDebuff
public boolean isDebuff()- Returns:
trueif this effect is a debuff,falseotherwise.
-
isInvulnerable
public boolean isInvulnerable()- Returns:
trueif this effect is invulnerable,falseotherwise.
-
getDeathMessage
@Nonnull public Message getDeathMessage(@Nonnull Damage info, @Nonnull Ref<EntityStore> targetRef, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Description copied from interface:Damage.SourceGenerates a death message from this source and any information provided ininfo.- Specified by:
getDeathMessagein interfaceDamage.Source- Parameters:
info- The damage info to inspecttargetRef- The entity reference of the entity that has been killed.componentAccessor- TheComponentAccessor<EntityStore>for component access.- Returns:
- The generated death message
-
getSourceType
- Specified by:
getSourceTypein interfaceDamage.Source- Returns:
- the
DamageSourceTypeof this source.
-
toString
-