Class OvergrowthProcessor
java.lang.Object
net.minecraft.world.level.levelgen.structure.templatesystem.StructureProcessor
johnsmith.enchantingoverhauled.api.structure.processor.OvergrowthProcessor
public class OvergrowthProcessor
extends net.minecraft.world.level.levelgen.structure.templatesystem.StructureProcessor
A
StructureProcessor that adds foliage (Blocks.JUNGLE_LEAVES) to generated structures.
Inspects air blocks in the structure template and checks the block directly below them.
If the floor block is Oak Planks, a Bookshelf, or Obsidian, it has a configurable probability
to place persistent Jungle Leaves at the current air position.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<OvergrowthProcessor> TheMapCodecfor serializing and deserializing anOvergrowthProcessorfrom JSON. -
Constructor Summary
ConstructorsConstructorDescriptionOvergrowthProcessor(float probability) Constructs a newOvergrowthProcessor. -
Method Summary
Modifier and TypeMethodDescriptionprotected @NotNull net.minecraft.world.level.levelgen.structure.templatesystem.StructureProcessorType<?> getType()Retrieves the registeredStructureProcessorTypefor this processor.net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfoprocessBlock(@NotNull net.minecraft.world.level.LevelReader world, @NotNull net.minecraft.core.BlockPos pos, @NotNull net.minecraft.core.BlockPos pivot, net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo originalBlockInfo, net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo currentBlockInfo, @NotNull net.minecraft.world.level.levelgen.structure.templatesystem.StructurePlaceSettings data) Processes a single block during structure template placement, potentially placing persistent Jungle Leaves in air spaces above eligible floor blocks.Methods inherited from class net.minecraft.world.level.levelgen.structure.templatesystem.StructureProcessor
finalizeProcessing
-
Field Details
-
CODEC
TheMapCodecfor serializing and deserializing anOvergrowthProcessorfrom JSON.
-
-
Constructor Details
-
OvergrowthProcessor
public OvergrowthProcessor(float probability) Constructs a newOvergrowthProcessor.- Parameters:
probability- The chance (0.0to1.0) to spawn leaves above a valid block.
-
-
Method Details
-
processBlock
@Nullable public net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo processBlock(@NotNull @NotNull net.minecraft.world.level.LevelReader world, @NotNull @NotNull net.minecraft.core.BlockPos pos, @NotNull @NotNull net.minecraft.core.BlockPos pivot, @NotNull net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo originalBlockInfo, net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo currentBlockInfo, @NotNull @NotNull net.minecraft.world.level.levelgen.structure.templatesystem.StructurePlaceSettings data) Processes a single block during structure template placement, potentially placing persistent Jungle Leaves in air spaces above eligible floor blocks.- Overrides:
processBlockin classnet.minecraft.world.level.levelgen.structure.templatesystem.StructureProcessor- Parameters:
world- The level reader.pos- The template offset position.pivot- The structure pivot position.originalBlockInfo- The unrotated original block info from the template.currentBlockInfo- The transformed block info in world coordinates.data- The structure placement settings.- Returns:
- The resulting
StructureTemplate.StructureBlockInfo.
-
getType
@NotNull protected @NotNull net.minecraft.world.level.levelgen.structure.templatesystem.StructureProcessorType<?> getType()Retrieves the registeredStructureProcessorTypefor this processor.- Specified by:
getTypein classnet.minecraft.world.level.levelgen.structure.templatesystem.StructureProcessor- Returns:
StructureProcessors.OVERGROWTH.
-