Class ModelLocation

java.lang.Object
dan200.computercraft.api.client.ModelLocation

public final class ModelLocation extends Object
The location of a model to load. This may either be:
  • A ModelResourceLocation, referencing an already baked model (such as minecraft:dirt#inventory).
  • A ResourceLocation, referencing a path to a model resource (such as minecraft:item/dirt. These models will be baked and stored in the ModelManager in a loader-specific way.
  • Method Details

    • ofModel

      public static ModelLocation ofModel(net.minecraft.client.resources.model.ModelResourceLocation location)
      Create a ModelLocation from model in the model manager.
      Parameters:
      location - The name of the model to load.
      Returns:
      The new ModelLocation instance.
    • ofResource

      public static ModelLocation ofResource(net.minecraft.resources.ResourceLocation location)
      Create a ModelLocation from a resource.
      Parameters:
      location - The location of the model resource, such as minecraft:item/dirt.
      Returns:
      The new ModelLocation instance.
    • getModel

      public net.minecraft.client.resources.model.BakedModel getModel(net.minecraft.client.resources.model.ModelManager manager)
      Get this model from the provided model manager.
      Parameters:
      manager - The model manger.
      Returns:
      This model, or the missing model if it could not be found.
    • getDependencies

      public Stream<net.minecraft.resources.ResourceLocation> getDependencies()
      Get the models this model location depends on.
      Returns:
      A list of models that this model location depends on.
      See Also: