Record Class ContextBoundSampler
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.densityfunction.ContextBoundSampler
- All Implemented Interfaces:
DensitySampler
public record ContextBoundSampler(ContextKey<? extends DensitySampler> key, DensitySampler fallbackSampler)
extends Record
implements DensitySampler
-
Nested Class Summary
Nested classes/interfaces inherited from interface DensitySampler
DensitySampler.Bound -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DensitySamplerThe field for thefallbackSamplerrecord component.private final ContextKey<? extends DensitySampler> The field for thekeyrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionContextBoundSampler(ContextKey<? extends DensitySampler> key, DensitySampler fallbackSampler) Creates an instance of aContextBoundSamplerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of thefallbackSamplerrecord component.final inthashCode()Returns a hash code value for this object.ContextKey<? extends DensitySampler> key()Returns the value of thekeyrecord 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
-
key
The field for thekeyrecord component. -
fallbackSampler
The field for thefallbackSamplerrecord component.
-
-
Constructor Details
-
ContextBoundSampler
public ContextBoundSampler(ContextKey<? extends DensitySampler> key, DensitySampler fallbackSampler) Creates an instance of aContextBoundSamplerrecord class.- Parameters:
key- the value for thekeyrecord componentfallbackSampler- the value for thefallbackSamplerrecord 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. All components in this record class are compared withObjects::equals(Object,Object). -
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
fallbackSampler
Returns the value of thefallbackSamplerrecord component.- Returns:
- the value of the
fallbackSamplerrecord component
-