Record Class DistanceToPointFunction
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.densityfunction.generator.DistanceToPointFunction
- All Implemented Interfaces:
DensityFunction
public record DistanceToPointFunction(Vec3i point, DistanceMetric metric)
extends Record
implements DensityFunction
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface DensityFunction
DensityFunction.Axes, DensityFunction.CompileContext -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<DistanceToPointFunction> private final DistanceMetricThe field for themetricrecord component.private final Vec3iThe field for thepointrecord component.Fields inherited from interface DensityFunction
ALL_AXES, AXIS_X, AXIS_Y, AXIS_Z, NO_AXES, REFERENCE_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionDistanceToPointFunction(Vec3i point, DistanceMetric metric) Creates an instance of aDistanceToPointFunctionrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<DistanceToPointFunction> codec()intfinal 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.point()Returns the value of thepointrecord component.range()rewriteChildren(DfRewriteRule rule) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
point
The field for thepointrecord component. -
metric
The field for themetricrecord component. -
CODEC
-
-
Constructor Details
-
DistanceToPointFunction
Creates an instance of aDistanceToPointFunctionrecord class.- Parameters:
point- the value for thepointrecord componentmetric- the value for themetricrecord component
-
-
Method Details
-
compileSampler
- Specified by:
compileSamplerin interfaceDensityFunction
-
range
- Specified by:
rangein interfaceDensityFunction
-
domainAxes
public int domainAxes()- Specified by:
domainAxesin interfaceDensityFunction
-
codec
- Specified by:
codecin interfaceDensityFunction
-
rewriteChildren
- Specified by:
rewriteChildrenin interfaceDensityFunction
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
point
Returns the value of thepointrecord component.- Returns:
- the value of the
pointrecord component
-
metric
Returns the value of themetricrecord component.- Returns:
- the value of the
metricrecord component
-