Class Material

All Implemented Interfaces:
ICustomPropertyProvider

public class Material extends CustomPropertyProvider
Describes the physical material of an entity (e.g. WOOD, STONE). Materials are looked up by name and are typically used by the engine to drive damage and sound interactions. Custom materials can be created by instantiating this class.
  • Field Details

    • UNDEFINED

      public static final Material UNDEFINED
      Default fall-back material used when no specific material is assigned.
    • CERAMIC

      public static final Material CERAMIC
      Ceramic material.
    • FLESH

      public static final Material FLESH
      Flesh material.
    • FOLIAGE

      public static final Material FOLIAGE
      Foliage material.
    • PLASTIC

      public static final Material PLASTIC
      Plastic material.
    • STEEL

      public static final Material STEEL
      Steel material.
    • STONE

      public static final Material STONE
      Stone material.
    • WOOD

      public static final Material WOOD
      Wood material.
  • Constructor Details

    • Material

      public Material(String name)
      Initializes a new instance of the Material class.
      Parameters:
      name - The name of the material.
  • Method Details

    • get

      public static Material get(String name)
      Returns the material registered under the supplied name (case-insensitive), or UNDEFINED if no such material exists.
      Parameters:
      name - the material name
      Returns:
      the matching material, or UNDEFINED
    • getMaterials

      public static Collection<Material> getMaterials()
      Returns all registered materials, including any custom ones created at runtime.
      Returns:
      the registered materials
    • getName

      public String getName()
      Returns the display name of this material.
      Returns:
      the material name
    • toString

      public String toString()
      Overrides:
      toString in class Object