Record Class ModelInfo

java.lang.Object
java.lang.Record
dev.oxydien.mathimations.model.ModelInfo
Record Components:
root - The main root of the model. This is the starting point for accessing other parts.
children - A list of strings representing the names of the children (accessible) within the model hierarchy. If a child part has sub-children, use a forward slash ("/") to separate their names. For example:
                      ["neck", "neck/head", "neck/head/left_ear", "neck/head/right_ear", "body"]
                  
The code will search for the names in sequence from left to right, so parent parts can be omitted if they are part of child definitions. For example:
                      ["neck/head/left_ear", "neck/head/right_ear", "body"] // neck and head are within ear definitions
                  

public record ModelInfo(net.minecraft.client.model.geom.ModelPart root, List<String> children) extends Record
Constructs a new ModelInfo object with the given root part and list of child names.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ModelInfo(net.minecraft.client.model.geom.ModelPart root, List<String> children)
    Creates an instance of a ModelInfo record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the children record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    getInfo(net.minecraft.client.model.geom.ModelPart root)
    Tries to construct a new ModelInfo object from the given root part.
     
    final int
    Returns a hash code value for this object.
    net.minecraft.client.model.geom.ModelPart
    Returns the value of the root record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ModelInfo

      public ModelInfo(net.minecraft.client.model.geom.ModelPart root, List<String> children)
      Creates an instance of a ModelInfo record class.
      Parameters:
      root - the value for the root record component
      children - the value for the children record component
  • Method Details

    • getInfo

      public static Optional<ModelInfo> getInfo(net.minecraft.client.model.geom.ModelPart root)
      Tries to construct a new ModelInfo object from the given root part.
      Parameters:
      root - The root part of the model
      Returns:
      A new ModelInfo object or an empty optional if the root part is null
    • getPartNames

      public Set<String> getPartNames()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • root

      public net.minecraft.client.model.geom.ModelPart root()
      Returns the value of the root record component.
      Returns:
      the value of the root record component
    • children

      public List<String> children()
      Returns the value of the children record component.
      Returns:
      the value of the children record component