Record Class ParticleEffectData
java.lang.Object
java.lang.Record
johnsmith.enchantingoverhauled.api.enchantment.theme.effect.ParticleEffectData
- Record Components:
effect- TheParticleTypeto spawn (e.g.,minecraft:soul).velocity- The base directional velocity vector(x, y, z)applied to the spawned particle.velocityVariance- A random variance vector(x, y, z)added to the base velocity for scattering.offset- The base offset vector(x, y, z)from the center of the table, provider, or entity.offsetVariance- A random variance vector(x, y, z)added to the base offset for scattering the spawn point.
public record ParticleEffectData(net.minecraft.core.particles.ParticleType<?> effect, net.minecraft.world.phys.Vec3 velocity, net.minecraft.world.phys.Vec3 velocityVariance, net.minecraft.world.phys.Vec3 offset, net.minecraft.world.phys.Vec3 offsetVariance)
extends Record
A data-driven record defining the specific parameters for spawning a particle effect
associated with an
EnchantmentTheme.
The spawn rate (iterations and chance) is controlled by the parent EffectData record.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ParticleEffectData> The codec responsible for serializing and deserializing instances of this record from JSON. -
Constructor Summary
ConstructorsConstructorDescriptionParticleEffectData(net.minecraft.core.particles.ParticleType<?> effect, net.minecraft.world.phys.Vec3 velocity, net.minecraft.world.phys.Vec3 velocityVariance, net.minecraft.world.phys.Vec3 offset, net.minecraft.world.phys.Vec3 offsetVariance) Creates an instance of aParticleEffectDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.core.particles.ParticleType<?> effect()Returns the value of theeffectrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.minecraft.world.phys.Vec3offset()Returns the value of theoffsetrecord component.net.minecraft.world.phys.Vec3Returns the value of theoffsetVariancerecord component.final StringtoString()Returns a string representation of this record class.net.minecraft.world.phys.Vec3velocity()Returns the value of thevelocityrecord component.net.minecraft.world.phys.Vec3Returns the value of thevelocityVariancerecord component.
-
Field Details
-
CODEC
The codec responsible for serializing and deserializing instances of this record from JSON. UsesBuiltInRegistries.PARTICLE_TYPE's name codec to resolve theParticleType.
-
-
Constructor Details
-
ParticleEffectData
public ParticleEffectData(net.minecraft.core.particles.ParticleType<?> effect, net.minecraft.world.phys.Vec3 velocity, net.minecraft.world.phys.Vec3 velocityVariance, net.minecraft.world.phys.Vec3 offset, net.minecraft.world.phys.Vec3 offsetVariance) Creates an instance of aParticleEffectDatarecord class.- Parameters:
effect- the value for theeffectrecord componentvelocity- the value for thevelocityrecord componentvelocityVariance- the value for thevelocityVariancerecord componentoffset- the value for theoffsetrecord componentoffsetVariance- the value for theoffsetVariancerecord component
-
-
Method Details
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
effect
public net.minecraft.core.particles.ParticleType<?> effect()Returns the value of theeffectrecord component.- Returns:
- the value of the
effectrecord component
-
velocity
public net.minecraft.world.phys.Vec3 velocity()Returns the value of thevelocityrecord component.- Returns:
- the value of the
velocityrecord component
-
velocityVariance
public net.minecraft.world.phys.Vec3 velocityVariance()Returns the value of thevelocityVariancerecord component.- Returns:
- the value of the
velocityVariancerecord component
-
offset
public net.minecraft.world.phys.Vec3 offset()Returns the value of theoffsetrecord component.- Returns:
- the value of the
offsetrecord component
-
offsetVariance
public net.minecraft.world.phys.Vec3 offsetVariance()Returns the value of theoffsetVariancerecord component.- Returns:
- the value of the
offsetVariancerecord component
-