Record Class HugeBrownMushroomFeature
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.HugeBrownMushroomFeature
- All Implemented Interfaces:
AbstractHugeMushroomFeature, Feature
public record HugeBrownMushroomFeature(Holder<BlockStateProvider> capProvider, Holder<BlockStateProvider> stemProvider, int foliageRadius, BlockPredicate canPlaceOn)
extends Record
implements AbstractHugeMushroomFeature
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BlockPredicateThe field for thecanPlaceOnrecord component.private final Holder<BlockStateProvider> The field for thecapProviderrecord component.static final com.mojang.serialization.MapCodec<HugeBrownMushroomFeature> private final intThe field for thefoliageRadiusrecord component.private final Holder<BlockStateProvider> The field for thestemProviderrecord component.Fields inherited from interface AbstractHugeMushroomFeature
MIN_MUSHROOM_HEIGHTFields inherited from interface Feature
DIRECT_CODEC, LIST_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionHugeBrownMushroomFeature(Holder<BlockStateProvider> capProvider, Holder<BlockStateProvider> stemProvider, int foliageRadius, BlockPredicate canPlaceOn) Creates an instance of aHugeBrownMushroomFeaturerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecanPlaceOnrecord component.Returns the value of thecapProviderrecord component.com.mojang.serialization.MapCodec<HugeBrownMushroomFeature> codec()final booleanIndicates whether some other object is "equal to" this one.intReturns the value of thefoliageRadiusrecord component.intgetTreeRadiusForHeight(int trunkHeight, int treeHeight, int leafRadius, int yo) final inthashCode()Returns a hash code value for this object.voidmakeCap(WorldGenLevel level, RandomSource random, BlockPos origin, int treeHeight, BlockPos.MutableBlockPos blockPos) Returns the value of thestemProviderrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface AbstractHugeMushroomFeature
getTreeHeight, isValidPosition, place, placeMushroomBlock, placeTrunkMethods inherited from interface Feature
getSubFeatures, markAboveForPostProcessing, safeSetBlock, setBlock
-
Field Details
-
capProvider
The field for thecapProviderrecord component. -
stemProvider
The field for thestemProviderrecord component. -
foliageRadius
private final int foliageRadiusThe field for thefoliageRadiusrecord component. -
canPlaceOn
The field for thecanPlaceOnrecord component. -
CODEC
-
-
Constructor Details
-
HugeBrownMushroomFeature
public HugeBrownMushroomFeature(Holder<BlockStateProvider> capProvider, Holder<BlockStateProvider> stemProvider, int foliageRadius, BlockPredicate canPlaceOn) Creates an instance of aHugeBrownMushroomFeaturerecord class.- Parameters:
capProvider- the value for thecapProviderrecord componentstemProvider- the value for thestemProviderrecord componentfoliageRadius- the value for thefoliageRadiusrecord componentcanPlaceOn- the value for thecanPlaceOnrecord component
-
-
Method Details
-
codec
- Specified by:
codecin interfaceAbstractHugeMushroomFeature- Specified by:
codecin interfaceFeature
-
makeCap
public void makeCap(WorldGenLevel level, RandomSource random, BlockPos origin, int treeHeight, BlockPos.MutableBlockPos blockPos) - Specified by:
makeCapin interfaceAbstractHugeMushroomFeature
-
getTreeRadiusForHeight
public int getTreeRadiusForHeight(int trunkHeight, int treeHeight, int leafRadius, int yo) - Specified by:
getTreeRadiusForHeightin interfaceAbstractHugeMushroomFeature
-
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. -
capProvider
Returns the value of thecapProviderrecord component.- Specified by:
capProviderin interfaceAbstractHugeMushroomFeature- Returns:
- the value of the
capProviderrecord component
-
stemProvider
Returns the value of thestemProviderrecord component.- Specified by:
stemProviderin interfaceAbstractHugeMushroomFeature- Returns:
- the value of the
stemProviderrecord component
-
foliageRadius
public int foliageRadius()Returns the value of thefoliageRadiusrecord component.- Specified by:
foliageRadiusin interfaceAbstractHugeMushroomFeature- Returns:
- the value of the
foliageRadiusrecord component
-
canPlaceOn
Returns the value of thecanPlaceOnrecord component.- Specified by:
canPlaceOnin interfaceAbstractHugeMushroomFeature- Returns:
- the value of the
canPlaceOnrecord component
-