Record Class DensityFunctionTypes.Constant

java.lang.Object
java.lang.Record
net.minecraft.world.gen.densityfunction.DensityFunctionTypes.Constant
Record Components:
value -
All Implemented Interfaces:
DensityFunction, DensityFunction.Base
Enclosing class:
DensityFunctionTypes

private static record DensityFunctionTypes.Constant(double value) extends Record implements DensityFunction.Base
Mappings:
Namespace Name
official dok$h
intermediary net/minecraft/class_6916$class_6923
named net/minecraft/world/gen/densityfunction/DensityFunctionTypes$Constant
official a
intermediary comp_381
named value
  • Field Details

    • value

      private final double value
      The field for the value record component.
    • CODEC_HOLDER

      static final CodecHolder<DensityFunctionTypes.Constant> CODEC_HOLDER
      Mappings:
      Namespace Name Mixin selector
      official e Ldok$h;e:Laui;
      intermediary field_37084 Lnet/minecraft/class_6916$class_6923;field_37084:Lnet/minecraft/class_7243;
      named CODEC_HOLDER Lnet/minecraft/world/gen/densityfunction/DensityFunctionTypes$Constant;CODEC_HOLDER:Lnet/minecraft/util/dynamic/CodecHolder;
    • ZERO

      static final DensityFunctionTypes.Constant ZERO
      Mappings:
      Namespace Name Mixin selector
      official f Ldok$h;f:Ldok$h;
      intermediary field_36553 Lnet/minecraft/class_6916$class_6923;field_36553:Lnet/minecraft/class_6916$class_6923;
      named ZERO Lnet/minecraft/world/gen/densityfunction/DensityFunctionTypes$Constant;ZERO:Lnet/minecraft/world/gen/densityfunction/DensityFunctionTypes$Constant;
  • Constructor Details

    • Constant

      Constant(double double2)
  • Method Details

    • sample

      public double sample(DensityFunction.NoisePos pos)
      Returns the density value for the given block position.
      Specified by:
      sample in interface DensityFunction
      Parameters:
      pos - the block position
      Returns:
      the density value for the given block position
      Mappings:
      Namespace Name Mixin selector
      official a Ldoj;a(Ldoj$b;)D
      intermediary method_40464 Lnet/minecraft/class_6910;method_40464(Lnet/minecraft/class_6910$class_6912;)D
      named sample Lnet/minecraft/world/gen/densityfunction/DensityFunction;sample(Lnet/minecraft/world/gen/densityfunction/DensityFunction$NoisePos;)D
    • fill

      public void fill(double[] densities, DensityFunction.EachApplier applier)
      Fills an array of densities using this density function and the DensityFunction.EachApplier.
      Specified by:
      fill in interface DensityFunction
      Specified by:
      fill in interface DensityFunction.Base
      Parameters:
      densities - the array of densities to fill, like a buffer or a cache
      applier - the EachApplier to use. It has a method for filling the array, as well as to get a block position for an index
      Mappings:
      Namespace Name Mixin selector
      official a Ldoj;a([DLdoj$a;)V
      intermediary method_40470 Lnet/minecraft/class_6910;method_40470([DLnet/minecraft/class_6910$class_6911;)V
      named fill Lnet/minecraft/world/gen/densityfunction/DensityFunction;fill([DLnet/minecraft/world/gen/densityfunction/DensityFunction$EachApplier;)V
    • minValue

      public double minValue()
      Specified by:
      minValue in interface DensityFunction
      Mappings:
      Namespace Name Mixin selector
      official a Ldoj;a()D
      intermediary comp_377 Lnet/minecraft/class_6910;comp_377()D
      named minValue Lnet/minecraft/world/gen/densityfunction/DensityFunction;minValue()D
    • maxValue

      public double maxValue()
      Specified by:
      maxValue in interface DensityFunction
      Mappings:
      Namespace Name Mixin selector
      official b Ldoj;b()D
      intermediary comp_378 Lnet/minecraft/class_6910;comp_378()D
      named maxValue Lnet/minecraft/world/gen/densityfunction/DensityFunction;maxValue()D
    • getCodecHolder

      public CodecHolder<? extends DensityFunction> getCodecHolder()
      Specified by:
      getCodecHolder in interface DensityFunction
      Mappings:
      Namespace Name Mixin selector
      official c Ldoj;c()Laui;
      intermediary method_41062 Lnet/minecraft/class_6910;method_41062()Lnet/minecraft/class_7243;
      named getCodecHolder Lnet/minecraft/world/gen/densityfunction/DensityFunction;getCodecHolder()Lnet/minecraft/util/dynamic/CodecHolder;
    • 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 object)
      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 '=='.
      Specified by:
      equals in class Record
      Parameters:
      object - the object with which to compare
      Returns:
      true if this object is the same as the object argument; false otherwise.
    • value

      public double value()
      Returns the value of the value record component.
      Returns:
      the value of the value record component