Interface DensityFunction
A density function. Either a reference to a registered one or an authored composition of other
density functions.
- Since:
- 2.4.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumCaching markers that wrap a function without changing its value.static interfacestatic enumTwo-argument arithmetic operations.static enumThe three coordinate-shift samplers.static enumSingle-argument value transforms.Nested classes/interfaces inherited from interface Wrapper
Wrapper.Context<C> -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault DensityFunctionabs()Creates a new density function that is the absolute value of the input function.default DensityFunctionadd(DensityFunction other) Adds this density function to another density function.static DensityFunctionadd(DensityFunction first, DensityFunction second) Creates a new density function by adding two other density functions together.static DensityFunctionCreates a new density function that is the absolute value of the input function.default DensityFunctionReturns the absolute value of this density function.static DensityFunctionblendDensity(DensityFunction input) Creates a new density function that is the absolute value of the input function.static DensityFunctionCreates a new density function that is the absolute value of the input function.default DensityFunctioncache2d()Creates a new density function that is the absolute value of the input function.default DensityFunctionCreates a new density function that is the absolute value of the input function.default DensityFunctionCreates a new density function that is the absolute value of the input function.default DensityFunctionclamp(double min, double max) Creates a new density function that is the absolute value of the input function.static DensityFunctionconstant(double value) Creates a constant density function.default DensityFunctioncube()Creates a new density function that is the absolute value of the input function.static DensityFunctionendIslands(long seed) Creates a new density function that is the absolute value of the input function.default DensityFunctionfindTopSurface(DensityFunction upperBound, int lowerBound, int cellHeight) Returns the absolute value of this density function.static DensityFunctionfindTopSurface(DensityFunction density, DensityFunction upperBound, int lowerBound, int cellHeight) Creates a new density function that is the absolute value of the input function.default DensityFunctionCreates a new density function that is the absolute value of the input function.default DensityFunctionCreates a new density function that is the absolute value of the input function.default DensityFunctionCreates a new density function that is the absolute value of the input function.default DensityFunctioninvert()Creates a new density function that is the absolute value of the input function.static DensityFunctionmappedNoise(ResourceKey noiseParameters, double minTarget, double maxTarget) Creates a new density function that is the absolute value of the input function.static DensityFunctionmappedNoise(ResourceKey noiseParameters, double xzScale, double yScale, double minTarget, double maxTarget) Creates a new density function that is the absolute value of the input function.default DensityFunctionmax(DensityFunction other) Returns the maximum of this density function and another density function.static DensityFunctionmax(DensityFunction first, DensityFunction second) Creates a new density function that is the maximum of two other density functions.default DensityFunctionmin(DensityFunction other) Returns the minimum of this density function and another density function.static DensityFunctionmin(DensityFunction first, DensityFunction second) Creates a new density function that is the minimum of two other density functions.default DensityFunctionmul(DensityFunction other) Multiplies this density function by another density function.static DensityFunctionmul(DensityFunction first, DensityFunction second) Creates a new density function by multiplying two other density functions together.static DensityFunctionnoise(ResourceKey noiseParameters) Creates a new density function that is the absolute value of the input function.static DensityFunctionnoise(ResourceKey noiseParameters, double xzScale, double yScale) Creates a new density function that is the absolute value of the input function.default DensityFunctionCreates a new density function that is the absolute value of the input function.default DensityFunctionrangeChoice(double minInclusive, double maxExclusive, DensityFunction whenInRange, DensityFunction whenOutOfRange) Returns the absolute value of this density function.static DensityFunctionrangeChoice(DensityFunction input, double minInclusive, double maxExclusive, DensityFunction whenInRange, DensityFunction whenOutOfRange) Creates a new density function that is the absolute value of the input function.static DensityFunctionreference(ResourceKey key) Creates a reference to a registered density function.static DensityFunctionshift(ResourceKey noiseParameters) Creates a new density function that is the absolute value of the input function.static DensityFunctionshiftA(ResourceKey noiseParameters) Creates a new density function that is the absolute value of the input function.static DensityFunctionshiftB(ResourceKey noiseParameters) Creates a new density function that is the absolute value of the input function.static DensityFunctionshiftedNoise2d(DensityFunction shiftX, DensityFunction shiftZ, double xzScale, ResourceKey noiseParameters) Creates a new density function that is the absolute value of the input function.default DensityFunctionshiftedNoise2dX(DensityFunction shiftZ, double xzScale, ResourceKey noiseParameters) Returns the absolute value of this density function.default DensityFunctionshiftedNoise2dZ(DensityFunction shiftX, double xzScale, ResourceKey noiseParameters) Returns the absolute value of this density function.default DensityFunctionsquare()Creates a new density function that is the absolute value of the input function.default DensityFunctionsqueeze()Creates a new density function that is the absolute value of the input function.static DensityFunctionyClampedGradient(int fromY, int toY, double fromValue, double toValue) Creates a new density function that is the absolute value of the input function.static DensityFunctionzero()Creates a density function that always returns 0.Methods inherited from interface Wrapper
asHandle, toMinecraft
-
Field Details
-
WIRE
-
-
Method Details
-
add
Adds this density function to another density function.- Parameters:
other- the density function to add- Returns:
- a new density function that is the sum of this density function and the other density function
- Since:
- 2.4.0
-
mul
Multiplies this density function by another density function.- Parameters:
other- the density function to multiply by- Returns:
- a new density function that is the product of this density function and the other density function
- Since:
- 2.4.0
-
min
Returns the minimum of this density function and another density function.- Parameters:
other- the density function to compare with- Returns:
- a new density function that is the minimum of this density function and the other density function
- Since:
- 2.4.0
-
max
Returns the maximum of this density function and another density function.- Parameters:
other- the density function to compare with- Returns:
- a new density function that is the maximum of this density function and the other density function
- Since:
- 2.4.0
-
shiftedNoise2dX
@AsOf("2.4.0") default DensityFunction shiftedNoise2dX(DensityFunction shiftZ, double xzScale, ResourceKey noiseParameters) Returns the absolute value of this density function.- Parameters:
shiftZ- 2D noise function to shift the Z axis ofxzScale- scale factor for the X and Z axesnoiseParameters- the noise parameters to use for the noise function- Returns:
- a new density function that is the absolute value of this density function
- Since:
- 2.4.0
-
shiftedNoise2dZ
@AsOf("2.4.0") default DensityFunction shiftedNoise2dZ(DensityFunction shiftX, double xzScale, ResourceKey noiseParameters) Returns the absolute value of this density function.- Parameters:
shiftX- 2D noise function to shift the X axis ofxzScale- scale factor for the X and Z axesnoiseParameters- the noise parameters to use for the noise function- Returns:
- a new density function that is the absolute value of this density function
- Since:
- 2.4.0
-
rangeChoice
@AsOf("2.4.0") default DensityFunction rangeChoice(double minInclusive, double maxExclusive, DensityFunction whenInRange, DensityFunction whenOutOfRange) Returns the absolute value of this density function.- Parameters:
minInclusive- the minimum value of the input functionmaxExclusive- the maximum value of the input functionwhenInRange- the density function to return if the input function is within the rangewhenOutOfRange- the density function to return if the input function is outside the range- Returns:
- a new density function that is the absolute value of this density function
- Since:
- 2.4.0
-
blendDensity
Returns the absolute value of this density function.- Returns:
- a new density function that is the absolute value of this density function
- Since:
- 2.4.0
-
findTopSurface
@AsOf("2.4.0") default DensityFunction findTopSurface(DensityFunction upperBound, int lowerBound, int cellHeight) Returns the absolute value of this density function.- Parameters:
upperBound- the upper bound of the surfacelowerBound- the lower bound of the surfacecellHeight- the height of the cell to find the surface in- Returns:
- a new density function that is the absolute value of this density function
- Since:
- 2.4.0
-
reference
Creates a reference to a registered density function.- Parameters:
key- the key of an entry in the density-function registry- Returns:
- a reference to that density function
- Since:
- 2.4.0
-
constant
Creates a constant density function.- Parameters:
value- the constant value of the function- Returns:
- a constant density function
- Since:
- 2.4.0
-
zero
Creates a density function that always returns 0.- Returns:
- a density function that always returns 0
- Since:
- 2.4.0
-
add
Creates a new density function by adding two other density functions together.- Parameters:
first- the first density functionsecond- the second density function- Returns:
- a new density function that is the sum of the two input functions
- Since:
- 2.4.0
-
mul
Creates a new density function by multiplying two other density functions together.- Parameters:
first- the first density functionsecond- the second density function- Returns:
- a new density function that is the product of the two input functions
- Since:
- 2.4.0
-
min
Creates a new density function that is the minimum of two other density functions.- Parameters:
first- the first density functionsecond- the second density function- Returns:
- a new density function that is the minimum of the two input functions
- Since:
- 2.4.0
-
max
Creates a new density function that is the maximum of two other density functions.- Parameters:
first- the first density functionsecond- the second density function- Returns:
- a new density function that is the maximum of the two input functions
- Since:
- 2.4.0
-
noise
Creates a new density function that is the absolute value of the input function.- Parameters:
noiseParameters- the noise parameters to use for the noise function- Returns:
- a new density function that is the absolute value of the input function
- Since:
- 2.4.0
-
noise
@AsOf("2.4.0") static DensityFunction noise(ResourceKey noiseParameters, double xzScale, double yScale) Creates a new density function that is the absolute value of the input function.- Parameters:
noiseParameters- the noise parameters to use for the noise functionxzScale- the scale factor for the x and z axesyScale- the scale factor for the y-axis- Returns:
- a new density function that is the absolute value of the input function
- Since:
- 2.4.0
-
mappedNoise
@AsOf("2.4.0") static DensityFunction mappedNoise(ResourceKey noiseParameters, double minTarget, double maxTarget) Creates a new density function that is the absolute value of the input function.- Parameters:
noiseParameters- the noise parameters to use for the noise functionminTarget- the minimum value of the output functionmaxTarget- the maximum value of the output function- Returns:
- a new density function that is the absolute value of the input function
- Since:
- 2.4.0
-
mappedNoise
@AsOf("2.4.0") static DensityFunction mappedNoise(ResourceKey noiseParameters, double xzScale, double yScale, double minTarget, double maxTarget) Creates a new density function that is the absolute value of the input function.- Parameters:
noiseParameters- the noise parameters to use for the noise functionxzScale- the scale factor for the x and z axesyScale- the scale factor for the y-axisminTarget- the minimum value of the output functionmaxTarget- the maximum value of the output function- Returns:
- a new density function that is the absolute value of the input function
- Since:
- 2.4.0
-
shift
Creates a new density function that is the absolute value of the input function.- Parameters:
noiseParameters- the noise parameters to use for the noise function- Returns:
- a new density function that is the absolute value of the input function
- Since:
- 2.4.0
-
shiftA
Creates a new density function that is the absolute value of the input function.- Parameters:
noiseParameters- the noise parameters to use for the noise function- Returns:
- a new density function that is the absolute value of the input function
- Since:
- 2.4.0
-
shiftB
Creates a new density function that is the absolute value of the input function.- Parameters:
noiseParameters- the noise parameters to use for the noise function- Returns:
- a new density function that is the absolute value of the input function
- Since:
- 2.4.0
-
shiftedNoise2d
@AsOf("2.4.0") static DensityFunction shiftedNoise2d(DensityFunction shiftX, DensityFunction shiftZ, double xzScale, ResourceKey noiseParameters) Creates a new density function that is the absolute value of the input function.- Parameters:
shiftX- 2D noise function to shift the X axis ofshiftZ- 2D noise function to shift the Z axis ofxzScale- scale factor for the X and Z axesnoiseParameters- the noise parameters to use for the noise function- Returns:
- a new density function that is the absolute value of the input function
- Since:
- 2.4.0
-
rangeChoice
@AsOf("2.4.0") static DensityFunction rangeChoice(DensityFunction input, double minInclusive, double maxExclusive, DensityFunction whenInRange, DensityFunction whenOutOfRange) Creates a new density function that is the absolute value of the input function.- Parameters:
input- the density function to choose fromminInclusive- the minimum value of the input functionmaxExclusive- the maximum value of the input functionwhenInRange- the density function to return if the input function is within the rangewhenOutOfRange- the density function to return if the input function is outside the range- Returns:
- a new density function that is the absolute value of the input function
- Since:
- 2.4.0
-
yClampedGradient
@AsOf("2.4.0") static DensityFunction yClampedGradient(int fromY, int toY, double fromValue, double toValue) Creates a new density function that is the absolute value of the input function.- Parameters:
fromY- the minimum Y value of the gradienttoY- the maximum Y value of the gradientfromValue- the value of the gradient at the minimum Y valuetoValue- the value of the gradient at the maximum Y value- Returns:
- a new density function that is the absolute value of the input function
- Since:
- 2.4.0
-
endIslands
Creates a new density function that is the absolute value of the input function.- Parameters:
seed- the seed to use for the end-islands function- Returns:
- a new density function that is the absolute value of the input function
- Since:
- 2.4.0
-
blendDensity
Creates a new density function that is the absolute value of the input function.- Parameters:
input- the density function to blend- Returns:
- a new density function that is the absolute value of the input function
- Since:
- 2.4.0
-
blendAlpha
Creates a new density function that is the absolute value of the input function.- Returns:
- a new density function that is the absolute value of the input function
- Since:
- 2.4.0
-
blendOffset
Creates a new density function that is the absolute value of the input function.- Returns:
- a new density function that is the absolute value of the input function
- Since:
- 2.4.0
-
findTopSurface
@AsOf("2.4.0") static DensityFunction findTopSurface(DensityFunction density, DensityFunction upperBound, int lowerBound, int cellHeight) Creates a new density function that is the absolute value of the input function.- Parameters:
density- the density function to find the top surface ofupperBound- the upper bound of the surfacelowerBound- the lower bound of the surfacecellHeight- the height of the cell to find the surface in- Returns:
- a new density function that is the absolute value of the input function
- Since:
- 2.4.0
-
clamp
Creates a new density function that is the absolute value of the input function.- Parameters:
min- the minimum value of the functionmax- the maximum value of the function- Returns:
- a new density function that is the absolute value of the input function
- Since:
- 2.4.0
-
abs
Creates a new density function that is the absolute value of the input function.- Returns:
- a new density function that is the absolute value of the input function
- Since:
- 2.4.0
-
square
Creates a new density function that is the absolute value of the input function.- Returns:
- a new density function that is the absolute value of the input function
- Since:
- 2.4.0
-
cube
Creates a new density function that is the absolute value of the input function.- Returns:
- a new density function that is the absolute value of the input function
- Since:
- 2.4.0
-
halfNegative
Creates a new density function that is the absolute value of the input function.- Returns:
- a new density function that is the absolute value of the input function
- Since:
- 2.4.0
-
quarterNegative
Creates a new density function that is the absolute value of the input function.- Returns:
- a new density function that is the absolute value of the input function
- Since:
- 2.4.0
-
invert
Creates a new density function that is the absolute value of the input function.- Returns:
- a new density function that is the absolute value of the input function
- Since:
- 2.4.0
-
squeeze
Creates a new density function that is the absolute value of the input function.- Returns:
- a new density function that is the absolute value of the input function
- Since:
- 2.4.0
-
interpolated
Creates a new density function that is the absolute value of the input function.- Returns:
- a new density function that is the absolute value of the input function
- Since:
- 2.4.0
-
flatCache
Creates a new density function that is the absolute value of the input function.- Returns:
- a new density function that is the absolute value of the input function
- Since:
- 2.4.0
-
cache2d
Creates a new density function that is the absolute value of the input function.- Returns:
- a new density function that is the absolute value of the input function
- Since:
- 2.4.0
-
cacheOnce
Creates a new density function that is the absolute value of the input function.- Returns:
- a new density function that is the absolute value of the input function
- Since:
- 2.4.0
-
cacheAllInCell
Creates a new density function that is the absolute value of the input function.- Returns:
- a new density function that is the absolute value of the input function
- Since:
- 2.4.0
-