Class ProgressionDensityFunction
java.lang.Object
net.lcc.sollib.api.common.worldgen.density.ProgressionDensityFunction
- All Implemented Interfaces:
net.minecraft.world.level.levelgen.DensityFunction,net.minecraft.world.level.levelgen.DensityFunction.SimpleFunction
public class ProgressionDensityFunction
extends Object
implements net.minecraft.world.level.levelgen.DensityFunction.SimpleFunction
DensityFunction implementation that dynamically changes with connected players' advancements Syntax is that, with as many items as wanted in points:
{
"type": "sollib:progression",
"points": [
{
"value": -1,
"advancement": "minecraft:story/root"
},
{
"value": 1,
"advancement": "minecraft:end/kill_dragon"
}
]
}
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface net.minecraft.world.level.levelgen.DensityFunction
net.minecraft.world.level.levelgen.DensityFunction.ContextProvider, net.minecraft.world.level.levelgen.DensityFunction.FunctionContext, net.minecraft.world.level.levelgen.DensityFunction.NoiseHolder, net.minecraft.world.level.levelgen.DensityFunction.SimpleFunction, net.minecraft.world.level.levelgen.DensityFunction.SinglePointContext, net.minecraft.world.level.levelgen.DensityFunction.Visitor -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<ProgressionDensityFunction> protected final floatprotected floatprotected floatstatic final com.mojang.serialization.MapCodec<ProgressionDensityFunction.ProgressionPoint> protected final List<ProgressionDensityFunction.ProgressionPoint> protected floatFields inherited from interface net.minecraft.world.level.levelgen.DensityFunction
DIRECT_CODEC, HOLDER_HELPER_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionProgressionDensityFunction(float defaultValue, List<ProgressionDensityFunction.ProgressionPoint> points) -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.util.KeyDispatchDataCodec<? extends net.minecraft.world.level.levelgen.DensityFunction> codec()doublecompute(net.minecraft.world.level.levelgen.DensityFunction.FunctionContext context) floatdoublemaxValue()doubleminValue()protected voidreload(net.minecraft.server.MinecraftServer server) static voidreloadAll(net.minecraft.server.MinecraftServer server) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.level.levelgen.DensityFunction
abs, clamp, cube, halfNegative, quarterNegative, square, squeezeMethods inherited from interface net.minecraft.world.level.levelgen.DensityFunction.SimpleFunction
fillArray, mapAll
-
Field Details
-
POINT_CODEC
public static final com.mojang.serialization.MapCodec<ProgressionDensityFunction.ProgressionPoint> POINT_CODEC -
CODEC
-
points
-
defaultValue
protected final float defaultValue -
min
protected float min -
max
protected float max -
value
protected float value
-
-
Constructor Details
-
ProgressionDensityFunction
public ProgressionDensityFunction(float defaultValue, List<ProgressionDensityFunction.ProgressionPoint> points)
-
-
Method Details
-
getPoints
-
getDefaultValue
public float getDefaultValue() -
reloadAll
@Internal public static void reloadAll(net.minecraft.server.MinecraftServer server) -
reload
@Internal protected void reload(net.minecraft.server.MinecraftServer server) -
compute
public double compute(net.minecraft.world.level.levelgen.DensityFunction.FunctionContext context) - Specified by:
computein interfacenet.minecraft.world.level.levelgen.DensityFunction
-
minValue
public double minValue()- Specified by:
minValuein interfacenet.minecraft.world.level.levelgen.DensityFunction
-
maxValue
public double maxValue()- Specified by:
maxValuein interfacenet.minecraft.world.level.levelgen.DensityFunction
-
codec
public net.minecraft.util.KeyDispatchDataCodec<? extends net.minecraft.world.level.levelgen.DensityFunction> codec()- Specified by:
codecin interfacenet.minecraft.world.level.levelgen.DensityFunction
-