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:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classBuilder forJigsawStructure.static final recordHow far from the start piece a jigsaw structure may place pieces. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionstatic JigsawStructure.Builderbuilder(StructureSettings settings, TemplatePool startPool) Creates a new builder.The clearance kept from the bottom and top of the dimension.Whether pieces landing in water are waterlogged.The furthest pieces may be placed from the start.static JigsawStructureof(@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.The pool aliases resolved once per structure.The heightmap the start height is measured from.register()Registers this structure under its resource key.The resource key of the structure.settings()The settings every structure carries.intsize()How many jigsaw steps the structure grows from its start piece, from 0 to 20.The height the start piece is placed at, relative to the heightmap whenprojectStartToHeightmap()is set.The name of the jigsaw block in the start piece that is anchored to the structure's position.The pool the first piece is drawn from.default JigsawStructure.BuilderConverts this object back to a builder.booleanVanilla's village expansion hack, which lets pieces extend past their bounding box.default JigsawStructurewithResourceKey(ResourceKey resourceKey) Returns a copy of this structure registered under the given key.default JigsawStructurewithSettings(StructureSettings settings) Returns a copy of this structure with the given settings.default JigsawStructurewithSettings(UnaryOperator<StructureSettings> mutator) Returns a copy of this structure whose settings are the result of applyingmutator.Methods inherited from interface Wrapper
asHandle, toMinecraft, unwrap
-
Field Details
-
MAX_SIZE
static final int MAX_SIZE- See Also:
-
MAX_TOTAL_STRUCTURE_RANGE
static final int MAX_TOTAL_STRUCTURE_RANGE- See Also:
-
-
Method Details
-
resourceKey
The resource key of the structure.- Specified by:
resourceKeyin interfaceDefinedStructure- Returns:
- the resource key of the structure, if present
- Since:
- 3.4.0
-
settings
The settings every structure carries.- Specified by:
settingsin interfaceDefinedStructure- Returns:
- the settings of the structure
- Since:
- 3.4.0
-
startPool
The pool the first piece is drawn from.- Returns:
- the start pool
- Since:
- 3.4.0
-
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
-
startHeight
The height the start piece is placed at, relative to the heightmap whenprojectStartToHeightmap()is set.- Returns:
- the start height
- Since:
- 3.4.0
-
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
The heightmap the start height is measured from. Absent, the start height is absolute.- Returns:
- the heightmap, if present
- Since:
- 3.4.0
-
maxDistanceFromCenter
The furthest pieces may be placed from the start.- Returns:
- the maximum distance from the center
- Since:
- 3.4.0
-
poolAliases
The pool aliases resolved once per structure.- Returns:
- the pool alias bindings
- Since:
- 3.4.0
-
dimensionPadding
The clearance kept from the bottom and top of the dimension.- Returns:
- the dimension padding
- Since:
- 3.4.0
-
liquidSettings
Whether pieces landing in water are waterlogged.- Returns:
- the liquid settings
- Since:
- 3.4.0
-
withSettings
Returns a copy of this structure with the given settings.- Specified by:
withSettingsin interfaceDefinedStructure- Parameters:
settings- the settings the copy carries- Returns:
- a copy of this structure with the given settings
- Since:
- 3.4.0
-
withResourceKey
Description copied from interface:DefinedStructureReturns a copy of this structure registered under the given key.- Specified by:
withResourceKeyin interfaceDefinedStructure- Parameters:
resourceKey- the key the copy carries- Returns:
- a copy of this structure with the given key
-
register
Description copied from interface:DefinedStructureRegisters this structure under its resource key.- Specified by:
registerin interfaceDefinedStructure- Specified by:
registerin interfaceRegisterable<JigsawStructure>- Returns:
- this structure
-
withSettings
Returns a copy of this structure whose settings are the result of applyingmutator.- Specified by:
withSettingsin interfaceDefinedStructure- 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
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 presentsettings- the settings every structure carriesstartPool- the pool the first piece is drawn fromstartJigsawName- the jigsaw block in the start piece anchored to the structure's position, or nullsize- how many jigsaw steps the structure grows from its start piecestartHeight- the height the start piece is placed atuseExpansionHack- whether vanilla's village expansion hack is usedprojectStartToHeightmap- the heightmap the start height is measured from, or null for an absolute heightmaxDistanceFromCenter- the furthest pieces may be placed from the startpoolAliases- the pool aliases resolved once per structuredimensionPadding- the clearance kept from the bottom and top of the dimensionliquidSettings- 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 carriesstartPool- the pool the first piece is drawn from- Returns:
- a new builder
- Since:
- 3.4.0
-