Class InternalCooldownContext
java.lang.Object
io.github.xrickastley.sevenelements.element.InternalCooldownContext
An
The origin is the
The tag, referred to as the
The type, referred to as the
The Internal Cooldown may still be taken into account without an
InternalCooldownContext is a class used for holding the various InternalCooldown
components together in a single class. It also contains utility functions for getting the
InternalCooldown instance from an InternalCooldownContext instance.
Definitions
ICD is the commonly used shorthand term for Internal Cooldown, a system that handles how frequent elements (of the same type) are applied by the same attack.The origin is the
LivingEntity the elemental attack comes from. Each LivingEntity
has their own seperate Internal Cooldown, ensuring that same tag and type(s) that come
from different entities are handled respectively, allowing the Internal Cooldown of entity "A"
to not conflict with that of entity "B". The tag, referred to as the
InternalCooldownTag in this codebase, is internally a
String that identifes the attack. This tag can be shared or differ across different
elemental attacks, and is one of the factors that dictate Whether two elemental attacks (with the
same Element) share ICD. The type, referred to as the
InternalCooldownType in this codebase, is an instance of
InternalCooldownType that controls the "Reset Interval" and the "Gauge Sequence" for an attack.
Much like the tag, this type can be shared or differ across different elemental attacks, and is also
one of the factors that dictate Whether two elemental attacks (with the same Element) share ICD. Sharing ICD
For ICD to be "shared", the two elemental attacks in question must:- Be applied from the same
origin - Have the same
tag - Have the same
type
"Removing" ICD
Internal Cooldown is only taken into account when anorigin exists. If no origin
exists, the element is regarded to have been applied by other means, such as the environment. The Internal Cooldown may still be taken into account without an
origin by using
InternalCooldownContext#forced. All forced Internal Cooldowns
without an origin are grouped under this holder.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanprivate static final UUIDprivate final @Nullable LivingEntityprivate final InternalCooldownTagprivate final InternalCooldownType -
Constructor Summary
ConstructorsModifierConstructorDescriptionInternalCooldownContext(@Nullable LivingEntity origin, InternalCooldownTag tag, InternalCooldownType type) privateInternalCooldownContext(@Nullable LivingEntity origin, InternalCooldownTag tag, InternalCooldownType type, boolean force) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()forced()@Nullable InternalCooldowngetInternalCooldown(ElementHolder holder) @Nullable LivingEntityprivate @Nullable UUIDgetUuid()booleanbooleanstatic InternalCooldownContextofDefault(@Nullable Entity origin, InternalCooldownTag tag) static InternalCooldownContextstatic InternalCooldownContextofDefault(@Nullable LivingEntity origin, InternalCooldownTag tag) static InternalCooldownContextofDefault(@Nullable LivingEntity origin, @Nullable String tag) static InternalCooldownContextofNone()static InternalCooldownContextstatic InternalCooldownContextofNone(@Nullable LivingEntity origin) static InternalCooldownContextofType(@Nullable Entity origin, InternalCooldownTag tag, InternalCooldownType type) static InternalCooldownContextofType(@Nullable Entity origin, @Nullable String tag, InternalCooldownType type) static InternalCooldownContextofType(@Nullable LivingEntity origin, InternalCooldownTag tag, InternalCooldownType type) static InternalCooldownContextofType(@Nullable LivingEntity origin, @Nullable String tag, InternalCooldownType type) toString()withOrigin(@Nullable LivingEntity origin)
-
Field Details
-
FORCE_HANDLER_UUID
-
origin
-
tag
-
type
-
force
private final boolean force
-
-
Constructor Details
-
InternalCooldownContext
public InternalCooldownContext(@Nullable @Nullable LivingEntity origin, InternalCooldownTag tag, InternalCooldownType type) -
InternalCooldownContext
private InternalCooldownContext(@Nullable @Nullable LivingEntity origin, InternalCooldownTag tag, InternalCooldownType type, boolean force)
-
-
Method Details
-
ofNone
-
ofNone
-
ofNone
-
ofDefault
public static InternalCooldownContext ofDefault(@Nullable @Nullable Entity origin, @Nullable @Nullable String tag) -
ofDefault
public static InternalCooldownContext ofDefault(@Nullable @Nullable Entity origin, InternalCooldownTag tag) -
ofDefault
public static InternalCooldownContext ofDefault(@Nullable @Nullable LivingEntity origin, @Nullable @Nullable String tag) -
ofDefault
public static InternalCooldownContext ofDefault(@Nullable @Nullable LivingEntity origin, InternalCooldownTag tag) -
ofType
public static InternalCooldownContext ofType(@Nullable @Nullable Entity origin, @Nullable @Nullable String tag, InternalCooldownType type) -
ofType
public static InternalCooldownContext ofType(@Nullable @Nullable Entity origin, InternalCooldownTag tag, InternalCooldownType type) -
ofType
public static InternalCooldownContext ofType(@Nullable @Nullable LivingEntity origin, @Nullable @Nullable String tag, InternalCooldownType type) -
ofType
public static InternalCooldownContext ofType(@Nullable @Nullable LivingEntity origin, InternalCooldownTag tag, InternalCooldownType type) -
builder
-
getUuid
-
withOrigin
-
forced
-
hasInternalCooldown
public boolean hasInternalCooldown() -
getInternalCooldown
-
getInternalCooldown
-
hasOrigin
public boolean hasOrigin() -
getOrigin
-
toString
-