Record Class GradientFunction.ClampedSampler
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.densityfunction.generator.GradientFunction.ClampedSampler
- All Implemented Interfaces:
DensitySampler, GradientFunction.GradientSampler
- Enclosing class:
GradientFunction
private static record GradientFunction.ClampedSampler(Direction.Axis axis, int fromCoordinate, int minCoordinate, int maxCoordinate, 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 thefromCoordinaterecord component.private final floatThe field for thefromValuerecord component.private final intThe field for themaxCoordinaterecord component.private final intThe field for theminCoordinaterecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateClampedSampler(Direction.Axis axis, int fromCoordinate, int minCoordinate, int maxCoordinate, float fromValue, float coordinateFactor) Creates an instance of aClampedSamplerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaxis()Returns the value of theaxisrecord component.floatcompute(int coordinate) floatReturns the value of thecoordinateFactorrecord 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.intReturns the value of themaxCoordinaterecord component.intReturns the value of theminCoordinaterecord component.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. -
minCoordinate
private final int minCoordinateThe field for theminCoordinaterecord component. -
maxCoordinate
private final int maxCoordinateThe field for themaxCoordinaterecord component. -
fromValue
private final float fromValueThe field for thefromValuerecord component. -
coordinateFactor
private final float coordinateFactorThe field for thecoordinateFactorrecord component.
-
-
Constructor Details
-
ClampedSampler
private ClampedSampler(Direction.Axis axis, int fromCoordinate, int minCoordinate, int maxCoordinate, float fromValue, float coordinateFactor) Creates an instance of aClampedSamplerrecord class.- Parameters:
axis- the value for theaxisrecord componentfromCoordinate- the value for thefromCoordinaterecord componentminCoordinate- the value for theminCoordinaterecord componentmaxCoordinate- the value for themaxCoordinaterecord 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
-
minCoordinate
public int minCoordinate()Returns the value of theminCoordinaterecord component.- Returns:
- the value of the
minCoordinaterecord component
-
maxCoordinate
public int maxCoordinate()Returns the value of themaxCoordinaterecord component.- Returns:
- the value of the
maxCoordinaterecord 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
-