Class AbstractCrystallizeElementalReaction
java.lang.Object
io.github.xrickastley.sevenelements.element.reaction.ElementalReaction
io.github.xrickastley.sevenelements.element.reaction.AbstractCrystallizeElementalReaction
- Direct Known Subclasses:
CryoCrystallizeElementalReaction,ElectroCrystallizeElementalReaction,FrozenCrystallizeElementalReaction,HydroCrystallizeElementalReaction,PyroCrystallizeElementalReaction
public abstract sealed class AbstractCrystallizeElementalReaction
extends ElementalReaction
permits PyroCrystallizeElementalReaction, HydroCrystallizeElementalReaction, ElectroCrystallizeElementalReaction, CryoCrystallizeElementalReaction, FrozenCrystallizeElementalReaction
-
Nested Class Summary
Nested classes/interfaces inherited from class io.github.xrickastley.sevenelements.element.reaction.ElementalReaction
ElementalReaction.Settings -
Field Summary
FieldsFields inherited from class io.github.xrickastley.sevenelements.element.reaction.ElementalReaction
applyResultAsAura, auraElement, endsReactionTrigger, id, name, preventsPriorityUpgrade, preventsReactionsAfter, reactionCoefficient, reactionDisplayOrder, reversable, text, triggeringElement -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate Vec3dclampToGround(World world, Vec3d pos) protected voidonReaction(LivingEntity entity, ElementalApplication auraElement, ElementalApplication triggeringElement, double reducedGauge, @Nullable LivingEntity origin) The function to execute after the Elemental Reaction has been triggered.scan(World world, BlockPos originPos, Vec3i shift, Predicate<BlockState> blockPredicate, Predicate<BlockPos> posPredicate) Starting from the specifiedinitialBlockPos, continuously scan by shfiting theinitialBlockPosbyshiftuntil theBlockat the shifted pos fulfills theblockPredicateor untilposPredicatereturnsfalse.private Vec3dtoAbsolutePos(LivingEntity entity, Vec3d lookingPos) Methods inherited from class io.github.xrickastley.sevenelements.element.reaction.ElementalReaction
displayReaction, getAuraElement, getAuraElementPriority, getElementPair, getEntitiesInAoE, getEntitiesInAoE, getHighestElementPriority, getId, getPriority, getPriority, getReactionDamage, getReactionDamage, getReactionDamage, getReactionDamage, getReactionDisplayOrder, getText, getTriggeringElement, getTriggeringElementPriority, hasAnyElement, hasAnyElement, hasElement, idEquals, isTriggerable, isTriggerable, onTrigger, preventsReaction, preventsReaction, shouldApplyResultAsAura, shouldEndReactionTrigger, shouldPreventPriorityUpgrade, trigger, trigger
-
Field Details
-
AIR_BLOCKS
-
-
Constructor Details
-
AbstractCrystallizeElementalReaction
AbstractCrystallizeElementalReaction(ElementalReaction.Settings settings)
-
-
Method Details
-
onReaction
protected void onReaction(LivingEntity entity, ElementalApplication auraElement, ElementalApplication triggeringElement, double reducedGauge, @Nullable @Nullable LivingEntity origin) Description copied from class:ElementalReactionThe function to execute after the Elemental Reaction has been triggered. This function is executed after both elements have reacted and have been reduced.- Specified by:
onReactionin classElementalReaction- 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.
-
toAbsolutePos
-
clampToGround
-
scan
private Optional<BlockPos> scan(World world, BlockPos originPos, Vec3i shift, Predicate<BlockState> blockPredicate, Predicate<BlockPos> posPredicate) Starting from the specifiedinitialBlockPos, continuously scan by shfiting theinitialBlockPosbyshiftuntil theBlockat the shifted pos fulfills theblockPredicateor untilposPredicatereturnsfalse.
Returns either anOptionalcontaining theBlockPossuch thatblockPredicate.test(world.getBlockState(blockPos))returnsfalseor an emptyOptionalwhenposPredicate.test(blockPos)prematurely returnsfalse.- Parameters:
world- The world.originPos- The origin block pos.shift- How much to shift by per iteration.blockPredicate- The condition that must be fulfilled by the block at the specified position.posPredicate- The condition that must be fulfilled for a next iteration to execute.
-