Record Class Element.ParticleRenderer
java.lang.Object
java.lang.Record
io.github.xrickastley.sevenelements.element.Element.ParticleRenderer
- Enclosing class:
Element
private static record Element.ParticleRenderer(ParticleType<? extends ParticleEffect> particle, Vec3d relativePos, Vec3d delta, double speed, int count, NbtCompound compound)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final NbtCompoundThe field for thecompoundrecord component.private final intThe field for thecountrecord component.private final Vec3dThe field for thedeltarecord component.private final ParticleType<? extends ParticleEffect> The field for theparticlerecord component.private static final Randomprivate final Vec3dThe field for therelativePosrecord component.private final doubleThe field for thespeedrecord component. -
Constructor Summary
ConstructorsModifierConstructorDescription(package private)ParticleRenderer(ParticleType<? extends ParticleEffect> particle, Vec3d relativePos, Vec3d delta, double speed, int count) (package private)ParticleRenderer(ParticleType<? extends ParticleEffect> particle, Vec3d relativePos, Vec3d delta, double speed, int count, String nbt) privateParticleRenderer(ParticleType<? extends ParticleEffect> particle, Vec3d relativePos, Vec3d delta, double speed, int count, NbtCompound compound) Creates an instance of aParticleRendererrecord class. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddMultipleParticles(LivingEntity entity, Vec3d pos) private voidaddSingleParticle(LivingEntity entity, Vec3d pos) compound()Returns the value of thecompoundrecord component.intcount()Returns the value of thecountrecord component.delta()Returns the value of thedeltarecord component.final booleanIndicates whether some other object is "equal to" this one.private ParticleEffectgetParticle(World world) final inthashCode()Returns a hash code value for this object.private static NbtCompoundparseCompound(String nbt) ParticleType<? extends ParticleEffect> particle()Returns the value of theparticlerecord component.Returns the value of therelativePosrecord component.private voidrender(LivingEntity entity) doublespeed()Returns the value of thespeedrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
particle
The field for theparticlerecord component. -
relativePos
The field for therelativePosrecord component. -
delta
The field for thedeltarecord component. -
speed
private final double speedThe field for thespeedrecord component. -
count
private final int countThe field for thecountrecord component. -
compound
The field for thecompoundrecord component. -
random
-
-
Constructor Details
-
ParticleRenderer
ParticleRenderer(ParticleType<? extends ParticleEffect> particle, Vec3d relativePos, Vec3d delta, double speed, int count, String nbt) -
ParticleRenderer
ParticleRenderer(ParticleType<? extends ParticleEffect> particle, Vec3d relativePos, Vec3d delta, double speed, int count) -
ParticleRenderer
private ParticleRenderer(ParticleType<? extends ParticleEffect> particle, Vec3d relativePos, Vec3d delta, double speed, int count, NbtCompound compound) Creates an instance of aParticleRendererrecord class.- Parameters:
particle- the value for theparticlerecord componentrelativePos- the value for therelativePosrecord componentdelta- the value for thedeltarecord componentspeed- the value for thespeedrecord componentcount- the value for thecountrecord componentcompound- the value for thecompoundrecord component
-
-
Method Details
-
parseCompound
-
getParticle
-
render
-
addSingleParticle
-
addMultipleParticles
-
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. -
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. -
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 '=='. -
particle
Returns the value of theparticlerecord component.- Returns:
- the value of the
particlerecord component
-
relativePos
Returns the value of therelativePosrecord component.- Returns:
- the value of the
relativePosrecord component
-
delta
Returns the value of thedeltarecord component.- Returns:
- the value of the
deltarecord component
-
speed
public double speed()Returns the value of thespeedrecord component.- Returns:
- the value of the
speedrecord component
-
count
public int count()Returns the value of thecountrecord component.- Returns:
- the value of the
countrecord component
-
compound
Returns the value of thecompoundrecord component.- Returns:
- the value of the
compoundrecord component
-