Class ElementalReaction
java.lang.Object
io.github.xrickastley.sevenelements.element.reaction.ElementalReaction
- Direct Known Subclasses:
AbstractBloomElementalReaction,AbstractBurningElementalReaction,AbstractCrystallizeElementalReaction,AbstractDendroCoreElementalReaction,AbstractShatterElementalReaction,AbstractSuperconductElementalReaction,AbstractSwirlElementalReaction,AdditiveElementalReaction,AmplifyingElementalReaction,ElectroChargedElementalReaction,FrozenElementalReaction,OverloadedElementalReaction,QuickenElementalReaction
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanprotected final booleanprotected final Identifierprotected final Stringprotected final booleanprotected final Set<Identifier> protected final doubleprotected final booleanprotected final @Nullable Text -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddisplayReaction(LivingEntity target) intgetElementPair(Element element) static List<LivingEntity> getEntitiesInAoE(LivingEntity target, double radius) static List<LivingEntity> getEntitiesInAoE(LivingEntity target, double radius, Predicate<LivingEntity> filter) intgetId()intgetPriority(Element triggeringElement) Gets the priority of this Elemental Reaction.intgetPriority(ElementalApplication application) Gets the priority of this Elemental Reaction.static floatgetReactionDamage(Entity entity, double reactionMultiplier) static floatgetReactionDamage(Entity entity, float reactionMultiplier) static floatgetReactionDamage(ServerWorld world, double reactionMultiplier) static floatgetReactionDamage(ServerWorld world, float reactionMultiplier) @Nullable TextgetText()intbooleanhasAnyElement(Collection<Element> elements) booleanhasAnyElement(Stream<Element> elements) booleanhasElement(Element element) booleanidEquals(ElementalReaction reaction) booleanisTriggerable(Entity entity) booleanisTriggerable(LivingEntity entity) protected abstract voidonReaction(LivingEntity entity, ElementalApplication auraElement, ElementalApplication triggeringElement, double reducedGauge, @Nullable LivingEntity origin) The function to execute after the Elemental Reaction has been triggered.protected final voidonTrigger(LivingEntity entity, ElementalApplication auraElement, ElementalApplication triggeringElement, double reducedGauge, @Nullable LivingEntity origin) booleanpreventsReaction(ElementalReaction reaction) booleanpreventsReaction(Identifier reactionId) booleanbooleanbooleanbooleantrigger(LivingEntity entity) booleantrigger(LivingEntity entity, @Nullable LivingEntity origin)
-
Field Details
-
name
-
id
-
text
-
reactionCoefficient
protected final double reactionCoefficient -
auraElement
-
triggeringElement
-
reversable
protected final boolean reversable -
applyResultAsAura
protected final boolean applyResultAsAura -
endsReactionTrigger
protected final boolean endsReactionTrigger -
preventsPriorityUpgrade
protected final boolean preventsPriorityUpgrade -
preventsReactionsAfter
-
reactionDisplayOrder
-
-
Constructor Details
-
ElementalReaction
-
-
Method Details
-
getReactionDamage
-
getReactionDamage
-
getReactionDamage
-
getReactionDamage
-
getEntitiesInAoE
-
getEntitiesInAoE
public static List<LivingEntity> getEntitiesInAoE(LivingEntity target, double radius, Predicate<LivingEntity> filter) -
hasElement
-
hasAnyElement
-
hasAnyElement
-
getAuraElement
-
getTriggeringElement
-
getAuraElementPriority
public int getAuraElementPriority() -
getTriggeringElementPriority
public int getTriggeringElementPriority() -
getHighestElementPriority
public int getHighestElementPriority() -
getText
-
getElementPair
-
getReactionDisplayOrder
-
shouldApplyResultAsAura
public boolean shouldApplyResultAsAura() -
shouldEndReactionTrigger
public boolean shouldEndReactionTrigger() -
shouldPreventPriorityUpgrade
public boolean shouldPreventPriorityUpgrade() -
preventsReaction
-
preventsReaction
-
getPriority
Gets the priority of this Elemental Reaction.- Parameters:
application- The applied Elemental Application, which should be the triggering element.- Returns:
- The priority of this Elemental Reaction.
-
getPriority
Gets the priority of this Elemental Reaction.- Parameters:
triggeringElement- The applied element, also known as the triggering element.- Returns:
- The priority of this Elemental Reaction.
-
onReaction
protected abstract void onReaction(LivingEntity entity, ElementalApplication auraElement, ElementalApplication triggeringElement, double reducedGauge, @Nullable @Nullable LivingEntity origin) The function to execute after the Elemental Reaction has been triggered. This function is executed after both elements have reacted and have been reduced.- Parameters:
entity- TheLivingEntitythis Elemental Reaction was triggered on.auraElement- The aura element that triggered this reaction.triggeringElement- The triggering element that reacted with the aura element.reducedGauge- The gauge units reduced from both Elements. This will always beMath.min(auraElementGU, triggeringElementGU * reactionCoefficient)origin- TheLivingEntitythat triggered this Elemental Reaction.
-
getId
-
isTriggerable
-
isTriggerable
-
trigger
-
trigger
-
onTrigger
protected final void onTrigger(LivingEntity entity, ElementalApplication auraElement, ElementalApplication triggeringElement, double reducedGauge, @Nullable @Nullable LivingEntity origin) -
idEquals
-
displayReaction
-