Record Class SpringFeature
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.SpringFeature
- All Implemented Interfaces:
Feature
public record SpringFeature(FluidState state, boolean requiresBlockBelow, int rockCount, int holeCount, HolderSet<Block> validBlocks)
extends Record
implements Feature
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<SpringFeature> private final intThe field for theholeCountrecord component.private final booleanThe field for therequiresBlockBelowrecord component.private final intThe field for therockCountrecord component.private final FluidStateThe field for thestaterecord component.The field for thevalidBlocksrecord component.Fields inherited from interface Feature
DIRECT_CODEC, LIST_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionSpringFeature(FluidState state, boolean requiresBlockBelow, int rockCount, int holeCount, HolderSet<Block> validBlocks) Creates an instance of aSpringFeaturerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<SpringFeature> 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 theholeCountrecord component.booleanplace(WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos origin) booleanReturns the value of therequiresBlockBelowrecord component.intReturns the value of therockCountrecord component.state()Returns the value of thestaterecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thevalidBlocksrecord component.Methods inherited from interface Feature
getSubFeatures, markAboveForPostProcessing, safeSetBlock, setBlock
-
Field Details
-
state
The field for thestaterecord component. -
requiresBlockBelow
private final boolean requiresBlockBelowThe field for therequiresBlockBelowrecord component. -
rockCount
private final int rockCountThe field for therockCountrecord component. -
holeCount
private final int holeCountThe field for theholeCountrecord component. -
validBlocks
-
CODEC
-
-
Constructor Details
-
SpringFeature
public SpringFeature(FluidState state, boolean requiresBlockBelow, int rockCount, int holeCount, HolderSet<Block> validBlocks) Creates an instance of aSpringFeaturerecord class.- Parameters:
state- the value for thestaterecord componentrequiresBlockBelow- the value for therequiresBlockBelowrecord componentrockCount- the value for therockCountrecord componentholeCount- the value for theholeCountrecord componentvalidBlocks- the value for thevalidBlocksrecord component
-
-
Method Details
-
codec
-
place
public boolean place(WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos origin) -
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. -
state
Returns the value of thestaterecord component.- Returns:
- the value of the
staterecord component
-
requiresBlockBelow
public boolean requiresBlockBelow()Returns the value of therequiresBlockBelowrecord component.- Returns:
- the value of the
requiresBlockBelowrecord component
-
rockCount
public int rockCount()Returns the value of therockCountrecord component.- Returns:
- the value of the
rockCountrecord component
-
holeCount
public int holeCount()Returns the value of theholeCountrecord component.- Returns:
- the value of the
holeCountrecord component
-
validBlocks
-