Class UpdatingJigsawStructure

java.lang.Object
net.minecraft.world.level.levelgen.structure.Structure
johnsmith.enchantingoverhauled.api.structure.UpdatingJigsawStructure

public class UpdatingJigsawStructure extends net.minecraft.world.level.levelgen.structure.Structure
A custom Structure implementation extending the behavior of vanilla's JigsawStructure by performing a post-placement neighbor shape update pass across all placed structure pieces.

When complex multi-piece structures (such as Scribe's Rise) assemble walls, stairs, fences, or glass panes across jigsaw piece boundaries or via custom rule processors, vanilla template placement does not always reconcile connected block states (e.g., corner stairs or connected walls). This structure runs a forward, backward, and final forward pass of Block.updateFromNeighbourShapes(net.minecraft.world.level.block.state.BlockState, net.minecraft.world.level.LevelAccessor, net.minecraft.core.BlockPos) after placement to ensure all connecting block states are properly resolved.

  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraft.world.level.levelgen.structure.Structure

    net.minecraft.world.level.levelgen.structure.Structure.GenerationContext, net.minecraft.world.level.levelgen.structure.Structure.GenerationStub, net.minecraft.world.level.levelgen.structure.Structure.StructureSettings
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.MapCodec<UpdatingJigsawStructure>
    The MapCodec used to serialize and deserialize UpdatingJigsawStructure definitions from JSON, including range validation accounting for terrain adaptation padding.
    static final net.minecraft.world.level.levelgen.structure.StructureType<UpdatingJigsawStructure>
    The registered StructureType singleton for enchanting_overhauled:updating_jigsaw.

    Fields inherited from class net.minecraft.world.level.levelgen.structure.Structure

    DIRECT_CODEC, settings
  • Constructor Summary

    Constructors
    Constructor
    Description
    UpdatingJigsawStructure(net.minecraft.world.level.levelgen.structure.Structure.StructureSettings settings, net.minecraft.core.Holder<net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool> startPool, Optional<net.minecraft.resources.Identifier> startJigsawName, int maxDepth, net.minecraft.world.level.levelgen.heightproviders.HeightProvider startHeight, boolean useExpansionHack, Optional<net.minecraft.world.level.levelgen.Heightmap.Types> projectStartToHeightmap, net.minecraft.world.level.levelgen.structure.structures.JigsawStructure.MaxDistance maxDistanceFromCenter, List<net.minecraft.world.level.levelgen.structure.pools.alias.PoolAliasBinding> poolAliases, net.minecraft.world.level.levelgen.structure.pools.DimensionPadding dimensionPadding, net.minecraft.world.level.levelgen.structure.templatesystem.LiquidSettings liquidSettings)
    Constructs a new UpdatingJigsawStructure.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    afterPlace(net.minecraft.world.level.WorldGenLevel level, net.minecraft.world.level.StructureManager structureManager, net.minecraft.world.level.chunk.ChunkGenerator chunkGenerator, net.minecraft.util.RandomSource random, net.minecraft.world.level.levelgen.structure.BoundingBox boundingBox, net.minecraft.world.level.ChunkPos chunkPos, net.minecraft.world.level.levelgen.structure.pieces.PiecesContainer piecesContainer)
    Executed after the structure pieces have been placed into the chunk.
    Optional<net.minecraft.world.level.levelgen.structure.Structure.GenerationStub>
    findGenerationPoint(net.minecraft.world.level.levelgen.structure.Structure.GenerationContext context)
    Computes the starting generation point and assembles the jigsaw pieces via JigsawPlacement.
    net.minecraft.world.level.levelgen.structure.StructureType<?>
    Retrieves the StructureType for this structure.

    Methods inherited from class net.minecraft.world.level.levelgen.structure.Structure

    adjustBoundingBox, biomes, findValidGenerationPoint, generate, getLowestY, getLowestY, getLowestYIn5by5BoxOffset7Blocks, getMeanFirstOccupiedHeight, onTopOfChunkCenter, settingsCodec, simpleCodec, spawnOverrides, step, terrainAdaptation

    Methods inherited from class java.lang.Object

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

    • CODEC

      public static final com.mojang.serialization.MapCodec<UpdatingJigsawStructure> CODEC
      The MapCodec used to serialize and deserialize UpdatingJigsawStructure definitions from JSON, including range validation accounting for terrain adaptation padding.
    • TYPE

      public static final net.minecraft.world.level.levelgen.structure.StructureType<UpdatingJigsawStructure> TYPE
      The registered StructureType singleton for enchanting_overhauled:updating_jigsaw.
  • Constructor Details

    • UpdatingJigsawStructure

      public UpdatingJigsawStructure(net.minecraft.world.level.levelgen.structure.Structure.StructureSettings settings, net.minecraft.core.Holder<net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool> startPool, Optional<net.minecraft.resources.Identifier> startJigsawName, int maxDepth, net.minecraft.world.level.levelgen.heightproviders.HeightProvider startHeight, boolean useExpansionHack, Optional<net.minecraft.world.level.levelgen.Heightmap.Types> projectStartToHeightmap, net.minecraft.world.level.levelgen.structure.structures.JigsawStructure.MaxDistance maxDistanceFromCenter, List<net.minecraft.world.level.levelgen.structure.pools.alias.PoolAliasBinding> poolAliases, net.minecraft.world.level.levelgen.structure.pools.DimensionPadding dimensionPadding, net.minecraft.world.level.levelgen.structure.templatesystem.LiquidSettings liquidSettings)
      Constructs a new UpdatingJigsawStructure.
      Parameters:
      settings - The base structure settings (biomes, spawn overrides, generation step, terrain adaptation).
      startPool - The starting template pool.
      startJigsawName - Optional target jigsaw block name for the start piece.
      maxDepth - Maximum jigsaw branching depth.
      startHeight - Height provider for the starting Y level.
      useExpansionHack - Whether to enable the legacy expansion hack.
      projectStartToHeightmap - Optional heightmap projection type.
      maxDistanceFromCenter - Maximum distance from the center of the structure.
      poolAliases - List of pool alias bindings.
      dimensionPadding - Dimension boundary padding.
      liquidSettings - Liquid placement settings.
  • Method Details

    • findGenerationPoint

      public Optional<net.minecraft.world.level.levelgen.structure.Structure.GenerationStub> findGenerationPoint(net.minecraft.world.level.levelgen.structure.Structure.GenerationContext context)
      Computes the starting generation point and assembles the jigsaw pieces via JigsawPlacement.
      Specified by:
      findGenerationPoint in class net.minecraft.world.level.levelgen.structure.Structure
      Parameters:
      context - The world generation context.
      Returns:
      An Optional containing the Structure.GenerationStub if placement succeeded.
    • afterPlace

      public void afterPlace(net.minecraft.world.level.WorldGenLevel level, net.minecraft.world.level.StructureManager structureManager, net.minecraft.world.level.chunk.ChunkGenerator chunkGenerator, net.minecraft.util.RandomSource random, net.minecraft.world.level.levelgen.structure.BoundingBox boundingBox, net.minecraft.world.level.ChunkPos chunkPos, net.minecraft.world.level.levelgen.structure.pieces.PiecesContainer piecesContainer)
      Executed after the structure pieces have been placed into the chunk. Collects all block positions within the intersection of the current chunk and each placed piece's bounding box, then performs three passes (forward, backward, forward) of neighbor shape updates to resolve connected stairs, walls, fences, and panes.
      Overrides:
      afterPlace in class net.minecraft.world.level.levelgen.structure.Structure
      Parameters:
      level - The world generation level.
      structureManager - The structure manager.
      chunkGenerator - The active chunk generator.
      random - The random source.
      boundingBox - The current generation bounding box.
      chunkPos - The chunk coordinates being populated.
      piecesContainer - The container holding the placed structure pieces.
    • type

      public net.minecraft.world.level.levelgen.structure.StructureType<?> type()
      Retrieves the StructureType for this structure.
      Specified by:
      type in class net.minecraft.world.level.levelgen.structure.Structure
      Returns:
      TYPE.