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 named net/minecraft/world/gen/StructureWeightSamplerintermediary net/minecraft/class_5817official epc
-
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 TypeFieldDescriptionprivate static final intstatic final StructureWeightSamplerprivate final List<StructureWeightSampler.Piece> private final List<JigsawJunction> static final intprivate 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(List<StructureWeightSampler.Piece> list, List<JigsawJunction> list2, @Nullable BlockBox blockBox) -
Method Summary
Modifier and TypeMethodDescriptionprivate static doublecalculateStructureWeight(int x, int y, int z) Calculates the structure weight for the given position.static StructureWeightSamplercreateStructureWeightSampler(StructureAccessor structureAccessor, ChunkPos chunkPos) voidfill(double[] densities, DensityFunction.EachApplier applier) Fills an array of densities usingthisdensity function and theDensityFunction.EachApplier.private static doublegetMagnitudeWeight(double x, double y, double z) private static doublegetStructureWeight(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.private static booleanindexInBounds(int i) doublemaxValue()private static BlockBoxmethod_72681(@Nullable BlockBox blockBox, BlockBox blockBox2) doubleminValue()doubleReturns the density value for the given block position.private static doublestructureWeight(int x, double y, int z) 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, invert, quarterNegative, square, squeezeMethods inherited from interface net.minecraft.world.gen.densityfunction.DensityFunction.Base
applyMethods inherited from interface net.minecraft.world.gen.densityfunction.DensityFunctionTypes.Beardifying
getCodecHolder
-
Field Details
-
INDEX_OFFSET
public static final int INDEX_OFFSET- See Also:
- Mappings:
Namespace Name Mixin selector named INDEX_OFFSETLnet/minecraft/world/gen/StructureWeightSampler;INDEX_OFFSET:Iintermediary field_31461Lnet/minecraft/class_5817;field_31461:Iofficial aLepc;a:I
-
EDGE_LENGTH
private static final int EDGE_LENGTH- See Also:
- Mappings:
Namespace Name Mixin selector named EDGE_LENGTHLnet/minecraft/world/gen/StructureWeightSampler;EDGE_LENGTH:Iintermediary field_31462Lnet/minecraft/class_5817;field_31462:Iofficial gLepc;g:I
-
STRUCTURE_WEIGHT_TABLE
private static final float[] STRUCTURE_WEIGHT_TABLE- Mappings:
Namespace Name Mixin selector named STRUCTURE_WEIGHT_TABLELnet/minecraft/world/gen/StructureWeightSampler;STRUCTURE_WEIGHT_TABLE:[Fintermediary field_28741Lnet/minecraft/class_5817;field_28741:[Fofficial hLepc;h:[F
-
field_61464
- Mappings:
Namespace Name Mixin selector named field_61464Lnet/minecraft/world/gen/StructureWeightSampler;field_61464:Lnet/minecraft/world/gen/StructureWeightSampler;intermediary field_61464Lnet/minecraft/class_5817;field_61464:Lnet/minecraft/class_5817;official bLepc;b:Lepc;
-
field_61465
- Mappings:
Namespace Name Mixin selector named field_61465Lnet/minecraft/world/gen/StructureWeightSampler;field_61465:Ljava/util/List;intermediary field_61465Lnet/minecraft/class_5817;field_61465:Ljava/util/List;official iLepc;i:Ljava/util/List;
-
field_61466
- Mappings:
Namespace Name Mixin selector named field_61466Lnet/minecraft/world/gen/StructureWeightSampler;field_61466:Ljava/util/List;intermediary field_61466Lnet/minecraft/class_5817;field_61466:Ljava/util/List;official jLepc;j:Ljava/util/List;
-
field_61467
- Mappings:
Namespace Name Mixin selector named field_61467Lnet/minecraft/world/gen/StructureWeightSampler;field_61467:Lnet/minecraft/util/math/BlockBox;intermediary field_61467Lnet/minecraft/class_5817;field_61467:Lnet/minecraft/class_3341;official kLepc;k:Lfaf;
-
-
Constructor Details
-
StructureWeightSampler
public StructureWeightSampler(List<StructureWeightSampler.Piece> list, List<JigsawJunction> list2, @Nullable @Nullable BlockBox blockBox)
-
-
Method Details
-
createStructureWeightSampler
public static StructureWeightSampler createStructureWeightSampler(StructureAccessor structureAccessor, ChunkPos chunkPos) - Mappings:
Namespace Name Mixin selector named createStructureWeightSamplerLnet/minecraft/world/gen/StructureWeightSampler;createStructureWeightSampler(Lnet/minecraft/world/gen/StructureAccessor;Lnet/minecraft/util/math/ChunkPos;)Lnet/minecraft/world/gen/StructureWeightSampler;intermediary method_42695Lnet/minecraft/class_5817;method_42695(Lnet/minecraft/class_5138;Lnet/minecraft/class_1923;)Lnet/minecraft/class_5817;official aLepc;a(Ldsm;Ldqv;)Lepc;
-
method_72681
- Mappings:
Namespace Name Mixin selector named method_72681Lnet/minecraft/world/gen/StructureWeightSampler;method_72681(Lnet/minecraft/util/math/BlockBox;Lnet/minecraft/util/math/BlockBox;)Lnet/minecraft/util/math/BlockBox;intermediary method_72681Lnet/minecraft/class_5817;method_72681(Lnet/minecraft/class_3341;Lnet/minecraft/class_3341;)Lnet/minecraft/class_3341;official aLepc;a(Lfaf;Lfaf;)Lfaf;
-
fill
Fills an array of densities usingthisdensity function and theDensityFunction.EachApplier.- Specified by:
fillin interfaceDensityFunction- Specified by:
fillin interfaceDensityFunction.Base- Parameters:
densities- the array of densities to fill, like a buffer or a cacheapplier- theEachApplierto 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 fillLnet/minecraft/world/gen/densityfunction/DensityFunction;fill([DLnet/minecraft/world/gen/densityfunction/DensityFunction$EachApplier;)Vintermediary method_40470Lnet/minecraft/class_6910;method_40470([DLnet/minecraft/class_6910$class_6911;)Vofficial aLepi;a([DLepi$a;)V
-
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 named sampleLnet/minecraft/world/gen/densityfunction/DensityFunction;sample(Lnet/minecraft/world/gen/densityfunction/DensityFunction$NoisePos;)Dintermediary method_40464Lnet/minecraft/class_6910;method_40464(Lnet/minecraft/class_6910$class_6912;)Dofficial aLepi;a(Lepi$b;)D
-
minValue
public double minValue()- Specified by:
minValuein interfaceDensityFunction- Mappings:
Namespace Name Mixin selector named minValueLnet/minecraft/world/gen/densityfunction/DensityFunction;minValue()Dintermediary comp_377Lnet/minecraft/class_6910;comp_377()Dofficial aLepi;a()D
-
maxValue
public double maxValue()- Specified by:
maxValuein interfaceDensityFunction- Mappings:
Namespace Name Mixin selector named maxValueLnet/minecraft/world/gen/densityfunction/DensityFunction;maxValue()Dintermediary comp_378Lnet/minecraft/class_6910;comp_378()Dofficial bLepi;b()D
-
getMagnitudeWeight
private static double getMagnitudeWeight(double x, double y, double z) - Mappings:
Namespace Name Mixin selector named getMagnitudeWeightLnet/minecraft/world/gen/StructureWeightSampler;getMagnitudeWeight(DDD)Dintermediary method_33832Lnet/minecraft/class_5817;method_33832(DDD)Dofficial aLepc;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 getStructureWeightLnet/minecraft/world/gen/StructureWeightSampler;getStructureWeight(IIII)Dintermediary method_33641Lnet/minecraft/class_5817;method_33641(IIII)Dofficial aLepc;a(IIII)D
-
indexInBounds
private static boolean indexInBounds(int i) - Mappings:
Namespace Name Mixin selector named indexInBoundsLnet/minecraft/world/gen/StructureWeightSampler;indexInBounds(I)Zintermediary method_42692Lnet/minecraft/class_5817;method_42692(I)Zofficial aLepc;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 calculateStructureWeightLnet/minecraft/world/gen/StructureWeightSampler;calculateStructureWeight(III)Dintermediary method_33642Lnet/minecraft/class_5817;method_33642(III)Dofficial aLepc;a(III)D
-
structureWeight
private static double structureWeight(int x, double y, int z) - Mappings:
Namespace Name Mixin selector named structureWeightLnet/minecraft/world/gen/StructureWeightSampler;structureWeight(IDI)Dintermediary method_42693Lnet/minecraft/class_5817;method_42693(IDI)Dofficial aLepc;a(IDI)D
-