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 Classes
    Modifier and Type
    Class
    Description
    static final record 
     

    Nested 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

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.MapCodec<ProgressionDensityFunction>
     
    protected final float
     
    protected float
     
    protected float
     
    static final com.mojang.serialization.MapCodec<ProgressionDensityFunction.ProgressionPoint>
     
     
    protected float
     

    Fields inherited from interface net.minecraft.world.level.levelgen.DensityFunction

    DIRECT_CODEC, HOLDER_HELPER_CODEC
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.util.KeyDispatchDataCodec<? extends net.minecraft.world.level.levelgen.DensityFunction>
     
    double
    compute(net.minecraft.world.level.levelgen.DensityFunction.FunctionContext context)
     
    float
     
     
    double
     
    double
     
    protected void
    reload(net.minecraft.server.MinecraftServer server)
     
    static void
    reloadAll(net.minecraft.server.MinecraftServer server)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraft.world.level.levelgen.DensityFunction

    abs, clamp, cube, halfNegative, quarterNegative, square, squeeze

    Methods inherited from interface net.minecraft.world.level.levelgen.DensityFunction.SimpleFunction

    fillArray, mapAll
  • Field Details

  • Constructor Details

  • 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:
      compute in interface net.minecraft.world.level.levelgen.DensityFunction
    • minValue

      public double minValue()
      Specified by:
      minValue in interface net.minecraft.world.level.levelgen.DensityFunction
    • maxValue

      public double maxValue()
      Specified by:
      maxValue in interface net.minecraft.world.level.levelgen.DensityFunction
    • codec

      public net.minecraft.util.KeyDispatchDataCodec<? extends net.minecraft.world.level.levelgen.DensityFunction> codec()
      Specified by:
      codec in interface net.minecraft.world.level.levelgen.DensityFunction