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

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.MapCodec<OvergrowthProcessor>
    The MapCodec for serializing and deserializing an OvergrowthProcessor from JSON.
  • Constructor Summary

    Constructors
    Constructor
    Description
    OvergrowthProcessor(float probability)
    Constructs a new OvergrowthProcessor.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected @NotNull net.minecraft.world.level.levelgen.structure.templatesystem.StructureProcessorType<?>
    Retrieves the registered StructureProcessorType for this processor.
    net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo
    processBlock(@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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • OvergrowthProcessor

      public OvergrowthProcessor(float probability)
      Constructs a new OvergrowthProcessor.
      Parameters:
      probability - The chance (0.0 to 1.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:
      processBlock in class net.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 registered StructureProcessorType for this processor.
      Specified by:
      getType in class net.minecraft.world.level.levelgen.structure.templatesystem.StructureProcessor
      Returns:
      StructureProcessors.OVERGROWTH.