Record Class AmbientParticle
java.lang.Object
java.lang.Record
fr.fidorial.world.environment.AmbientParticle
- Record Components:
type- theminecraft:particle_typekey, e.g.minecraft:ashprobability- chance, per random tick of an empty space, that the particle spawns; must be in[0, 1]
-
Constructor Summary
ConstructorsConstructorDescriptionAmbientParticle(Key type, float probability) Creates an instance of aAmbientParticlerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static AmbientParticleCreates an ambient particle.floatReturns the value of theprobabilityrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
AmbientParticle
Creates an instance of aAmbientParticlerecord class.- Parameters:
type- the value for thetyperecord componentprobability- the value for theprobabilityrecord component
-
-
Method Details
-
of
Creates an ambient particle.- Parameters:
type- the particle type keyprobability- spawn probability- Returns:
- the particle
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
type
-
probability
public float probability()Returns the value of theprobabilityrecord component.- Returns:
- the value of the
probabilityrecord component
-