Record Class SuspiciousStewEffects

java.lang.Object
java.lang.Record
fr.fidorial.item.component.SuspiciousStewEffects
Record Components:
effects - the effects, in the order they are given

public record SuspiciousStewEffects(List<SuspiciousStewEffects.Entry> effects) extends Record
The effects a suspicious stew gives whoever eats it, under minecraft:suspicious_stew_effects.
Since:
0.1.0
  • Field Details

    • DEFAULT_DURATION

      public static final int DEFAULT_DURATION
      How long an effect lasts when its duration is not given, in ticks.
      Since:
      0.1.0
      See Also:
    • EMPTY

      public static final SuspiciousStewEffects EMPTY
      No effect at all.
      Since:
      0.1.0
  • Constructor Details

    • SuspiciousStewEffects

      public SuspiciousStewEffects(List<SuspiciousStewEffects.Entry> effects)
      Creates the effects of a suspicious stew.
      Parameters:
      effects - the effects, in the order they are given
      Since:
      0.1.0
  • Method Details

    • of

      public static SuspiciousStewEffects of(TypedKey<MobEffect> effect, int duration)
      Returns the effects of a stew that gives a single effect.
      Parameters:
      effect - the effect
      duration - how long it lasts, in ticks
      Returns:
      the effects of a stew that gives a single effect
      Since:
      0.1.0
    • plus

      Returns these effects followed by one more.
      Parameters:
      entry - the effect to append
      Returns:
      these effects followed by one more
      Since:
      0.1.0
    • 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
    • equals

      public final boolean equals(Object o)
      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:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • effects

      public List<SuspiciousStewEffects.Entry> effects()
      Returns the value of the effects record component.
      Returns:
      the value of the effects record component