Record Class ElementalInfusionComponent

java.lang.Object
java.lang.Record
io.github.xrickastley.sevenelements.component.ElementalInfusionComponent

public record ElementalInfusionComponent(ElementalApplication.Builder elementalInfusion, InternalCooldownContext.Builder internalCooldown) extends Record
  • Field Details

  • Constructor Details

    • ElementalInfusionComponent

      public ElementalInfusionComponent(@Nullable ElementalApplication.Builder elementalInfusion, @Nullable InternalCooldownContext.Builder internalCooldown)
      Creates an instance of a ElementalInfusionComponent record class.
      Parameters:
      elementalInfusion - the value for the elementalInfusion record component
      internalCooldown - the value for the internalCooldown record component
  • Method Details

    • applyToDamageSource

      public static Optional<ElementalDamageSource> applyToDamageSource(DamageSource source, Entity target)
    • applyInfusion

      public static void applyInfusion(ItemStack stack, ElementalApplication.Builder applicationBuilder, InternalCooldownContext.Builder icdBuilder)
    • removeInfusion

      public static boolean removeInfusion(ItemStack stack)
    • hasInfusion

      public static boolean hasInfusion(ItemStack stack)
    • ofNone

      public static ElementalInfusionComponent ofNone()
    • hasElementalInfusion

      public boolean hasElementalInfusion()
    • getElementalInfusion

      @Nullable public @Nullable ElementalApplication getElementalInfusion(LivingEntity target)
    • getElement

      @Nullable public @Nullable Element getElement()
    • getGaugeUnits

      public double getGaugeUnits()
    • apply

      public Optional<ElementalDamageSource> apply(DamageSource source, Entity target)
    • equals

      public boolean equals(Object obj)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      obj - the object with which to compare
      Returns:
      true if this object is the same as the obj argument; false otherwise.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • elementalInfusion

      @Nullable public ElementalApplication.Builder elementalInfusion()
      Returns the value of the elementalInfusion record component.
      Returns:
      the value of the elementalInfusion record component
    • internalCooldown

      @Nullable public InternalCooldownContext.Builder internalCooldown()
      Returns the value of the internalCooldown record component.
      Returns:
      the value of the internalCooldown record component