Class BiomeVariationMapLayer

java.lang.Object
net.glowstone.generator.biomegrid.MapLayer
net.glowstone.generator.biomegrid.BiomeVariationMapLayer

public class BiomeVariationMapLayer extends MapLayer
  • Constructor Details

    • BiomeVariationMapLayer

      public BiomeVariationMapLayer(long seed, MapLayer belowLayer)
      Creates an instance with no variation layer.
      Parameters:
      seed - the PRNG seed
      belowLayer - the layer below this one
    • BiomeVariationMapLayer

      public BiomeVariationMapLayer(long seed, MapLayer belowLayer, MapLayer variationLayer)
      Creates an instance with the given variation layer.
      Parameters:
      seed - the PRNG seed
      belowLayer - the layer below this one
      variationLayer - the variation layer, or null to use no variation layer
  • Method Details

    • generateValues

      public int[] generateValues(int x, int z, int sizeX, int sizeZ)
      Specified by:
      generateValues in class MapLayer
    • generateRandomValues

      public int[] generateRandomValues(int x, int z, int sizeX, int sizeZ)
      Generates a rectangle, replacing all the positive values in the previous layer with random values from 2 to 31 while leaving zero and negative values unchanged.
      Parameters:
      x - the lowest x coordinate
      z - the lowest z coordinate
      sizeX - the x coordinate range
      sizeZ - the z coordinate range
      Returns:
      a flattened array of generated values
    • mergeValues

      public int[] mergeValues(int x, int z, int sizeX, int sizeZ)
      Generates a rectangle using the previous layer and the variation layer.
      Parameters:
      x - the lowest x coordinate
      z - the lowest z coordinate
      sizeX - the x coordinate range
      sizeZ - the z coordinate range
      Returns:
      a flattened array of generated values