Record Class HugeFungusFeature
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.HugeFungusFeature
- All Implemented Interfaces:
Feature
public record HugeFungusFeature(BlockState validBaseState, BlockState stemState, BlockState hatState, BlockState decorState, BlockPredicate replaceableBlocks, boolean planted)
extends Record
implements Feature
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<HugeFungusFeature> private final BlockStateThe field for thedecorStaterecord component.private final BlockStateThe field for thehatStaterecord component.private static final floatprivate final booleanThe field for theplantedrecord component.private final BlockPredicateThe field for thereplaceableBlocksrecord component.private final BlockStateThe field for thestemStaterecord component.private final BlockStateThe field for thevalidBaseStaterecord component.Fields inherited from interface Feature
DIRECT_CODEC, LIST_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionHugeFungusFeature(BlockState validBaseState, BlockState stemState, BlockState hatState, BlockState decorState, BlockPredicate replaceableBlocks, boolean planted) Creates an instance of aHugeFungusFeaturerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<HugeFungusFeature> codec()Returns the value of thedecorStaterecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.hatState()Returns the value of thehatStaterecord component.private booleanisReplaceable(WorldGenLevel level, BlockPos pos, boolean checkNonReplaceablePlants) booleanplace(WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos origin) private voidplaceHat(WorldGenLevel level, RandomSource random, BlockPos surfaceOrigin, int totalHeight, boolean isHuge) private voidplaceHatBlock(LevelAccessor level, RandomSource random, BlockPos.MutableBlockPos blockPos, float decorBlockProbability, float hatBlockProbability, float vinesProbability) private voidplaceHatDropBlock(LevelAccessor level, RandomSource random, BlockPos blockPos, boolean placeVines) private voidplaceStem(WorldGenLevel level, RandomSource random, BlockPos surfaceOrigin, int totalHeight, boolean isHuge) private static voidplaceWeepingVinesColumn(LevelAccessor level, RandomSource random, BlockPos origin, int totalHeight, int minAge, int naxAge) booleanplanted()Returns the value of theplantedrecord component.Returns the value of thereplaceableBlocksrecord component.Returns the value of thestemStaterecord component.final StringtoString()Returns a string representation of this record class.private static voidtryPlaceWeepingVines(BlockPos hatBlockPos, LevelAccessor level, RandomSource random) Returns the value of thevalidBaseStaterecord component.Methods inherited from interface Feature
getSubFeatures, markAboveForPostProcessing, safeSetBlock, setBlock
-
Field Details
-
validBaseState
The field for thevalidBaseStaterecord component. -
stemState
The field for thestemStaterecord component. -
hatState
The field for thehatStaterecord component. -
decorState
The field for thedecorStaterecord component. -
replaceableBlocks
The field for thereplaceableBlocksrecord component. -
planted
private final boolean plantedThe field for theplantedrecord component. -
HUGE_PROBABILITY
private static final float HUGE_PROBABILITY- See Also:
-
CODEC
-
-
Constructor Details
-
HugeFungusFeature
public HugeFungusFeature(BlockState validBaseState, BlockState stemState, BlockState hatState, BlockState decorState, BlockPredicate replaceableBlocks, boolean planted) Creates an instance of aHugeFungusFeaturerecord class.- Parameters:
validBaseState- the value for thevalidBaseStaterecord componentstemState- the value for thestemStaterecord componenthatState- the value for thehatStaterecord componentdecorState- the value for thedecorStaterecord componentreplaceableBlocks- the value for thereplaceableBlocksrecord componentplanted- the value for theplantedrecord component
-
-
Method Details
-
codec
-
place
public boolean place(WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos origin) -
isReplaceable
-
placeStem
private void placeStem(WorldGenLevel level, RandomSource random, BlockPos surfaceOrigin, int totalHeight, boolean isHuge) -
placeHat
private void placeHat(WorldGenLevel level, RandomSource random, BlockPos surfaceOrigin, int totalHeight, boolean isHuge) -
placeHatBlock
private void placeHatBlock(LevelAccessor level, RandomSource random, BlockPos.MutableBlockPos blockPos, float decorBlockProbability, float hatBlockProbability, float vinesProbability) -
placeHatDropBlock
private void placeHatDropBlock(LevelAccessor level, RandomSource random, BlockPos blockPos, boolean placeVines) -
tryPlaceWeepingVines
private static void tryPlaceWeepingVines(BlockPos hatBlockPos, LevelAccessor level, RandomSource random) -
placeWeepingVinesColumn
private static void placeWeepingVinesColumn(LevelAccessor level, RandomSource random, BlockPos origin, int totalHeight, int minAge, int naxAge) -
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. -
validBaseState
Returns the value of thevalidBaseStaterecord component.- Returns:
- the value of the
validBaseStaterecord component
-
stemState
Returns the value of thestemStaterecord component.- Returns:
- the value of the
stemStaterecord component
-
hatState
Returns the value of thehatStaterecord component.- Returns:
- the value of the
hatStaterecord component
-
decorState
Returns the value of thedecorStaterecord component.- Returns:
- the value of the
decorStaterecord component
-
replaceableBlocks
Returns the value of thereplaceableBlocksrecord component.- Returns:
- the value of the
replaceableBlocksrecord component
-
planted
public boolean planted()Returns the value of theplantedrecord component.- Returns:
- the value of the
plantedrecord component
-