Record Class TransformedModel

java.lang.Object
java.lang.Record
dan200.computercraft.api.client.TransformedModel
Record Components:
model - The model.
matrix - The transformation matrix.

public record TransformedModel(net.minecraft.client.resources.model.BakedModel model, com.mojang.math.Transformation matrix) extends Record
A model to render, combined with a transformation matrix to apply.
  • Constructor Summary Link icon

    Constructors
    Constructor
    Description
    TransformedModel(net.minecraft.client.resources.model.BakedModel model)
     
    TransformedModel(net.minecraft.client.resources.model.BakedModel model, com.mojang.math.Transformation matrix)
    Creates an instance of a TransformedModel record class.
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    com.mojang.math.Transformation
    Returns the value of the matrix record component.
    net.minecraft.client.resources.model.BakedModel
    Returns the value of the model record component.
    of(ModelLocation location)
    Look up a model in the model bakery and construct a TransformedModel with no transformation.
    of(net.minecraft.client.resources.model.ModelResourceLocation location)
    Look up a model in the model bakery and construct a TransformedModel with no transformation.
    of(net.minecraft.resources.ResourceLocation location)
    Look up a model in the model bakery and construct a TransformedModel with no transformation.
    of(net.minecraft.world.item.ItemStack item, com.mojang.math.Transformation transform)
     
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object Link icon

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

    • TransformedModel Link icon

      public TransformedModel(net.minecraft.client.resources.model.BakedModel model)
    • TransformedModel Link icon

      public TransformedModel(net.minecraft.client.resources.model.BakedModel model, com.mojang.math.Transformation matrix)
      Creates an instance of a TransformedModel record class.
      Parameters:
      model - the value for the model record component
      matrix - the value for the matrix record component
  • Method Details Link icon

    • of Link icon

      public static TransformedModel of(ModelLocation location)
      Look up a model in the model bakery and construct a TransformedModel with no transformation.
      Parameters:
      location - The location of the model to load.
      Returns:
      The new TransformedModel instance.
    • of Link icon

      public static TransformedModel of(net.minecraft.client.resources.model.ModelResourceLocation location)
      Look up a model in the model bakery and construct a TransformedModel with no transformation.
      Parameters:
      location - The location of the model to load.
      Returns:
      The new TransformedModel instance.
      See Also:
    • of Link icon

      public static TransformedModel of(net.minecraft.resources.ResourceLocation location)
      Look up a model in the model bakery and construct a TransformedModel with no transformation.
      Parameters:
      location - The location of the model to load.
      Returns:
      The new TransformedModel instance.
      See Also:
    • of Link icon

      public static TransformedModel of(net.minecraft.world.item.ItemStack item, com.mojang.math.Transformation transform)
    • toString Link icon

      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 Link icon

      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 Link icon

      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.
    • model Link icon

      public net.minecraft.client.resources.model.BakedModel model()
      Returns the value of the model record component.
      Returns:
      the value of the model record component
    • matrix Link icon

      public com.mojang.math.Transformation matrix()
      Returns the value of the matrix record component.
      Returns:
      the value of the matrix record component