Interface ComposedStructure
- All Superinterfaces:
DefinedStructure, Keyed, Registerable<ComposedStructure>, Structure, Wrapper
@NullMarked
@AsOf("3.4.0")
public interface ComposedStructure
extends DefinedStructure, Registerable<ComposedStructure>
A composable structure.
- Since:
- 3.4.0
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ComposedStructureof(@Nullable ResourceKey resourceKey, StructureSettings settings, Object minecraftStructure) Creates a new composed structure around an already-built Minecraft structure.register()Registers this structure under its resource key.The resource key of the structure.settings()The settings of the structure.default ComposedStructure.BuilderConverts this composed structure to a builder.The Minecraft structure carrying this structure's type-specific half, with this wrapper's settings not yet applied.default ComposedStructurewithResourceKey(ResourceKey resourceKey) Returns a copy of this structure registered under the given key.withSettings(StructureSettings settings) Returns a copy of this structure with the given settings, keeping its type-specific half.default ComposedStructurewithSettings(UnaryOperator<StructureSettings> mutator) Returns a copy of this structure whose settings are the result of applyingmutatorto this structure's settings.Methods inherited from interface Wrapper
asHandle, toMinecraft, unwrap
-
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 of the structure.- Specified by:
settingsin interfaceDefinedStructure- Returns:
- the settings of the structure
- Since:
- 3.4.0
-
withSettings
Returns a copy of this structure with the given settings, keeping its type-specific half.- 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<ComposedStructure>- Returns:
- this structure
-
withSettings
Returns a copy of this structure whose settings are the result of applyingmutatorto this structure's settings.- 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
-
unwrapType
-
toBuilder
Converts this composed structure to a builder.- Returns:
- a builder with the same values as this composed structure
- Since:
- 3.4.0
-
of
@AsOf("3.4.0") @Internal static ComposedStructure of(@Nullable ResourceKey resourceKey, StructureSettings settings, Object minecraftStructure) Creates a new composed structure around an already-built Minecraft structure.- Parameters:
resourceKey- the resource key of the structure, or null if not presentsettings- the settings of the structureminecraftStructure- the Minecraft structure carrying the type-specific half- Returns:
- a new composed structure
- Since:
- 3.4.0
-