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
  • 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 of the structure.
      Specified by:
      settings in interface DefinedStructure
      Returns:
      the settings of the structure
      Since:
      3.4.0
    • withSettings

      @AsOf("3.4.0") ComposedStructure withSettings(StructureSettings settings)
      Returns a copy of this structure with the given settings, keeping its type-specific half.
      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 ComposedStructure 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") ComposedStructure 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<ComposedStructure>
      Returns:
      this structure
    • withSettings

      @AsOf("3.4.0") default ComposedStructure withSettings(UnaryOperator<StructureSettings> mutator)
      Returns a copy of this structure whose settings are the result of applying mutator to this structure's settings.
      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
    • unwrapType

      @AsOf("3.4.0") @Internal Object unwrapType()
      The Minecraft structure carrying this structure's type-specific half, with this wrapper's settings not yet applied.
      Returns:
      the Minecraft structure this wrapper was decoded from
      Since:
      3.4.0
    • toBuilder

      @AsOf("3.4.0") default ComposedStructure.Builder 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 present
      settings - the settings of the structure
      minecraftStructure - the Minecraft structure carrying the type-specific half
      Returns:
      a new composed structure
      Since:
      3.4.0