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,FallenTreeFeature,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 BonusChestFeaturestatic 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<FallenTreeConfiguration> 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 SeagrassFeaturestatic 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 booleancheckNeighbors(Function<BlockPos, BlockState> pAdjacentStateAccessor, BlockPos pPos, Predicate<BlockState> pFilter) com.mojang.serialization.MapCodec<ConfiguredFeature<FC, Feature<FC>>> static booleanisAdjacentToAir(Function<BlockPos, BlockState> pAdjacentStateAccessor, BlockPos pPos) static booleanisDirt(BlockState pState) static booleanisGrassOrDirt(LevelSimulatedReader pLevel, BlockPos pPos) static Predicate<BlockState> isReplaceable(TagKey<Block> pBlockTag) protected static booleanisStone(BlockState pState) protected voidmarkAboveForPostProcessing(WorldGenLevel pLevel, BlockPos pBasePos) If the above two blocks are not air, marks them for post-processing.booleanplace(FC pConfig, WorldGenLevel pLevel, ChunkGenerator pChunkGenerator, RandomSource pRandom, BlockPos pOrigin) abstract booleanplace(FeaturePlaceContext<FC> pContext) Places the given feature at the given location.private static <C extends FeatureConfiguration,F extends Feature<C>>
Fprotected voidsafeSetBlock(WorldGenLevel pLevel, BlockPos pPos, BlockState pState, Predicate<BlockState> pOldState) protected voidsetBlock(LevelWriter pLevel, BlockPos pPos, BlockState pState)
-
Field Details
-
NO_OP
-
TREE
-
FALLEN_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 pKey, F pValue) -
configuredCodec
-
setBlock
-
isReplaceable
-
safeSetBlock
protected void safeSetBlock(WorldGenLevel pLevel, BlockPos pPos, BlockState pState, Predicate<BlockState> pOldState) -
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:
pContext- A context object with a reference to the level and the position the feature is being placed at
-
place
public boolean place(FC pConfig, WorldGenLevel pLevel, ChunkGenerator pChunkGenerator, RandomSource pRandom, BlockPos pOrigin) -
isStone
-
isDirt
-
isGrassOrDirt
-
checkNeighbors
public static boolean checkNeighbors(Function<BlockPos, BlockState> pAdjacentStateAccessor, BlockPos pPos, Predicate<BlockState> pFilter) - Parameters:
pAdjacentStateAccessor- An accessor for the adjacent blocks. Essentiallylevel::getBlockState.- Returns:
trueif any of the six adjacent blocks to the block atposreturntrueto the given filter.
-
isAdjacentToAir
public static boolean isAdjacentToAir(Function<BlockPos, BlockState> pAdjacentStateAccessor, BlockPos pPos) - Parameters:
pAdjacentStateAccessor- An accessor for the adjacent blocks. Essentiallylevel::getBlockState.- Returns:
trueif any of the six adjacent blocks to the block atposare 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).
-