Record Class DistanceToPointFunction.Sampler
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.densityfunction.generator.DistanceToPointFunction.Sampler
- All Implemented Interfaces:
DensitySampler
- Enclosing class:
DistanceToPointFunction
private static record DistanceToPointFunction.Sampler(int x, int y, int z, DistanceMetric metric)
extends Record
implements DensitySampler
-
Nested Class Summary
Nested classes/interfaces inherited from interface DensitySampler
DensitySampler.Bound -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DistanceMetricThe field for themetricrecord component.private final intThe field for thexrecord component.private final intThe field for theyrecord component.private final intThe field for thezrecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateSampler(int x, int y, int z, DistanceMetric metric) Creates an instance of aSamplerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.metric()Returns the value of themetricrecord 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.intx()Returns the value of thexrecord component.inty()Returns the value of theyrecord component.intz()Returns the value of thezrecord component.Methods inherited from interface DensitySampler
bind
-
Field Details
-
x
private final int xThe field for thexrecord component. -
y
private final int yThe field for theyrecord component. -
z
private final int zThe field for thezrecord component. -
metric
The field for themetricrecord component.
-
-
Constructor Details
-
Sampler
Creates an instance of aSamplerrecord class.- Parameters:
x- the value for thexrecord componenty- the value for theyrecord componentz- the value for thezrecord componentmetric- the value for themetricrecord component
-
-
Method Details
-
sampleVolume
- Specified by:
sampleVolumein interfaceDensitySampler
-
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. -
x
public int x()Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
y
public int y()Returns the value of theyrecord component.- Returns:
- the value of the
yrecord component
-
z
public int z()Returns the value of thezrecord component.- Returns:
- the value of the
zrecord component
-
metric
Returns the value of themetricrecord component.- Returns:
- the value of the
metricrecord component
-