Record Class ProjectedRandomPatchySquare
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.ProjectedRandomPatchySquare
- All Implemented Interfaces:
Feature
public record ProjectedRandomPatchySquare(Holder<BlockStateProvider> block, BlockPredicate projectThrough, IntProvider size, int maxProjectionHeight)
extends Record
implements Feature
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Holder<BlockStateProvider> The field for theblockrecord component.static final com.mojang.serialization.MapCodec<ProjectedRandomPatchySquare> private final intThe field for themaxProjectionHeightrecord component.private final BlockPredicateThe field for theprojectThroughrecord component.private final IntProviderThe field for thesizerecord component.Fields inherited from interface Feature
DIRECT_CODEC, LIST_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionProjectedRandomPatchySquare(Holder<BlockStateProvider> block, BlockPredicate projectThrough, IntProvider size, int maxProjectionHeight) Creates an instance of aProjectedRandomPatchySquarerecord class. -
Method Summary
Modifier and TypeMethodDescriptionblock()Returns the value of theblockrecord component.com.mojang.serialization.MapCodec<ProjectedRandomPatchySquare> codec()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of themaxProjectionHeightrecord component.booleanplace(WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos pos) Returns the value of theprojectThroughrecord component.size()Returns the value of thesizerecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface Feature
getSubFeatures, markAboveForPostProcessing, safeSetBlock, setBlock
-
Field Details
-
block
The field for theblockrecord component. -
projectThrough
The field for theprojectThroughrecord component. -
size
The field for thesizerecord component. -
maxProjectionHeight
private final int maxProjectionHeightThe field for themaxProjectionHeightrecord component. -
CODEC
-
-
Constructor Details
-
ProjectedRandomPatchySquare
public ProjectedRandomPatchySquare(Holder<BlockStateProvider> block, BlockPredicate projectThrough, IntProvider size, int maxProjectionHeight) Creates an instance of aProjectedRandomPatchySquarerecord class.- Parameters:
block- the value for theblockrecord componentprojectThrough- the value for theprojectThroughrecord componentsize- the value for thesizerecord componentmaxProjectionHeight- the value for themaxProjectionHeightrecord component
-
-
Method Details
-
codec
-
place
public boolean place(WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos pos) -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
block
Returns the value of theblockrecord component.- Returns:
- the value of the
blockrecord component
-
projectThrough
Returns the value of theprojectThroughrecord component.- Returns:
- the value of the
projectThroughrecord component
-
size
Returns the value of thesizerecord component.- Returns:
- the value of the
sizerecord component
-
maxProjectionHeight
public int maxProjectionHeight()Returns the value of themaxProjectionHeightrecord component.- Returns:
- the value of the
maxProjectionHeightrecord component
-