Class Element.ElementSettings
java.lang.Object
io.github.xrickastley.sevenelements.element.Element.ElementSettings
- Enclosing class:
Element
A class used in creating data for Elements, instead of multiple overloaded constructors.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate booleanprivate Colorprivate booleanprivate @Nullable Function<ElementalApplication, Number> private booleanprivate Predicate<ElementalApplication> private @Nullable Elementprivate @Nullable Element.ParticleRendererprivate intprivate booleanprivate Identifier -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbypassesCooldown(boolean bypassesCooldown) Sets if the Elemental Application tied to this element is tied to can bypass Internal Cooldown.canBeAura(boolean aura) Sets if the element can be an Aura Element.static Element.ElementSettingscreate()Creates a new, empty instance ofElementSettings.decayInheritance(boolean decayInheritance) Sets if the element has decay rate inheritance.hasAuraTax(boolean auraTax) Sets if the element, when applied as an Aura Element, would have its Gauge Units deducted by the Aura Tax.linkElement(Element element) Links the providedelementto this element.linkGaugeDecay(boolean link) Sets whether the gauge decay is linked to the gauge of this element, or the gauge of the corresponding element, ifreversewastruefor.invalid reference
ElementSettings#linkedElementlinkGaugeDecayIf(Predicate<ElementalApplication> predicate) Sets whether, at this instance in time, the gauge decay is linked to the gauge of this element, or the gauge of the corresponding element, ifreversewastruefor.invalid reference
ElementSettings#linkedElementlinkToElement(Element element) Links this element to the providedelement.particleRenderer(Element.ParticleRenderer particleRenderer) Sets the particle renderer for this Element.setDamageColor(Color damageColor) Sets the damage color of the element.setDecayRate(@NotNull Function<ElementalApplication, Number> decayRate) Sets the function controlling the decay rate of this element.setPriority(int priority) Controls the priority of this element over the others.setTexture(Identifier texture) Sets the texture of the element.
-
Field Details
-
texture
-
damageColor
-
priority
private int priority -
decayRate
-
canBeAura
private boolean canBeAura -
decayInheritance
private boolean decayInheritance -
bypassesCooldown
private boolean bypassesCooldown -
hasAuraTax
private boolean hasAuraTax -
linkedElement
-
reverseLinkedElement
private boolean reverseLinkedElement -
linkDecayOnlyIf
-
particleRenderer
-
-
Constructor Details
-
ElementSettings
private ElementSettings()
-
-
Method Details
-
create
Creates a new, empty instance ofElementSettings. -
setTexture
Sets the texture of the element.- Parameters:
texture- The texture of the element.
-
setDamageColor
Sets the damage color of the element.- Parameters:
damageColor- The damage color of the element.
-
setPriority
Controls the priority of this element over the others.
An element's priority dictates when it can be applied, reapplied, reacted with or when it is rendered on top of the entity. Element priority uses natural ordering, also known as ascending order or "least to greatest".
For more information, you may refer to the methods that use Element priority.- Parameters:
priority- The priority of this element.- See Also:
-
setDecayRate
public Element.ElementSettings setDecayRate(@NotNull @NotNull Function<ElementalApplication, Number> decayRate) Sets the function controlling the decay rate of this element.
This function must output a numberxsuch thatxis the amount of Gauge Units deducted per tick.- Parameters:
decayRate- The damage color of the element.
-
canBeAura
Sets if the element can be an Aura Element.- Parameters:
aura- If the element can be an Aura Element.
-
hasAuraTax
Sets if the element, when applied as an Aura Element, would have its Gauge Units deducted by the Aura Tax.- Parameters:
auraTax- If the element's Gauge Units should be deducted by the Aura Tax.
-
bypassesCooldown
Sets if the Elemental Application tied to this element is tied to can bypass Internal Cooldown.- Parameters:
bypassesCooldown- If the Elemental Application tied to this element can bypass Internal Cooldown.
-
decayInheritance
Sets if the element has decay rate inheritance.- Parameters:
decayInheritance- If the element has decay rate inheritance.
-
particleRenderer
Sets the particle renderer for this Element.
This renders particles on the entity per tick while the element is applied.- Parameters:
particleRenderer- The particle renderer to use.
-
linkToElement
Links this element to the providedelement.
Upon linking, gauge reduction not originating from the gauge decay will be "synced" to the gauge units of this element, if it exists.
Do note that linking isn't a "recursive" operation, i.e. Element A linked to Element B, Element B linked to Element C, reduction on Element A, B and C.
You may also choose to sync the gauge decay permanently or with aPredicate.- Parameters:
element- TheElementto link this element to.- See Also:
-
linkElement
Links the providedelementto this element.
Upon linking, gauge reduction not originating from the gauge decay will be "synced" to the gauge units of the providedelement, if it exists.
Do note that linking isn't a "recursive" operation, i.e. Element A linked to Element B, Element B linked to Element C, reduction on Element A, B and C.
You may also choose to sync the gauge decay permanently or with aPredicate.- Parameters:
element- TheElementto link to this element.- See Also:
-
linkGaugeDecay
Sets whether the gauge decay is linked to the gauge of this element, or the gauge of the corresponding element, ifreversewastruefor.invalid reference
ElementSettings#linkedElement- Parameters:
link- Whether the gauge decay is also linked.
-
linkGaugeDecayIf
Sets whether, at this instance in time, the gauge decay is linked to the gauge of this element, or the gauge of the corresponding element, ifreversewastruefor.invalid reference
ElementSettings#linkedElement- Parameters:
predicate- APredicateindicating whether the gauge decay is also linked at this instance in time. The passedElementalApplicationis the one belonging to the linked element, or more formally, the element this element is linked to.
-