Record Class PotionEffectWrapper

java.lang.Object
java.lang.Record
de.eldoria.jacksonbukkit.entities.PotionEffectWrapper
Record Components:
amplifier - Effect amplifier
duration - Effect duration
type - Effect type
ambient - Indicates ambient effect
particles - Indicates particles on effect
icon - Indicates effect with icon

public record PotionEffectWrapper(int amplifier, int duration, PotionEffectType type, boolean ambient, boolean particles, boolean icon) extends Record
Class for wrapping a PotionEffect.
  • Constructor Details

  • Method Details

    • amplifier

      public int amplifier()
      Effect amplifier
      Returns:
      amplifier
    • duration

      public int duration()
      Effect duration
      Returns:
      duration
    • type

      public PotionEffectType type()
      Effect type
      Returns:
      type
    • ambient

      public boolean ambient()
      Indicates ambient effect
      Returns:
      true when ambient
    • particles

      public boolean particles()
      Indicates particles on effect
      Returns:
      true when particles are visible
    • icon

      public boolean icon()
      Indicates effect with icon
      Returns:
      true when icon visible
    • of

      public static PotionEffectWrapper of(PotionEffect effect)
      Create a new PotionEffectWrapper based on a PotionEffect.
      Parameters:
      effect - potion effect instance
      Returns:
      new PotionEffectWrapper instance
    • toBukkitPotionEffect

      public PotionEffect toBukkitPotionEffect()
      Constructs a new PotionEffect based on wrapper values.
      Returns:
      new PotionEffect instance
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.