Interface ModelElement

All Known Implementing Classes:
ModelElement.Camera, ModelElement.Cube, ModelElement.Locator, 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 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 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

    • 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