Class Feature<FC extends FeatureConfiguration>
java.lang.Object
net.minecraft.world.level.levelgen.feature.Feature<FC>
- Direct Known Subclasses:
AbstractHugeMushroomFeature
,BambooFeature
,BasaltColumnsFeature
,BasaltPillarFeature
,BlockBlobFeature
,BlockColumnFeature
,BlockPileFeature
,BlueIceFeature
,BonusChestFeature
,ChorusPlantFeature
,CoralFeature
,DeltaFeature
,DesertWellFeature
,DiskFeature
,DripstoneClusterFeature
,EndGatewayFeature
,EndIslandFeature
,EndPlatformFeature
,EndPodiumFeature
,FillLayerFeature
,FossilFeature
,GeodeFeature
,GlowstoneFeature
,HugeFungusFeature
,IcebergFeature
,IceSpikeFeature
,KelpFeature
,LakeFeature
,LargeDripstoneFeature
,MonsterRoomFeature
,MultifaceGrowthFeature
,NetherForestVegetationFeature
,NoOpFeature
,OreFeature
,PointedDripstoneFeature
,RandomBooleanSelectorFeature
,RandomPatchFeature
,RandomSelectorFeature
,ReplaceBlobsFeature
,ReplaceBlockFeature
,RootSystemFeature
,ScatteredOreFeature
,SculkPatchFeature
,SeagrassFeature
,SeaPickleFeature
,SimpleBlockFeature
,SimpleRandomSelectorFeature
,SnowAndFreezeFeature
,SpikeFeature
,SpringFeature
,TreeFeature
,TwistingVinesFeature
,UnderwaterMagmaFeature
,VegetationPatchFeature
,VinesFeature
,VoidStartPlatformFeature
,WeepingVinesFeature
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Feature
<ProbabilityFeatureConfiguration> static final Feature
<ColumnFeatureConfiguration> static final Feature
<NoneFeatureConfiguration> static final Feature
<BlockColumnConfiguration> static final Feature
<BlockPileConfiguration> static final Feature
<NoneFeatureConfiguration> static final BonusChestFeature
static final Feature
<NoneFeatureConfiguration> private final com.mojang.serialization.MapCodec
<ConfiguredFeature<FC, Feature<FC>>> static final Feature
<NoneFeatureConfiguration> static final Feature
<NoneFeatureConfiguration> static final Feature
<NoneFeatureConfiguration> static final Feature
<DeltaFeatureConfiguration> static final Feature
<NoneFeatureConfiguration> static final Feature
<DiskConfiguration> static final Feature
<DripstoneClusterConfiguration> static final Feature
<EndGatewayConfiguration> static final Feature
<NoneFeatureConfiguration> static final Feature
<NoneFeatureConfiguration> static final Feature
<SpikeConfiguration> static final Feature
<LayerConfiguration> static final Feature
<RandomPatchConfiguration> static final Feature
<BlockStateConfiguration> static final Feature
<FossilFeatureConfiguration> static final Feature
<NoneFeatureConfiguration> static final Feature
<GeodeConfiguration> static final Feature
<NoneFeatureConfiguration> static final Feature
<HugeMushroomFeatureConfiguration> static final Feature
<HugeFungusConfiguration> static final Feature
<HugeMushroomFeatureConfiguration> static final Feature
<NoneFeatureConfiguration> static final Feature
<BlockStateConfiguration> static final Feature
<NoneFeatureConfiguration> static final Feature
<LakeFeature.Configuration> static final Feature
<LargeDripstoneConfiguration> static final Feature
<NoneFeatureConfiguration> static final Feature
<MultifaceGrowthConfiguration> static final Feature
<NetherForestVegetationConfig> static final Feature
<RandomPatchConfiguration> static final Feature
<NoneFeatureConfiguration> static final Feature
<OreConfiguration> static final Feature
<PointedDripstoneConfiguration> static final Feature
<RandomBooleanFeatureConfiguration> static final Feature
<RandomPatchConfiguration> static final Feature
<RandomFeatureConfiguration> static final Feature
<ReplaceSphereConfiguration> static final Feature
<ReplaceBlockConfiguration> static final Feature
<RootSystemConfiguration> static final Feature
<OreConfiguration> static final Feature
<SculkPatchConfiguration> static final Feature
<CountConfiguration> static final SeagrassFeature
static final Feature
<SimpleBlockConfiguration> static final Feature
<SimpleRandomFeatureConfiguration> static final Feature
<SpringConfiguration> static final Feature
<TreeConfiguration> static final Feature
<TwistingVinesConfig> static final Feature
<UnderwaterMagmaConfiguration> static final Feature
<VegetationPatchConfiguration> static final Feature
<NoneFeatureConfiguration> static final Feature
<NoneFeatureConfiguration> static final Feature
<VegetationPatchConfiguration> static final Feature
<NoneFeatureConfiguration> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
checkNeighbors
(Function<BlockPos, BlockState> adjacentStateAccessor, BlockPos pos, Predicate<BlockState> filter) com.mojang.serialization.MapCodec
<ConfiguredFeature<FC, Feature<FC>>> static boolean
isAdjacentToAir
(Function<BlockPos, BlockState> adjacentStateAccessor, BlockPos pos) static boolean
isDirt
(BlockState state) static boolean
isGrassOrDirt
(LevelSimulatedReader level, BlockPos pos) static Predicate
<BlockState> isReplaceable
(TagKey<Block> blockTag) protected static boolean
isStone
(BlockState state) protected void
markAboveForPostProcessing
(WorldGenLevel level, BlockPos basePos) If the above two blocks are not air, marks them for post-processing.boolean
place
(FC config, WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos origin) abstract boolean
place
(FeaturePlaceContext<FC> context) Places the given feature at the given location.private static <C extends FeatureConfiguration,
F extends Feature<C>>
Fprotected void
safeSetBlock
(WorldGenLevel level, BlockPos pos, BlockState state, Predicate<BlockState> oldState) protected void
setBlock
(LevelWriter level, BlockPos pos, BlockState state)
-
Field Details
-
NO_OP
-
TREE
-
FLOWER
-
NO_BONEMEAL_FLOWER
-
RANDOM_PATCH
-
BLOCK_PILE
-
SPRING
-
CHORUS_PLANT
-
REPLACE_SINGLE_BLOCK
-
VOID_START_PLATFORM
-
DESERT_WELL
-
FOSSIL
-
HUGE_RED_MUSHROOM
-
HUGE_BROWN_MUSHROOM
-
ICE_SPIKE
-
GLOWSTONE_BLOB
-
FREEZE_TOP_LAYER
-
VINES
-
BLOCK_COLUMN
-
VEGETATION_PATCH
-
WATERLOGGED_VEGETATION_PATCH
-
ROOT_SYSTEM
-
MULTIFACE_GROWTH
-
UNDERWATER_MAGMA
-
MONSTER_ROOM
-
BLUE_ICE
-
ICEBERG
-
FOREST_ROCK
-
DISK
-
LAKE
-
ORE
-
END_PLATFORM
-
END_SPIKE
-
END_ISLAND
-
END_GATEWAY
-
SEAGRASS
-
KELP
-
CORAL_TREE
-
CORAL_MUSHROOM
-
CORAL_CLAW
-
SEA_PICKLE
-
SIMPLE_BLOCK
-
BAMBOO
-
HUGE_FUNGUS
-
NETHER_FOREST_VEGETATION
-
WEEPING_VINES
-
TWISTING_VINES
-
BASALT_COLUMNS
-
DELTA_FEATURE
-
REPLACE_BLOBS
-
FILL_LAYER
-
BONUS_CHEST
-
BASALT_PILLAR
-
SCATTERED_ORE
-
RANDOM_SELECTOR
-
SIMPLE_RANDOM_SELECTOR
-
RANDOM_BOOLEAN_SELECTOR
-
GEODE
-
DRIPSTONE_CLUSTER
-
LARGE_DRIPSTONE
-
POINTED_DRIPSTONE
-
SCULK_PATCH
-
configuredCodec
private final com.mojang.serialization.MapCodec<ConfiguredFeature<FC extends FeatureConfiguration,Feature<FC extends FeatureConfiguration>>> configuredCodec
-
-
Constructor Details
-
Feature
-
-
Method Details
-
register
private static <C extends FeatureConfiguration,F extends Feature<C>> F register(String key, F value) -
configuredCodec
-
setBlock
-
isReplaceable
-
safeSetBlock
protected void safeSetBlock(WorldGenLevel level, BlockPos pos, BlockState state, Predicate<BlockState> oldState) -
place
Places the given feature at the given location. During world generation, features are provided with a 3x3 region of chunks, centered on the chunk being generated, that they can safely generate into.- Parameters:
context
- A context object with a reference to the level and the position the feature is being placed at
-
place
public boolean place(FC config, WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos origin) -
isStone
-
isDirt
-
isGrassOrDirt
-
checkNeighbors
public static boolean checkNeighbors(Function<BlockPos, BlockState> adjacentStateAccessor, BlockPos pos, Predicate<BlockState> filter) - Parameters:
adjacentStateAccessor
- An accessor for the adjacent blocks. Essentially {- Returns:
true
if any of the six adjacent blocks to the block atpos
returntrue
to the given filter.
-
isAdjacentToAir
public static boolean isAdjacentToAir(Function<BlockPos, BlockState> adjacentStateAccessor, BlockPos pos) - Parameters:
adjacentStateAccessor
- An accessor for the adjacent blocks. Essentially {- Returns:
true
if any of the six adjacent blocks to the block atpos
are air.
-
markAboveForPostProcessing
If the above two blocks are not air, marks them for post-processing. This is used to prevent floating grass during the generation of features that carve blocks out of the terrain, after other plant-like blocks have generated (such as lake features).
-