Record Class ParticleCatalog

java.lang.Object
java.lang.Record
dev.wyck.wrapper.environment.particle.ParticleCatalog
Record Components:
particles - The list of wrapped ambient particles.

@NullMarked @AsOf("2.1.0") public record ParticleCatalog(List<AmbientParticle> particles) extends Record
An abstraction of List<AmbientParticle> from Minecraft.
Since:
1.1.0
  • Field Details

  • Constructor Details

    • ParticleCatalog

      @AsOf("2.1.0") public ParticleCatalog(List<AmbientParticle> particles)
      Creates an instance of a ParticleCatalog record class.
      Parameters:
      particles - the value for the particles record component
  • Method Details

    • ofSimple

      @AsOf("1.1.0") public static ParticleCatalog ofSimple(ParticleTypes particleType, float probability)
      Creates a ParticleCatalog with a single complex particle.
      Parameters:
      particleType - The wrapped particle type.
      probability - The probability of the particle.
      Returns:
      A ParticleCatalog containing the specified complex particle.
    • ofComplex

      @AsOf("1.1.0") public static ParticleCatalog ofComplex(ParticleTypes particleType, float probability, ParticleData data)
      Creates a ParticleCatalog with a single complex particle.
      Parameters:
      particleType - The wrapped particle type.
      probability - The probability of the particle.
      data - The particle data.
      Returns:
      A ParticleCatalog containing the specified complex particle.
    • with

      @AsOf("2.1.0") public ParticleCatalog with(ParticleTypes type, float probability)
      Creates a new ParticleCatalog with the specified particle added.
      Parameters:
      type - The wrapped particle type.
      probability - The probability of the particle.
      Returns:
      A new ParticleCatalog with the specified particle added.
      Since:
      2.1.0
    • with

      @AsOf("2.1.0") public <T extends ParticleData> ParticleCatalog with(ParticleTypes type, float probability, @Nullable T data)
      Creates a new ParticleCatalog with the specified particle added.
      Parameters:
      type - The wrapped particle type.
      probability - The probability of the particle.
      data - The particle data.
      Returns:
      A new ParticleCatalog with the specified particle added.
      Since:
      2.1.0
    • toBuilder

      @AsOf("3.0.0") public ParticleCatalog.Builder toBuilder()
      Converts this ParticleCatalog to a Builder.
      Returns:
      A new Builder instance with the same properties as this instance.
      Since:
      3.0.0
    • builder

      @AsOf("1.1.0") public static ParticleCatalog.Builder builder()
      Creates a new ParticleCatalog builder.
      Returns:
      A new ParticleCatalog builder.
      Since:
      1.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.
    • particles

      public List<AmbientParticle> particles()
      Returns the value of the particles record component.
      Returns:
      the value of the particles record component