Interface DensityFunction.EachApplier

All Known Implementing Classes:
ChunkNoiseSampler
Enclosing interface:
DensityFunction

public static interface DensityFunction.EachApplier
EachApplier is used to fill an array of densities, like a density buffer or cache, with values from a density function.

This exists because ChunkNoiseSampler uses itself as the block position passed to density functions and needs to set the position fields correctly before calling sample, as well as setting fields for the implementation of caches.

Mappings:
Namespace Name
official dhd$a
intermediary net/minecraft/class_6910$class_6911
named net/minecraft/world/gen/densityfunction/DensityFunction$EachApplier
  • Method Summary

    Modifier and Type
    Method
    Description
    at(int index)
    Returns the block position at a specific index of the density array.
    void
    fill(double[] densities, DensityFunction densityFunction)
    Fills the density array using a density function.
  • Method Details

    • at

      DensityFunction.NoisePos at(int index)
      Returns the block position at a specific index of the density array.

      If you want to manually iterate the array and call DensityFunction.sample(net.minecraft.world.gen.densityfunction.DensityFunction.NoisePos) to set the individual elements in an implementation of DensityFunction.fill(double[], net.minecraft.world.gen.densityfunction.DensityFunction.EachApplier), this method can be used to get the block position required for that.

      Returns:
      the block position at a specific index of the density array
      Implementation Note:
      This can have side effects.
      Mappings:
      Namespace Name Mixin selector
      official a Ldhd$a;a(I)Ldhd$b;
      intermediary method_40477 Lnet/minecraft/class_6910$class_6911;method_40477(I)Lnet/minecraft/class_6910$class_6912;
      named at Lnet/minecraft/world/gen/densityfunction/DensityFunction$EachApplier;at(I)Lnet/minecraft/world/gen/densityfunction/DensityFunction$NoisePos;
    • fill

      void fill(double[] densities, DensityFunction densityFunction)
      Fills the density array using a density function.
      Implementation Note:
      This can have side effects.
      Mappings:
      Namespace Name Mixin selector
      official a Ldhd$a;a([DLdhd;)V
      intermediary method_40478 Lnet/minecraft/class_6910$class_6911;method_40478([DLnet/minecraft/class_6910;)V
      named fill Lnet/minecraft/world/gen/densityfunction/DensityFunction$EachApplier;fill([DLnet/minecraft/world/gen/densityfunction/DensityFunction;)V