Interface JigsawStructure

All Superinterfaces:
DefinedStructure, Keyed, Registerable<JigsawStructure>, Structure, Wrapper

@NullMarked @AsOf("3.4.0") public interface JigsawStructure extends DefinedStructure, Registerable<JigsawStructure>
A structure that grows outward from a piece drawn from its start pool, attaching a new piece at each jigsaw block until size() steps from the start.
Since:
3.4.0
See Also:
  • Field Details

  • Method Details

    • resourceKey

      @AsOf("3.4.0") Optional<ResourceKey> resourceKey()
      The resource key of the structure.
      Specified by:
      resourceKey in interface DefinedStructure
      Returns:
      the resource key of the structure, if present
      Since:
      3.4.0
    • settings

      @AsOf("3.4.0") StructureSettings settings()
      The settings every structure carries.
      Specified by:
      settings in interface DefinedStructure
      Returns:
      the settings of the structure
      Since:
      3.4.0
    • startPool

      @AsOf("3.4.0") TemplatePool startPool()
      The pool the first piece is drawn from.
      Returns:
      the start pool
      Since:
      3.4.0
    • startJigsawName

      @AsOf("3.4.0") Optional<ResourceKey> startJigsawName()
      The name of the jigsaw block in the start piece that is anchored to the structure's position.
      Returns:
      the start jigsaw name, if present
      Since:
      3.4.0
    • size

      @AsOf("3.4.0") int size()
      How many jigsaw steps the structure grows from its start piece, from 0 to 20.
      Returns:
      the maximum depth
      Since:
      3.4.0
    • startHeight

      @AsOf("3.4.0") HeightProvider startHeight()
      The height the start piece is placed at, relative to the heightmap when projectStartToHeightmap() is set.
      Returns:
      the start height
      Since:
      3.4.0
    • useExpansionHack

      @AsOf("3.4.0") boolean useExpansionHack()
      Vanilla's village expansion hack, which lets pieces extend past their bounding box.
      Returns:
      whether the expansion hack is used
      Since:
      3.4.0
    • projectStartToHeightmap

      @AsOf("3.4.0") Optional<HeightmapType> projectStartToHeightmap()
      The heightmap the start height is measured from. Absent, the start height is absolute.
      Returns:
      the heightmap, if present
      Since:
      3.4.0
    • maxDistanceFromCenter

      @AsOf("3.4.0") JigsawStructure.MaxDistance maxDistanceFromCenter()
      The furthest pieces may be placed from the start.
      Returns:
      the maximum distance from the center
      Since:
      3.4.0
    • poolAliases

      @AsOf("3.4.0") List<PoolAliasBinding> poolAliases()
      The pool aliases resolved once per structure.
      Returns:
      the pool alias bindings
      Since:
      3.4.0
    • dimensionPadding

      @AsOf("3.4.0") DimensionPadding dimensionPadding()
      The clearance kept from the bottom and top of the dimension.
      Returns:
      the dimension padding
      Since:
      3.4.0
    • liquidSettings

      @AsOf("3.4.0") LiquidSettings liquidSettings()
      Whether pieces landing in water are waterlogged.
      Returns:
      the liquid settings
      Since:
      3.4.0
    • withSettings

      @AsOf("3.4.0") default JigsawStructure withSettings(StructureSettings settings)
      Returns a copy of this structure with the given settings.
      Specified by:
      withSettings in interface DefinedStructure
      Parameters:
      settings - the settings the copy carries
      Returns:
      a copy of this structure with the given settings
      Since:
      3.4.0
    • withResourceKey

      @AsOf("3.4.0") default JigsawStructure withResourceKey(ResourceKey resourceKey)
      Description copied from interface: DefinedStructure
      Returns a copy of this structure registered under the given key.
      Specified by:
      withResourceKey in interface DefinedStructure
      Parameters:
      resourceKey - the key the copy carries
      Returns:
      a copy of this structure with the given key
    • register

      @AsOf("3.4.0") JigsawStructure register()
      Description copied from interface: DefinedStructure
      Registers this structure under its resource key.
      Specified by:
      register in interface DefinedStructure
      Specified by:
      register in interface Registerable<JigsawStructure>
      Returns:
      this structure
    • withSettings

      @AsOf("3.4.0") default JigsawStructure withSettings(UnaryOperator<StructureSettings> mutator)
      Returns a copy of this structure whose settings are the result of applying mutator.
      Specified by:
      withSettings in interface DefinedStructure
      Parameters:
      mutator - the operator to apply to this structure's settings
      Returns:
      a copy of this structure with the mutated settings
      Since:
      3.4.0
    • toBuilder

      @AsOf("3.4.0") default JigsawStructure.Builder toBuilder()
      Converts this object back to a builder.
      Returns:
      a builder with the same values as this object
      Since:
      3.4.0
    • of

      @AsOf("3.4.0") static JigsawStructure of(@Nullable ResourceKey resourceKey, StructureSettings settings, TemplatePool startPool, @Nullable ResourceKey startJigsawName, int size, HeightProvider startHeight, boolean useExpansionHack, @Nullable HeightmapType projectStartToHeightmap, JigsawStructure.MaxDistance maxDistanceFromCenter, List<PoolAliasBinding> poolAliases, DimensionPadding dimensionPadding, LiquidSettings liquidSettings)
      Creates a new jigsaw structure.
      Parameters:
      resourceKey - the resource key of the structure, or null if not present
      settings - the settings every structure carries
      startPool - the pool the first piece is drawn from
      startJigsawName - the jigsaw block in the start piece anchored to the structure's position, or null
      size - how many jigsaw steps the structure grows from its start piece
      startHeight - the height the start piece is placed at
      useExpansionHack - whether vanilla's village expansion hack is used
      projectStartToHeightmap - the heightmap the start height is measured from, or null for an absolute height
      maxDistanceFromCenter - the furthest pieces may be placed from the start
      poolAliases - the pool aliases resolved once per structure
      dimensionPadding - the clearance kept from the bottom and top of the dimension
      liquidSettings - whether pieces landing in water are waterlogged
      Returns:
      a new jigsaw structure
      Throws:
      IllegalArgumentException - if the size is out of range, or the horizontal reach plus the terrain adaptation's margin exceeds 128
      Since:
      3.4.0
    • builder

      @AsOf("3.4.0") static JigsawStructure.Builder builder(StructureSettings settings, TemplatePool startPool)
      Creates a new builder.
      Parameters:
      settings - the settings every structure carries
      startPool - the pool the first piece is drawn from
      Returns:
      a new builder
      Since:
      3.4.0