Package net.minecraft.world.gen
Class StructureWeightSampler
java.lang.Object
net.minecraft.world.gen.StructureWeightSampler
- All Implemented Interfaces:
DensityFunction,DensityFunction.Base,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 intermediary net/minecraft/class_5817official dgunamed net/minecraft/world/gen/StructureWeightSampler
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface net.minecraft.world.gen.densityfunction.DensityFunction
DensityFunction.Base, DensityFunction.DensityFunctionVisitor, DensityFunction.EachApplier, DensityFunction.Noise, DensityFunction.NoisePos, DensityFunction.UnblendedNoisePos -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intprivate static final intprivate final ObjectListIterator<JigsawJunction>private final ObjectListIterator<StructureWeightSampler.Piece>private static final float[]Fields inherited from interface net.minecraft.world.gen.densityfunction.DensityFunction
CODEC, FUNCTION_CODEC, REGISTRY_ENTRY_CODECFields inherited from interface net.minecraft.world.gen.densityfunction.DensityFunctionTypes.Beardifying
CODEC_HOLDER -
Constructor Summary
ConstructorsConstructorDescriptionStructureWeightSampler(ObjectListIterator<StructureWeightSampler.Piece> pieceIterator, ObjectListIterator<JigsawJunction> junctionIterator) -
Method Summary
Modifier and TypeMethodDescriptionprivate static doublecalculateStructureWeight(int x, int y, int z) Calculates the structure weight for the given position.static StructureWeightSamplercreateStructureWeightSampler(StructureAccessor world, ChunkPos pos) private static doublegetMagnitudeWeight(int x, int y, int z) private static doublegetStructureWeight(int x, int y, int z, int int2) Gets the structure weight from the array from the given position, or 0 if the position is out of bounds.doublemaxValue()private static booleanmethod_42692(int int2) private static doublemethod_42693(int int2, double double2, int int3) doubleminValue()doubleReturns the density value for the given block position.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.gen.densityfunction.DensityFunction
abs, clamp, cube, halfNegative, quarterNegative, square, squeezeMethods inherited from interface net.minecraft.world.gen.densityfunction.DensityFunction.Base
apply, fillMethods inherited from interface net.minecraft.world.gen.densityfunction.DensityFunctionTypes.Beardifying
getCodecHolder
-
Field Details
-
field_31461
public static final int field_31461- See Also:
- Mappings:
Namespace Name Mixin selector intermediary field_31461Lnet/minecraft/class_5817;field_31461:Iofficial aLdgu;a:Inamed field_31461Lnet/minecraft/world/gen/StructureWeightSampler;field_31461:I
-
field_31462
private static final int field_31462- See Also:
- Mappings:
Namespace Name Mixin selector intermediary field_31462Lnet/minecraft/class_5817;field_31462:Iofficial fLdgu;f:Inamed field_31462Lnet/minecraft/world/gen/StructureWeightSampler;field_31462:I
-
STRUCTURE_WEIGHT_TABLE
private static final float[] STRUCTURE_WEIGHT_TABLE- Mappings:
Namespace Name Mixin selector intermediary field_28741Lnet/minecraft/class_5817;field_28741:[Fofficial gLdgu;g:[Fnamed STRUCTURE_WEIGHT_TABLELnet/minecraft/world/gen/StructureWeightSampler;STRUCTURE_WEIGHT_TABLE:[F
-
pieceIterator
- Mappings:
Namespace Name Mixin selector intermediary field_28744Lnet/minecraft/class_5817;field_28744:Lit/unimi/dsi/fastutil/objects/ObjectListIterator;official hLdgu;h:Lit/unimi/dsi/fastutil/objects/ObjectListIterator;named pieceIteratorLnet/minecraft/world/gen/StructureWeightSampler;pieceIterator:Lit/unimi/dsi/fastutil/objects/ObjectListIterator;
-
junctionIterator
- Mappings:
Namespace Name Mixin selector intermediary field_28745Lnet/minecraft/class_5817;field_28745:Lit/unimi/dsi/fastutil/objects/ObjectListIterator;official iLdgu;i:Lit/unimi/dsi/fastutil/objects/ObjectListIterator;named junctionIteratorLnet/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 intermediary <init>Lnet/minecraft/class_5817;<init>(Lit/unimi/dsi/fastutil/objects/ObjectListIterator;Lit/unimi/dsi/fastutil/objects/ObjectListIterator;)Vofficial <init>Ldgu;<init>(Lit/unimi/dsi/fastutil/objects/ObjectListIterator;Lit/unimi/dsi/fastutil/objects/ObjectListIterator;)Vnamed <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 intermediary method_42695Lnet/minecraft/class_5817;method_42695(Lnet/minecraft/class_5138;Lnet/minecraft/class_1923;)Lnet/minecraft/class_5817;official aLdgu;a(Lcnc;Lclr;)Ldgu;named createStructureWeightSamplerLnet/minecraft/world/gen/StructureWeightSampler;createStructureWeightSampler(Lnet/minecraft/world/gen/StructureAccessor;Lnet/minecraft/util/math/ChunkPos;)Lnet/minecraft/world/gen/StructureWeightSampler;
-
sample
Returns the density value for the given block position.- Specified by:
samplein interfaceDensityFunction- Parameters:
pos- the block position- Returns:
- the density value for the given block position
- Mappings:
Namespace Name Mixin selector intermediary method_40464Lnet/minecraft/class_6910;method_40464(Lnet/minecraft/class_6910$class_6912;)Dofficial aLdha;a(Ldha$b;)Dnamed sampleLnet/minecraft/world/gen/densityfunction/DensityFunction;sample(Lnet/minecraft/world/gen/densityfunction/DensityFunction$NoisePos;)D
-
minValue
public double minValue()- Specified by:
minValuein interfaceDensityFunction- Mappings:
Namespace Name Mixin selector intermediary comp_377Lnet/minecraft/class_6910;comp_377()Dofficial aLdha;a()Dnamed minValueLnet/minecraft/world/gen/densityfunction/DensityFunction;minValue()D
-
maxValue
public double maxValue()- Specified by:
maxValuein interfaceDensityFunction- Mappings:
Namespace Name Mixin selector intermediary comp_378Lnet/minecraft/class_6910;comp_378()Dofficial bLdha;b()Dnamed maxValueLnet/minecraft/world/gen/densityfunction/DensityFunction;maxValue()D
-
getMagnitudeWeight
private static double getMagnitudeWeight(int x, int y, int z) - Mappings:
Namespace Name Mixin selector intermediary method_33832Lnet/minecraft/class_5817;method_33832(III)Dofficial aLdgu;a(III)Dnamed getMagnitudeWeightLnet/minecraft/world/gen/StructureWeightSampler;getMagnitudeWeight(III)D
-
getStructureWeight
private static double getStructureWeight(int x, int y, int z, int int2) 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 intermediary method_33641Lnet/minecraft/class_5817;method_33641(IIII)Dofficial aLdgu;a(IIII)Dnamed getStructureWeightLnet/minecraft/world/gen/StructureWeightSampler;getStructureWeight(IIII)D
-
method_42692
private static boolean method_42692(int int2) - Mappings:
Namespace Name Mixin selector intermediary method_42692Lnet/minecraft/class_5817;method_42692(I)Zofficial aLdgu;a(I)Znamed method_42692Lnet/minecraft/world/gen/StructureWeightSampler;method_42692(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 intermediary method_33642Lnet/minecraft/class_5817;method_33642(III)Dofficial bLdgu;b(III)Dnamed calculateStructureWeightLnet/minecraft/world/gen/StructureWeightSampler;calculateStructureWeight(III)D
-
method_42693
private static double method_42693(int int2, double double2, int int3) - Mappings:
Namespace Name Mixin selector intermediary method_42693Lnet/minecraft/class_5817;method_42693(IDI)Dofficial aLdgu;a(IDI)Dnamed method_42693Lnet/minecraft/world/gen/StructureWeightSampler;method_42693(IDI)D
-