Record Class DensityFunctionCompiler.PreparedCache

java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.densityfunction.DensityFunctionCompiler.PreparedCache
All Implemented Interfaces:
DensityFunction
Enclosing class:
DensityFunctionCompiler

private static record DensityFunctionCompiler.PreparedCache(int id, Interval range, int domainAxes, DensitySampler cachingSampler) extends Record implements DensityFunction
  • Field Details

    • id

      private final int id
      The field for the id record component.
    • range

      private final Interval range
      The field for the range record component.
    • domainAxes

      private final int domainAxes
      The field for the domainAxes record component.
    • cachingSampler

      private final DensitySampler cachingSampler
      The field for the cachingSampler record component.
  • Constructor Details

    • PreparedCache

      private PreparedCache(int id, Interval range, int domainAxes, DensitySampler cachingSampler)
      Creates an instance of a PreparedCache record class.
      Parameters:
      id - the value for the id record component
      range - the value for the range record component
      domainAxes - the value for the domainAxes record component
      cachingSampler - the value for the cachingSampler record component
  • Method Details

    • compileSampler

      public DensitySampler compileSampler(DensityFunction.CompileContext context)
      Specified by:
      compileSampler in interface DensityFunction
    • rewriteChildren

      public DensityFunction rewriteChildren(DfRewriteRule rule)
      Specified by:
      rewriteChildren in interface DensityFunction
    • codec

      public com.mojang.serialization.MapCodec<DensityFunctionCompiler.PreparedCache> codec()
      Specified by:
      codec in interface DensityFunction
    • 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
    • hashCode

      public final 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
    • equals

      public final boolean equals(Object o)
      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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public int id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • range

      public Interval range()
      Returns the value of the range record component.
      Specified by:
      range in interface DensityFunction
      Returns:
      the value of the range record component
    • domainAxes

      public int domainAxes()
      Returns the value of the domainAxes record component.
      Specified by:
      domainAxes in interface DensityFunction
      Returns:
      the value of the domainAxes record component
    • cachingSampler

      public DensitySampler cachingSampler()
      Returns the value of the cachingSampler record component.
      Returns:
      the value of the cachingSampler record component