Contents
Class Condition
java.lang.Object
com.hypixel.hytale.server.core.modules.entity.condition.Condition
- Direct Known Subclasses:
AliveCondition, ChargingCondition, CheckPlayerGameModeCondition, EntityStatBoundCondition, EnvironmentCondition, GlidingCondition, HasEffectCondition, InFluidCondition, IsPlayerCondition, LogicCondition, NoDamageTakenCondition, OutOfCombatCondition, RegenHealthCondition, SprintingCondition, SuffocatingCondition, WieldingCondition
A class that represents a condition for entity stats.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CodecMapCodec<Condition> A codec map codec for allConditioninstances. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanallConditionsMet(ComponentAccessor<EntityStore> componentAccessor, Ref<EntityStore> ref, Instant currentTime, Condition[] conditions) Determines whether all conditions are met.static booleanallConditionsMet(ComponentAccessor<EntityStore> componentAccessor, Ref<EntityStore> ref, Instant currentTime, EntityStatType.Regenerating regenerating) Determines whether all conditions are met.booleaneval(ComponentAccessor<EntityStore> componentAccessor, Ref<EntityStore> ref, Instant currentTime) Called to evaluate the condition for the given entity.abstract booleaneval0(ComponentAccessor<EntityStore> componentAccessor, Ref<EntityStore> ref, Instant currentTime) The internal evaluation method for the condition.toString()
-
Field Details
-
CODEC
A codec map codec for allConditioninstances.
-
-
Constructor Details
-
Condition
public Condition(boolean inverse) Constructor for aConditioninstance.- Parameters:
inverse- Whether to invert the condition.
-
-
Method Details
-
eval
public boolean eval(@Nonnull ComponentAccessor<EntityStore> componentAccessor, @Nonnull Ref<EntityStore> ref, @Nonnull Instant currentTime) Called to evaluate the condition for the given entity.- Parameters:
componentAccessor- TheComponentAccessor<EntityStore>for store access.ref- The entity reference of the entity.currentTime- The current world time.- Returns:
trueif the condition is met,falseotherwise.
-
eval0
public abstract boolean eval0(@Nonnull ComponentAccessor<EntityStore> componentAccessor, @Nonnull Ref<EntityStore> ref, @Nonnull Instant currentTime) The internal evaluation method for the condition.- Parameters:
componentAccessor- TheComponentAccessor<EntityStore>for store access.ref- The entity reference of the entity.currentTime- The current world time.- Returns:
trueif the condition is met,falseotherwise.
-
allConditionsMet
public static boolean allConditionsMet(@Nonnull ComponentAccessor<EntityStore> componentAccessor, @Nonnull Ref<EntityStore> ref, @Nonnull Instant currentTime, @Nonnull EntityStatType.Regenerating regenerating) Determines whether all conditions are met.- Parameters:
componentAccessor- TheComponentAccessor<EntityStore>for store access.ref- The entity reference of the entity.currentTime- The current world time.regenerating- TheEntityStatType.Regeneratinginstance containing the conditions.- Returns:
trueif all conditions are met,falseotherwise.
-
allConditionsMet
public static boolean allConditionsMet(@Nonnull ComponentAccessor<EntityStore> componentAccessor, @Nonnull Ref<EntityStore> ref, @Nonnull Instant currentTime, @Nonnull Condition[] conditions) Determines whether all conditions are met.- Parameters:
componentAccessor- TheComponentAccessor<EntityStore>for store access.ref- The entity reference of the entity.currentTime- The current world time.conditions- The array ofConditioninstances to evaluate.- Returns:
trueif all conditions are met,falseotherwise.
-
toString
-