Record Class SpawnParticlesEffect.PositionSource
java.lang.Object
java.lang.Record
net.minecraft.world.item.enchantment.effects.SpawnParticlesEffect.PositionSource
- Enclosing class:
SpawnParticlesEffect
public static record SpawnParticlesEffect.PositionSource(SpawnParticlesEffect.PositionSourceType type, float offset, float scale)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<SpawnParticlesEffect.PositionSource> private final floatThe field for theoffsetrecord component.private final floatThe field for thescalerecord component.private final SpawnParticlesEffect.PositionSourceTypeThe field for thetyperecord component. -
Constructor Summary
ConstructorsConstructorDescriptionPositionSource(SpawnParticlesEffect.PositionSourceType type, float offset, float scale) Creates an instance of aPositionSourcerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.doublegetCoordinate(double pPosition, double pCenter, float pSize, RandomSource pRandom) final inthashCode()Returns a hash code value for this object.floatoffset()Returns the value of theoffsetrecord component.floatscale()Returns the value of thescalerecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Field Details
-
type
The field for thetyperecord component. -
offset
private final float offsetThe field for theoffsetrecord component. -
scale
private final float scaleThe field for thescalerecord component. -
CODEC
-
-
Constructor Details
-
PositionSource
Creates an instance of aPositionSourcerecord class.- Parameters:
type- the value for thetyperecord componentoffset- the value for theoffsetrecord componentscale- the value for thescalerecord component
-
-
Method Details
-
getCoordinate
-
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 '=='. -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
offset
public float offset()Returns the value of theoffsetrecord component.- Returns:
- the value of the
offsetrecord component
-
scale
public float scale()Returns the value of thescalerecord component.- Returns:
- the value of the
scalerecord component
-