Record Class GradientFunction.RepeatSampler
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.densityfunction.generator.GradientFunction.RepeatSampler
- All Implemented Interfaces:
DensitySampler, GradientFunction.GradientSampler
- Enclosing class:
GradientFunction
private static record GradientFunction.RepeatSampler(Direction.Axis axis, int fromCoordinate, int coordinateRange, float fromValue, float coordinateFactor)
extends Record
implements GradientFunction.GradientSampler
-
Nested Class Summary
Nested classes/interfaces inherited from interface DensitySampler
DensitySampler.Bound -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Direction.AxisThe field for theaxisrecord component.private final floatThe field for thecoordinateFactorrecord component.private final intThe field for thecoordinateRangerecord component.private final intThe field for thefromCoordinaterecord component.private final floatThe field for thefromValuerecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateRepeatSampler(Direction.Axis axis, int fromCoordinate, int coordinateRange, float fromValue, float coordinateFactor) Creates an instance of aRepeatSamplerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaxis()Returns the value of theaxisrecord component.floatcompute(int coordinate) floatReturns the value of thecoordinateFactorrecord component.intReturns the value of thecoordinateRangerecord component.final booleanIndicates whether some other object is "equal to" this one.intReturns the value of thefromCoordinaterecord component.floatReturns the value of thefromValuerecord component.final inthashCode()Returns a hash code value for this object.floatsampleValue(SamplerContext context, int blockX, int blockY, int blockZ) voidsampleVolume(SamplerContext context, DensityBuffer outputBuffer, DensityVolume volume) final StringtoString()Returns a string representation of this record class.Methods inherited from interface DensitySampler
bind
-
Field Details
-
axis
The field for theaxisrecord component. -
fromCoordinate
private final int fromCoordinateThe field for thefromCoordinaterecord component. -
coordinateRange
private final int coordinateRangeThe field for thecoordinateRangerecord component. -
fromValue
private final float fromValueThe field for thefromValuerecord component. -
coordinateFactor
private final float coordinateFactorThe field for thecoordinateFactorrecord component.
-
-
Constructor Details
-
RepeatSampler
private RepeatSampler(Direction.Axis axis, int fromCoordinate, int coordinateRange, float fromValue, float coordinateFactor) Creates an instance of aRepeatSamplerrecord class.- Parameters:
axis- the value for theaxisrecord componentfromCoordinate- the value for thefromCoordinaterecord componentcoordinateRange- the value for thecoordinateRangerecord componentfromValue- the value for thefromValuerecord componentcoordinateFactor- the value for thecoordinateFactorrecord component
-
-
Method Details
-
sampleVolume
- Specified by:
sampleVolumein interfaceDensitySampler
-
sampleValue
- Specified by:
sampleValuein interfaceDensitySampler
-
compute
public float compute(int coordinate) - Specified by:
computein interfaceGradientFunction.GradientSampler
-
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. -
axis
Returns the value of theaxisrecord component.- Specified by:
axisin interfaceGradientFunction.GradientSampler- Returns:
- the value of the
axisrecord component
-
fromCoordinate
public int fromCoordinate()Returns the value of thefromCoordinaterecord component.- Returns:
- the value of the
fromCoordinaterecord component
-
coordinateRange
public int coordinateRange()Returns the value of thecoordinateRangerecord component.- Returns:
- the value of the
coordinateRangerecord component
-
fromValue
public float fromValue()Returns the value of thefromValuerecord component.- Returns:
- the value of the
fromValuerecord component
-
coordinateFactor
public float coordinateFactor()Returns the value of thecoordinateFactorrecord component.- Returns:
- the value of the
coordinateFactorrecord component
-