Package dan200.computercraft.api.client
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
ConstructorsConstructorDescriptionTransformedModel(net.minecraft.client.resources.model.BakedModel model) TransformedModel(net.minecraft.client.resources.model.BakedModel model, com.mojang.math.Transformation matrix) Creates an instance of aTransformedModelrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.com.mojang.math.Transformationmatrix()Returns the value of thematrixrecord component.net.minecraft.client.resources.model.BakedModelmodel()Returns the value of themodelrecord component.static TransformedModelof(ModelLocation location) Look up a model in the model bakery and construct aTransformedModelwith no transformation.static TransformedModelof(net.minecraft.client.resources.model.ModelResourceLocation location) Look up a model in the model bakery and construct aTransformedModelwith no transformation.static TransformedModelof(net.minecraft.resources.ResourceLocation location) Look up a model in the model bakery and construct aTransformedModelwith no transformation.static TransformedModelof(net.minecraft.world.item.ItemStack item, com.mojang.math.Transformation transform) final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TransformedModel
public TransformedModel(net.minecraft.client.resources.model.BakedModel model) -
TransformedModel
public TransformedModel(net.minecraft.client.resources.model.BakedModel model, com.mojang.math.Transformation matrix) Creates an instance of aTransformedModelrecord class.
-
-
Method Details
-
of
Look up a model in the model bakery and construct aTransformedModelwith no transformation.- Parameters:
location- The location of the model to load.- Returns:
- The new
TransformedModelinstance.
-
of
public static TransformedModel of(net.minecraft.client.resources.model.ModelResourceLocation location) Look up a model in the model bakery and construct aTransformedModelwith no transformation.- Parameters:
location- The location of the model to load.- Returns:
- The new
TransformedModelinstance. - See Also:
-
of
Look up a model in the model bakery and construct aTransformedModelwith no transformation.- Parameters:
location- The location of the model to load.- Returns:
- The new
TransformedModelinstance. - See Also:
-
of
public static TransformedModel of(net.minecraft.world.item.ItemStack item, com.mojang.math.Transformation transform) -
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
model
public net.minecraft.client.resources.model.BakedModel model()Returns the value of themodelrecord component.- Returns:
- the value of the
modelrecord component
-
matrix
public com.mojang.math.Transformation matrix()Returns the value of thematrixrecord component.- Returns:
- the value of the
matrixrecord component
-