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
official dkf
intermediary net/minecraft/class_5817
named net/minecraft/world/gen/StructureWeightSampler
  • Field Details

    • INDEX_OFFSET

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

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

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

      private final ObjectListIterator<StructureWeightSampler.Piece> pieceIterator
      Mappings:
      Namespace Name Mixin selector
      official h Ldkf;h:Lit/unimi/dsi/fastutil/objects/ObjectListIterator;
      intermediary field_28744 Lnet/minecraft/class_5817;field_28744:Lit/unimi/dsi/fastutil/objects/ObjectListIterator;
      named pieceIterator Lnet/minecraft/world/gen/StructureWeightSampler;pieceIterator:Lit/unimi/dsi/fastutil/objects/ObjectListIterator;
    • junctionIterator

      private final ObjectListIterator<JigsawJunction> junctionIterator
      Mappings:
      Namespace Name Mixin selector
      official i Ldkf;i:Lit/unimi/dsi/fastutil/objects/ObjectListIterator;
      intermediary field_28745 Lnet/minecraft/class_5817;field_28745:Lit/unimi/dsi/fastutil/objects/ObjectListIterator;
      named junctionIterator Lnet/minecraft/world/gen/StructureWeightSampler;junctionIterator:Lit/unimi/dsi/fastutil/objects/ObjectListIterator;
  • Constructor Details

    • StructureWeightSampler

      public StructureWeightSampler(ObjectListIterator<StructureWeightSampler.Piece> pieceIterator, ObjectListIterator<JigsawJunction> junctionIterator)
      Mappings:
      Namespace Name Mixin selector
      official <init> Ldkf;<init>(Lit/unimi/dsi/fastutil/objects/ObjectListIterator;Lit/unimi/dsi/fastutil/objects/ObjectListIterator;)V
      intermediary <init> Lnet/minecraft/class_5817;<init>(Lit/unimi/dsi/fastutil/objects/ObjectListIterator;Lit/unimi/dsi/fastutil/objects/ObjectListIterator;)V
      named <init> Lnet/minecraft/world/gen/StructureWeightSampler;<init>(Lit/unimi/dsi/fastutil/objects/ObjectListIterator;Lit/unimi/dsi/fastutil/objects/ObjectListIterator;)V
  • Method Details

    • createStructureWeightSampler

      public static StructureWeightSampler createStructureWeightSampler(StructureAccessor world, ChunkPos pos)
      Mappings:
      Namespace Name Mixin selector
      official a Ldkf;a(Lcqn;Lcpc;)Ldkf;
      intermediary method_42695 Lnet/minecraft/class_5817;method_42695(Lnet/minecraft/class_5138;Lnet/minecraft/class_1923;)Lnet/minecraft/class_5817;
      named createStructureWeightSampler Lnet/minecraft/world/gen/StructureWeightSampler;createStructureWeightSampler(Lnet/minecraft/world/gen/StructureAccessor;Lnet/minecraft/util/math/ChunkPos;)Lnet/minecraft/world/gen/StructureWeightSampler;
    • 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 Ldkl;a(Ldkl$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
    • minValue

      public double minValue()
      Specified by:
      minValue in interface DensityFunction
      Mappings:
      Namespace Name Mixin selector
      official a Ldkl;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 Ldkl;b()D
      intermediary comp_378 Lnet/minecraft/class_6910;comp_378()D
      named maxValue Lnet/minecraft/world/gen/densityfunction/DensityFunction;maxValue()D
    • getMagnitudeWeight

      private static double getMagnitudeWeight(int x, int y, int z)
      Mappings:
      Namespace Name Mixin selector
      official a Ldkf;a(III)D
      intermediary method_33832 Lnet/minecraft/class_5817;method_33832(III)D
      named getMagnitudeWeight Lnet/minecraft/world/gen/StructureWeightSampler;getMagnitudeWeight(III)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
      official a Ldkf;a(IIII)D
      intermediary method_33641 Lnet/minecraft/class_5817;method_33641(IIII)D
      named getStructureWeight Lnet/minecraft/world/gen/StructureWeightSampler;getStructureWeight(IIII)D
    • indexInBounds

      private static boolean indexInBounds(int i)
      Mappings:
      Namespace Name Mixin selector
      official a Ldkf;a(I)Z
      intermediary method_42692 Lnet/minecraft/class_5817;method_42692(I)Z
      named indexInBounds Lnet/minecraft/world/gen/StructureWeightSampler;indexInBounds(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
      official b Ldkf;b(III)D
      intermediary method_33642 Lnet/minecraft/class_5817;method_33642(III)D
      named calculateStructureWeight Lnet/minecraft/world/gen/StructureWeightSampler;calculateStructureWeight(III)D
    • structureWeight

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