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
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec
<SpawnParticlesEffect.PositionSource> private final float
The field for theoffset
record component.private final float
The field for thescale
record component.private final SpawnParticlesEffect.PositionSourceType
The field for thetype
record component. -
Constructor Summary
ConstructorDescriptionPositionSource
(SpawnParticlesEffect.PositionSourceType type, float offset, float scale) Creates an instance of aPositionSource
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.double
getCoordinate
(double p_345009_, double p_352916_, float p_344887_, RandomSource p_345452_) final int
hashCode()
Returns a hash code value for this object.float
offset()
Returns the value of theoffset
record component.float
scale()
Returns the value of thescale
record component.final String
toString()
Returns a string representation of this record class.type()
Returns the value of thetype
record component.
-
Field Details
-
type
The field for thetype
record component. -
offset
private final float offsetThe field for theoffset
record component. -
scale
private final float scaleThe field for thescale
record component. -
CODEC
-
-
Constructor Details
-
PositionSource
Creates an instance of aPositionSource
record class.- Parameters:
type
- the value for thetype
record componentoffset
- the value for theoffset
record componentscale
- the value for thescale
record component
-
-
Method Details
-
getCoordinate
public double getCoordinate(double p_345009_, double p_352916_, float p_344887_, RandomSource p_345452_) -
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 thetype
record component.- Returns:
- the value of the
type
record component
-
offset
public float offset()Returns the value of theoffset
record component.- Returns:
- the value of the
offset
record component
-
scale
public float scale()Returns the value of thescale
record component.- Returns:
- the value of the
scale
record component
-