Record Class InterpolatedFunction.Sampler
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.densityfunction.op.InterpolatedFunction.Sampler
- All Implemented Interfaces:
DensitySampler
- Enclosing class:
InterpolatedFunction
private static record InterpolatedFunction.Sampler(DensitySampler input, int cellSizeXz, int cellSizeY, float cellSizeXzInv, float cellSizeYInv)
extends Record
implements DensitySampler
-
Nested Class Summary
Nested classes/interfaces inherited from interface DensitySampler
DensitySampler.Bound -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe field for thecellSizeXzrecord component.private final floatThe field for thecellSizeXzInvrecord component.private final intThe field for thecellSizeYrecord component.private final floatThe field for thecellSizeYInvrecord component.private final DensitySamplerThe field for theinputrecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateSampler(DensitySampler input, int cellSizeXz, int cellSizeY, float cellSizeXzInv, float cellSizeYInv) Creates an instance of aSamplerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thecellSizeXzrecord component.floatReturns the value of thecellSizeXzInvrecord component.intReturns the value of thecellSizeYrecord component.floatReturns the value of thecellSizeYInvrecord component.final booleanIndicates whether some other object is "equal to" this one.private voidfillCell(DensityBuffer outputBuffer, DensityVolume outputVolume, DensityVolume cellVolume, int cellX, int cellY, int cellZ, float v000, float v100, float v010, float v110, float v001, float v101, float v011, float v111) final inthashCode()Returns a hash code value for this object.input()Returns the value of theinputrecord component.floatsampleValue(SamplerContext context, int blockX, int blockY, int blockZ) voidsampleVolume(SamplerContext context, DensityBuffer outputBuffer, DensityVolume volume) private voidsampleWithBlockStep(SamplerContext context, DensityBuffer outputBuffer, DensityVolume volume) private voidsampleWithNonBlockStep(SamplerContext context, DensityBuffer outputBuffer, DensityVolume volume) final StringtoString()Returns a string representation of this record class.Methods inherited from interface DensitySampler
bind
-
Field Details
-
input
The field for theinputrecord component. -
cellSizeXz
private final int cellSizeXzThe field for thecellSizeXzrecord component. -
cellSizeY
private final int cellSizeYThe field for thecellSizeYrecord component. -
cellSizeXzInv
private final float cellSizeXzInvThe field for thecellSizeXzInvrecord component. -
cellSizeYInv
private final float cellSizeYInvThe field for thecellSizeYInvrecord component.
-
-
Constructor Details
-
Sampler
private Sampler(DensitySampler input, int cellSizeXz, int cellSizeY, float cellSizeXzInv, float cellSizeYInv) Creates an instance of aSamplerrecord class.- Parameters:
input- the value for theinputrecord componentcellSizeXz- the value for thecellSizeXzrecord componentcellSizeY- the value for thecellSizeYrecord componentcellSizeXzInv- the value for thecellSizeXzInvrecord componentcellSizeYInv- the value for thecellSizeYInvrecord component
-
-
Method Details
-
sampleVolume
- Specified by:
sampleVolumein interfaceDensitySampler
-
sampleWithNonBlockStep
private void sampleWithNonBlockStep(SamplerContext context, DensityBuffer outputBuffer, DensityVolume volume) -
sampleWithBlockStep
private void sampleWithBlockStep(SamplerContext context, DensityBuffer outputBuffer, DensityVolume volume) -
fillCell
private void fillCell(DensityBuffer outputBuffer, DensityVolume outputVolume, DensityVolume cellVolume, int cellX, int cellY, int cellZ, float v000, float v100, float v010, float v110, float v001, float v101, float v011, float v111) -
sampleValue
- Specified by:
sampleValuein interfaceDensitySampler
-
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. -
input
Returns the value of theinputrecord component.- Returns:
- the value of the
inputrecord component
-
cellSizeXz
public int cellSizeXz()Returns the value of thecellSizeXzrecord component.- Returns:
- the value of the
cellSizeXzrecord component
-
cellSizeY
public int cellSizeY()Returns the value of thecellSizeYrecord component.- Returns:
- the value of the
cellSizeYrecord component
-
cellSizeXzInv
public float cellSizeXzInv()Returns the value of thecellSizeXzInvrecord component.- Returns:
- the value of the
cellSizeXzInvrecord component
-
cellSizeYInv
public float cellSizeYInv()Returns the value of thecellSizeYInvrecord component.- Returns:
- the value of the
cellSizeYInvrecord component
-