Interface ModelElement

All Known Implementing Classes:
ModelElement.Camera, ModelElement.Cube, ModelElement.Locator, ModelElement.Mesh, ModelElement.NullObject, ModelElement.Unsupported

Represents a raw element within a model file.

This interface is a sealed type that permits specific implementations for different element types found in BlockBench models, such as cubes, locators, null objects, and cameras.

Since:
1.15.2
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    Represents a camera element (currently used as a placeholder).
    static final record 
    Represents a standard cube element.
    static final record 
    Represents a locator element, used for positioning attachments or particles.
    static final record 
    Represents a mesh element, allowing for complex geometry beyond simple cubes.
    static final record 
    Represents a null object, often used for grouping or IK targets.
    static final record 
    Represents an unsupported element type.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The type identifier for a camera element.
    static final String
    The type identifier for a cube element.
    static final String
    The type identifier for a locator element.
    static final String
    The type identifier for a mesh element.
    static final String
    The type identifier for a null object element.
    static final com.google.gson.JsonDeserializer<ModelElement>
    A JSON deserializer that automatically dispatches to the correct ModelElement implementation based on the "type" field.
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Checks if this element type is supported by the engine.
    Converts this raw element into a processed BlueprintElement.
    @NotNull String
    Returns the type identifier of this element (e.g., "cube", "locator").
    @NotNull String
    Returns the unique identifier (UUID) of this element.
  • Field Details

    • NULL_OBJECT

      static final String NULL_OBJECT
      The type identifier for a null object element.
      Since:
      2.2.1
      See Also:
    • LOCATOR

      static final String LOCATOR
      The type identifier for a locator element.
      Since:
      2.2.1
      See Also:
    • CAMERA

      static final String CAMERA
      The type identifier for a camera element.
      Since:
      2.2.1
      See Also:
    • CUBE

      static final String CUBE
      The type identifier for a cube element.
      Since:
      2.2.1
      See Also:
    • MESH

      static final String MESH
      The type identifier for a mesh element.
      Since:
      3.0.0
      See Also:
    • PARSER

      static final com.google.gson.JsonDeserializer<ModelElement> PARSER
      A JSON deserializer that automatically dispatches to the correct ModelElement implementation based on the "type" field.
      Since:
      1.15.2
  • Method Details

    • uuid

      @NotNull @NotNull String uuid()
      Returns the unique identifier (UUID) of this element.
      Returns:
      the UUID string
      Since:
      1.15.2
    • type

      @NotNull @NotNull String type()
      Returns the type identifier of this element (e.g., "cube", "locator").
      Returns:
      the type string
      Since:
      1.15.2
    • toBlueprint

      @NotNull @NotNull BlueprintElement toBlueprint()
      Converts this raw element into a processed BlueprintElement.
      Returns:
      the blueprint element
      Since:
      1.15.2
    • isSupported

      default boolean isSupported()
      Checks if this element type is supported by the engine.
      Returns:
      true if supported, false otherwise
      Since:
      1.15.2