Record Class BiomeLayer

java.lang.Object
java.lang.Record
org.moddingx.libx.sandbox.generator.BiomeLayer
Record Components:
range - A climate range that the layer can generate in.
density - A custom density function that is sampled on every block position. Out of all biome layers the one with the highest density will be used to sample the biome at that position. These density functions don't support caching optimisations or interpolation, so they should be kept simple.
biomes - A climate parameter list mapping climate points to biomes.

public record BiomeLayer(net.minecraft.world.level.biome.Climate.ParameterPoint range, net.minecraft.world.level.levelgen.DensityFunction density, net.minecraft.world.level.biome.Climate.ParameterList<net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome>> biomes) extends Record
A biome layer is a set of biomes and climate parameters that can generate in a noise range.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<net.minecraft.core.Holder<BiomeLayer>>
     
    static final com.mojang.serialization.Codec<BiomeLayer>
     
    static final net.minecraft.world.level.biome.Climate.ParameterPoint
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    BiomeLayer(net.minecraft.world.level.biome.Climate.ParameterPoint range, net.minecraft.world.level.levelgen.DensityFunction density, net.minecraft.world.level.biome.Climate.ParameterList<net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome>> biomes)
    Creates an instance of a BiomeLayer record class.
    BiomeLayer(net.minecraft.world.level.levelgen.DensityFunction density, net.minecraft.world.level.biome.Climate.ParameterList<net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome>> biomes)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.level.biome.Climate.ParameterList<net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome>>
    Returns the value of the biomes record component.
    net.minecraft.world.level.levelgen.DensityFunction
    Returns the value of the density record component.
    boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns a hash code value for this object.
    net.minecraft.world.level.biome.Climate.ParameterPoint
    Returns the value of the range record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • FULL_RANGE

      public static final net.minecraft.world.level.biome.Climate.ParameterPoint FULL_RANGE
    • DIRECT_CODEC

      public static final com.mojang.serialization.Codec<BiomeLayer> DIRECT_CODEC
    • CODEC

      public static final com.mojang.serialization.Codec<net.minecraft.core.Holder<BiomeLayer>> CODEC
  • Constructor Details

    • BiomeLayer

      public BiomeLayer(net.minecraft.world.level.levelgen.DensityFunction density, net.minecraft.world.level.biome.Climate.ParameterList<net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome>> biomes)
    • BiomeLayer

      public BiomeLayer(net.minecraft.world.level.biome.Climate.ParameterPoint range, net.minecraft.world.level.levelgen.DensityFunction density, net.minecraft.world.level.biome.Climate.ParameterList<net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome>> biomes)
      Creates an instance of a BiomeLayer record class.
      Parameters:
      range - the value for the range record component
      density - the value for the density record component
      biomes - the value for the biomes record component
  • Method Details

    • equals

      public boolean equals(Object obj)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      obj - the object with which to compare
      Returns:
      true if this object is the same as the obj argument; false otherwise.
    • hashCode

      public int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • range

      public net.minecraft.world.level.biome.Climate.ParameterPoint range()
      Returns the value of the range record component.
      Returns:
      the value of the range record component
    • density

      public net.minecraft.world.level.levelgen.DensityFunction density()
      Returns the value of the density record component.
      Returns:
      the value of the density record component
    • biomes

      public net.minecraft.world.level.biome.Climate.ParameterList<net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome>> biomes()
      Returns the value of the biomes record component.
      Returns:
      the value of the biomes record component