java.lang.Object
org.cloudburstmc.server.level.generator.standard.misc.AbstractGenerationPass
org.cloudburstmc.server.level.generator.standard.generation.density.VanillaDensitySource
All Implemented Interfaces:
DensitySource, GenerationPass

public class VanillaDensitySource extends AbstractGenerationPass implements DensitySource
A NoiseSource that provides noise similar to that of vanilla terrain.
Author:
DaPorkchop_
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static org.cloudburstmc.api.util.Identifier
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    double[]
    get​(double[] arr, int startIndex, @NonNull BiomeMap biomes, int x, int y, int z, int sizeX, int sizeY, int sizeZ, int stepX, int stepY, int stepZ)
    Gets the density in the given region.
    double
    get​(@NonNull BiomeMap biomes, int x, int y, int z)
    Gets the density at the given coordinates.
    protected double
    getDepth​(double x, double z)
     
    org.cloudburstmc.api.util.Identifier
     
    protected void
    init0​(long levelSeed, long localSeed, StandardGenerator generator)
     

    Methods inherited from class org.cloudburstmc.server.level.generator.standard.misc.AbstractGenerationPass

    init, setSeed

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.cloudburstmc.server.level.generator.standard.misc.GenerationPass

    init
  • Field Details

    • ID

      public static final org.cloudburstmc.api.util.Identifier ID
  • Constructor Details

    • VanillaDensitySource

      public VanillaDensitySource()
  • Method Details

    • init0

      protected void init0(long levelSeed, long localSeed, StandardGenerator generator)
      Overrides:
      init0 in class AbstractGenerationPass
    • get

      public double get(@NonNull @NonNull BiomeMap biomes, int x, int y, int z)
      Description copied from interface: DensitySource
      Gets the density at the given coordinates.
      Specified by:
      get in interface DensitySource
      Parameters:
      biomes - a BiomeMap containing the biomes to be used in the world
      x - the X coordinate
      y - the Y coordinate
      z - the Z coordinate
      Returns:
      the density at the given coordinates
    • get

      public double[] get(double[] arr, int startIndex, @NonNull @NonNull BiomeMap biomes, int x, int y, int z, int sizeX, int sizeY, int sizeZ, int stepX, int stepY, int stepZ)
      Description copied from interface: DensitySource
      Gets the density in the given region.

      Values will be stored in the returned array in XZY order.

      Specified by:
      get in interface DensitySource
      Parameters:
      arr - a double[] to store the density values in. if too small or null, a new one will be created
      startIndex - the index to begin storing values into the array at
      biomes - a BiomeMap containing the biomes to be used in the world
      x - the X coordinate
      y - the Y coordinate
      z - the Z coordinate
      sizeX - the number of samples to take along the X axis
      sizeY - the number of samples to take along the Y axis
      sizeZ - the number of samples to take along the Z axis
      stepX - the spacing between samples along the X axis
      stepY - the spacing between samples along the Y axis
      stepZ - the spacing between samples along the Z axis
      Returns:
      the density at the given coordinates
    • getDepth

      protected double getDepth(double x, double z)
    • getId

      public org.cloudburstmc.api.util.Identifier getId()
      Specified by:
      getId in interface DensitySource
      Specified by:
      getId in interface GenerationPass
      Returns:
      the identifier of this generation pass