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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder for creating ParticleCatalog instances. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionParticleCatalog(List<AmbientParticle> particles) Creates an instance of aParticleCatalogrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic ParticleCatalog.Builderbuilder()Creates a new ParticleCatalog builder.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static ParticleCatalogofComplex(ParticleTypes particleType, float probability, ParticleData data) Creates a ParticleCatalog with a single complex particle.static ParticleCatalogofSimple(ParticleTypes particleType, float probability) Creates a ParticleCatalog with a single complex particle.Returns the value of theparticlesrecord component.Converts this ParticleCatalog to a Builder.final StringtoString()Returns a string representation of this record class.with(ParticleTypes type, float probability) Creates a new ParticleCatalog with the specified particle added.<T extends ParticleData>
ParticleCatalogwith(ParticleTypes type, float probability, @Nullable T data) Creates a new ParticleCatalog with the specified particle added.
-
Field Details
-
EMPTY
-
-
Constructor Details
-
ParticleCatalog
Creates an instance of aParticleCatalogrecord class.- Parameters:
particles- the value for theparticlesrecord 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
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
Converts this ParticleCatalog to a Builder.- Returns:
- A new Builder instance with the same properties as this instance.
- Since:
- 3.0.0
-
builder
Creates a new ParticleCatalog builder.- Returns:
- A new ParticleCatalog builder.
- Since:
- 1.1.0
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object). -
particles
-