Interface DensityFunction
- All Known Subinterfaces:
- ChunkNoiseSampler.ParentedNoiseType,- DensityFunction.Base,- DensityFunctionTypes.Beardifying,- DensityFunctionTypes.BinaryOperationLike,- DensityFunctionTypes.Offset,- DensityFunctionTypes.Positional,- DensityFunctionTypes.Unary,- DensityFunctionTypes.Wrapper
- All Known Implementing Classes:
- ChunkNoiseSampler.BlendAlphaDensityFunction,- ChunkNoiseSampler.BlendOffsetDensityFunction,- ChunkNoiseSampler.Cache2D,- ChunkNoiseSampler.CacheOnce,- ChunkNoiseSampler.CellCache,- ChunkNoiseSampler.DensityInterpolator,- ChunkNoiseSampler.FlatCache,- DensityFunctionTypes.Beardifier,- DensityFunctionTypes.BinaryOperation,- DensityFunctionTypes.BlendAlpha,- DensityFunctionTypes.BlendDensity,- DensityFunctionTypes.BlendOffset,- DensityFunctionTypes.Clamp,- DensityFunctionTypes.Constant,- DensityFunctionTypes.EndIslands,- DensityFunctionTypes.LinearOperation,- DensityFunctionTypes.Noise,- DensityFunctionTypes.RangeChoice,- DensityFunctionTypes.RegistryEntryHolder,- DensityFunctionTypes.Shift,- DensityFunctionTypes.ShiftA,- DensityFunctionTypes.ShiftB,- DensityFunctionTypes.ShiftedNoise,- DensityFunctionTypes.Spline,- DensityFunctionTypes.UnaryOperation,- DensityFunctionTypes.WeirdScaledSampler,- DensityFunctionTypes.Wrapping,- DensityFunctionTypes.YClampedGradient,- InterpolatedNoiseSampler,- StructureWeightSampler
public interface DensityFunction
Represents a function that maps from a block position to a density value.
 
It can be defined in code or in data packs by using pre-defined function types
 like constant values or add, which in turn use other density functions
 to define their operands.
- Mappings:
- Namespace - Name - named - net/minecraft/world/gen/densityfunction/DensityFunction- intermediary - net/minecraft/class_6910- official - ehi
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic interfaceRepresents a density function that has no other density functions as an argument, and provides default implementations ofDensityFunction.Base.fill(double[], net.minecraft.world.gen.densityfunction.DensityFunction.EachApplier)andDensityFunction.Base.apply(DensityFunctionVisitor)for this case.static interfacestatic interfaceEachApplieris used to fill an array of densities, like a density buffer or cache, with values from a density function.static final recordstatic interfaceNoisePosrepresents the absolute block position that is passed to density functions.static final record
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<DensityFunction> static final com.mojang.serialization.Codec<DensityFunction> static final com.mojang.serialization.Codec<RegistryEntry<DensityFunction>> 
- 
Method SummaryModifier and TypeMethodDescriptiondefault DensityFunctionabs()Applies the visitor to every child density function andthis.default DensityFunctionclamp(double min, double max) default DensityFunctioncube()voidfill(double[] densities, DensityFunction.EachApplier applier) Fills an array of densities usingthisdensity function and theDensityFunction.EachApplier.CodecHolder<? extends DensityFunction> default DensityFunctiondoublemaxValue()doubleminValue()default DensityFunctiondoubleReturns the density value for the given block position.default DensityFunctionsquare()default DensityFunctionsqueeze()
- 
Field Details- 
CODEC- Mappings:
- Namespace - Name - Mixin selector - named - CODEC- Lnet/minecraft/world/gen/densityfunction/DensityFunction;CODEC:Lcom/mojang/serialization/Codec;- intermediary - field_37057- Lnet/minecraft/class_6910;field_37057:Lcom/mojang/serialization/Codec;- official - b- Lehi;b:Lcom/mojang/serialization/Codec;
 
- 
REGISTRY_ENTRY_CODEC- Mappings:
- Namespace - Name - Mixin selector - named - REGISTRY_ENTRY_CODEC- Lnet/minecraft/world/gen/densityfunction/DensityFunction;REGISTRY_ENTRY_CODEC:Lcom/mojang/serialization/Codec;- intermediary - field_37058- Lnet/minecraft/class_6910;field_37058:Lcom/mojang/serialization/Codec;- official - c- Lehi;c:Lcom/mojang/serialization/Codec;
 
- 
FUNCTION_CODEC- Mappings:
- Namespace - Name - Mixin selector - named - FUNCTION_CODEC- Lnet/minecraft/world/gen/densityfunction/DensityFunction;FUNCTION_CODEC:Lcom/mojang/serialization/Codec;- intermediary - field_37059- Lnet/minecraft/class_6910;field_37059:Lcom/mojang/serialization/Codec;- official - d- Lehi;d:Lcom/mojang/serialization/Codec;
 
 
- 
- 
Method Details- 
sampleReturns the density value for the given block position.- Parameters:
- pos- the block position
- Returns:
- the density value for the given block position
- Mappings:
- Namespace - Name - Mixin selector - named - sample- Lnet/minecraft/world/gen/densityfunction/DensityFunction;sample(Lnet/minecraft/world/gen/densityfunction/DensityFunction$NoisePos;)D- intermediary - method_40464- Lnet/minecraft/class_6910;method_40464(Lnet/minecraft/class_6910$class_6912;)D- official - a- Lehi;a(Lehi$b;)D
 
- 
fillFills an array of densities usingthisdensity function and theDensityFunction.EachApplier.- Parameters:
- densities- the array of densities to fill, like a buffer or a cache
- applier- the- EachApplierto use. It has a method for filling the array, as well as to get a block position for an index
- Mappings:
- Namespace - Name - Mixin selector - named - fill- Lnet/minecraft/world/gen/densityfunction/DensityFunction;fill([DLnet/minecraft/world/gen/densityfunction/DensityFunction$EachApplier;)V- intermediary - method_40470- Lnet/minecraft/class_6910;method_40470([DLnet/minecraft/class_6910$class_6911;)V- official - a- Lehi;a([DLehi$a;)V
 
- 
applyApplies the visitor to every child density function andthis.- Parameters:
- visitor- the visitor that should be applied to this density function
- Returns:
- the resulting density function
- Mappings:
- Namespace - Name - Mixin selector - named - apply- Lnet/minecraft/world/gen/densityfunction/DensityFunction;apply(Lnet/minecraft/world/gen/densityfunction/DensityFunction$DensityFunctionVisitor;)Lnet/minecraft/world/gen/densityfunction/DensityFunction;- intermediary - method_40469- Lnet/minecraft/class_6910;method_40469(Lnet/minecraft/class_6910$class_6915;)Lnet/minecraft/class_6910;- official - a- Lehi;a(Lehi$f;)Lehi;
 
- 
minValuedouble minValue()- Mappings:
- Namespace - Name - Mixin selector - named - minValue- Lnet/minecraft/world/gen/densityfunction/DensityFunction;minValue()D- intermediary - comp_377- Lnet/minecraft/class_6910;comp_377()D- official - a- Lehi;a()D
 
- 
maxValuedouble maxValue()- Mappings:
- Namespace - Name - Mixin selector - named - maxValue- Lnet/minecraft/world/gen/densityfunction/DensityFunction;maxValue()D- intermediary - comp_378- Lnet/minecraft/class_6910;comp_378()D- official - b- Lehi;b()D
 
- 
getCodecHolderCodecHolder<? extends DensityFunction> getCodecHolder()- Mappings:
- Namespace - Name - Mixin selector - named - getCodecHolder- Lnet/minecraft/world/gen/densityfunction/DensityFunction;getCodecHolder()Lnet/minecraft/util/dynamic/CodecHolder;- intermediary - method_41062- Lnet/minecraft/class_6910;method_41062()Lnet/minecraft/class_7243;- official - c- Lehi;c()Lazs;
 
- 
clamp- Mappings:
- Namespace - Name - Mixin selector - named - clamp- Lnet/minecraft/world/gen/densityfunction/DensityFunction;clamp(DD)Lnet/minecraft/world/gen/densityfunction/DensityFunction;- intermediary - method_40468- Lnet/minecraft/class_6910;method_40468(DD)Lnet/minecraft/class_6910;- official - a- Lehi;a(DD)Lehi;
 
- 
abs- Mappings:
- Namespace - Name - Mixin selector - named - abs- Lnet/minecraft/world/gen/densityfunction/DensityFunction;abs()Lnet/minecraft/world/gen/densityfunction/DensityFunction;- intermediary - method_40471- Lnet/minecraft/class_6910;method_40471()Lnet/minecraft/class_6910;- official - d- Lehi;d()Lehi;
 
- 
square- Mappings:
- Namespace - Name - Mixin selector - named - square- Lnet/minecraft/world/gen/densityfunction/DensityFunction;square()Lnet/minecraft/world/gen/densityfunction/DensityFunction;- intermediary - method_40472- Lnet/minecraft/class_6910;method_40472()Lnet/minecraft/class_6910;- official - e- Lehi;e()Lehi;
 
- 
cube- Mappings:
- Namespace - Name - Mixin selector - named - cube- Lnet/minecraft/world/gen/densityfunction/DensityFunction;cube()Lnet/minecraft/world/gen/densityfunction/DensityFunction;- intermediary - method_40473- Lnet/minecraft/class_6910;method_40473()Lnet/minecraft/class_6910;- official - f- Lehi;f()Lehi;
 
- 
halfNegative- Mappings:
- Namespace - Name - Mixin selector - named - halfNegative- Lnet/minecraft/world/gen/densityfunction/DensityFunction;halfNegative()Lnet/minecraft/world/gen/densityfunction/DensityFunction;- intermediary - method_40474- Lnet/minecraft/class_6910;method_40474()Lnet/minecraft/class_6910;- official - g- Lehi;g()Lehi;
 
- 
quarterNegative- Mappings:
- Namespace - Name - Mixin selector - named - quarterNegative- Lnet/minecraft/world/gen/densityfunction/DensityFunction;quarterNegative()Lnet/minecraft/world/gen/densityfunction/DensityFunction;- intermediary - method_40475- Lnet/minecraft/class_6910;method_40475()Lnet/minecraft/class_6910;- official - h- Lehi;h()Lehi;
 
- 
squeeze- Mappings:
- Namespace - Name - Mixin selector - named - squeeze- Lnet/minecraft/world/gen/densityfunction/DensityFunction;squeeze()Lnet/minecraft/world/gen/densityfunction/DensityFunction;- intermediary - method_40476- Lnet/minecraft/class_6910;method_40476()Lnet/minecraft/class_6910;- official - i- Lehi;i()Lehi;
 
 
-