Class StructureWeightSampler

java.lang.Object
net.minecraft.world.gen.StructureWeightSampler
All Implemented Interfaces:
DensityFunction, DensityFunction.Base, DensityFunctionTypes.Beardifying

public class StructureWeightSampler extends Object implements DensityFunctionTypes.Beardifying
Applies weights to noise values if they are near structures, placing terrain under them and hollowing out the space above them.
Mappings:
Namespace Name
named net/minecraft/world/gen/StructureWeightSampler
intermediary net/minecraft/class_5817
official epc
  • Field Details

    • INDEX_OFFSET

      public static final int INDEX_OFFSET
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named INDEX_OFFSET Lnet/minecraft/world/gen/StructureWeightSampler;INDEX_OFFSET:I
      intermediary field_31461 Lnet/minecraft/class_5817;field_31461:I
      official a Lepc;a:I
    • EDGE_LENGTH

      private static final int EDGE_LENGTH
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named EDGE_LENGTH Lnet/minecraft/world/gen/StructureWeightSampler;EDGE_LENGTH:I
      intermediary field_31462 Lnet/minecraft/class_5817;field_31462:I
      official g Lepc;g:I
    • STRUCTURE_WEIGHT_TABLE

      private static final float[] STRUCTURE_WEIGHT_TABLE
      Mappings:
      Namespace Name Mixin selector
      named STRUCTURE_WEIGHT_TABLE Lnet/minecraft/world/gen/StructureWeightSampler;STRUCTURE_WEIGHT_TABLE:[F
      intermediary field_28741 Lnet/minecraft/class_5817;field_28741:[F
      official h Lepc;h:[F
    • field_61464

      public static final StructureWeightSampler field_61464
      Mappings:
      Namespace Name Mixin selector
      named field_61464 Lnet/minecraft/world/gen/StructureWeightSampler;field_61464:Lnet/minecraft/world/gen/StructureWeightSampler;
      intermediary field_61464 Lnet/minecraft/class_5817;field_61464:Lnet/minecraft/class_5817;
      official b Lepc;b:Lepc;
    • field_61465

      private final List<StructureWeightSampler.Piece> field_61465
      Mappings:
      Namespace Name Mixin selector
      named field_61465 Lnet/minecraft/world/gen/StructureWeightSampler;field_61465:Ljava/util/List;
      intermediary field_61465 Lnet/minecraft/class_5817;field_61465:Ljava/util/List;
      official i Lepc;i:Ljava/util/List;
    • field_61466

      private final List<JigsawJunction> field_61466
      Mappings:
      Namespace Name Mixin selector
      named field_61466 Lnet/minecraft/world/gen/StructureWeightSampler;field_61466:Ljava/util/List;
      intermediary field_61466 Lnet/minecraft/class_5817;field_61466:Ljava/util/List;
      official j Lepc;j:Ljava/util/List;
    • field_61467

      @Nullable private final @Nullable BlockBox field_61467
      Mappings:
      Namespace Name Mixin selector
      named field_61467 Lnet/minecraft/world/gen/StructureWeightSampler;field_61467:Lnet/minecraft/util/math/BlockBox;
      intermediary field_61467 Lnet/minecraft/class_5817;field_61467:Lnet/minecraft/class_3341;
      official k Lepc;k:Lfaf;
  • Constructor Details

  • Method Details

    • createStructureWeightSampler

      public static StructureWeightSampler createStructureWeightSampler(StructureAccessor structureAccessor, ChunkPos chunkPos)
      Mappings:
      Namespace Name Mixin selector
      named createStructureWeightSampler Lnet/minecraft/world/gen/StructureWeightSampler;createStructureWeightSampler(Lnet/minecraft/world/gen/StructureAccessor;Lnet/minecraft/util/math/ChunkPos;)Lnet/minecraft/world/gen/StructureWeightSampler;
      intermediary method_42695 Lnet/minecraft/class_5817;method_42695(Lnet/minecraft/class_5138;Lnet/minecraft/class_1923;)Lnet/minecraft/class_5817;
      official a Lepc;a(Ldsm;Ldqv;)Lepc;
    • method_72681

      private static BlockBox method_72681(@Nullable @Nullable BlockBox blockBox, BlockBox blockBox2)
      Mappings:
      Namespace Name Mixin selector
      named method_72681 Lnet/minecraft/world/gen/StructureWeightSampler;method_72681(Lnet/minecraft/util/math/BlockBox;Lnet/minecraft/util/math/BlockBox;)Lnet/minecraft/util/math/BlockBox;
      intermediary method_72681 Lnet/minecraft/class_5817;method_72681(Lnet/minecraft/class_3341;Lnet/minecraft/class_3341;)Lnet/minecraft/class_3341;
      official a Lepc;a(Lfaf;Lfaf;)Lfaf;
    • 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
      named fill Lnet/minecraft/world/gen/densityfunction/DensityFunction;fill([DLnet/minecraft/world/gen/densityfunction/DensityFunction$EachApplier;)V
      intermediary method_40470 Lnet/minecraft/class_6910;method_40470([DLnet/minecraft/class_6910$class_6911;)V
      official a Lepi;a([DLepi$a;)V
    • 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
      named sample Lnet/minecraft/world/gen/densityfunction/DensityFunction;sample(Lnet/minecraft/world/gen/densityfunction/DensityFunction$NoisePos;)D
      intermediary method_40464 Lnet/minecraft/class_6910;method_40464(Lnet/minecraft/class_6910$class_6912;)D
      official a Lepi;a(Lepi$b;)D
    • minValue

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

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

      private static double getMagnitudeWeight(double x, double y, double z)
      Mappings:
      Namespace Name Mixin selector
      named getMagnitudeWeight Lnet/minecraft/world/gen/StructureWeightSampler;getMagnitudeWeight(DDD)D
      intermediary method_33832 Lnet/minecraft/class_5817;method_33832(DDD)D
      official a Lepc;a(DDD)D
    • getStructureWeight

      private static double getStructureWeight(int x, int y, int z, int yy)
      Gets the structure weight from the array from the given position, or 0 if the position is out of bounds.
      Mappings:
      Namespace Name Mixin selector
      named getStructureWeight Lnet/minecraft/world/gen/StructureWeightSampler;getStructureWeight(IIII)D
      intermediary method_33641 Lnet/minecraft/class_5817;method_33641(IIII)D
      official a Lepc;a(IIII)D
    • indexInBounds

      private static boolean indexInBounds(int i)
      Mappings:
      Namespace Name Mixin selector
      named indexInBounds Lnet/minecraft/world/gen/StructureWeightSampler;indexInBounds(I)Z
      intermediary method_42692 Lnet/minecraft/class_5817;method_42692(I)Z
      official a Lepc;a(I)Z
    • calculateStructureWeight

      private static double calculateStructureWeight(int x, int y, int z)
      Calculates the structure weight for the given position.

      The weight increases as x and z approach (0, 0), and positive y values make the weight negative while negative y values make the weight positive.

      Mappings:
      Namespace Name Mixin selector
      named calculateStructureWeight Lnet/minecraft/world/gen/StructureWeightSampler;calculateStructureWeight(III)D
      intermediary method_33642 Lnet/minecraft/class_5817;method_33642(III)D
      official a Lepc;a(III)D
    • structureWeight

      private static double structureWeight(int x, double y, int z)
      Mappings:
      Namespace Name Mixin selector
      named structureWeight Lnet/minecraft/world/gen/StructureWeightSampler;structureWeight(IDI)D
      intermediary method_42693 Lnet/minecraft/class_5817;method_42693(IDI)D
      official a Lepc;a(IDI)D