Package dan200.computercraft.api.client
Class ModelLocation
java.lang.Object
dan200.computercraft.api.client.ModelLocation
The location of a model to load. This may either be:
- A
ModelResourceLocation
, referencing an already baked model (such asminecraft:dirt#inventory
). -
A
ResourceLocation
, referencing a path to a model resource (such asminecraft:item/dirt
. These models will be baked and stored in theModelManager
in a loader-specific way.
-
Method Summary
Modifier and TypeMethodDescriptionStream
<net.minecraft.resources.ResourceLocation> Get the models this model location depends on.net.minecraft.client.resources.model.BakedModel
getModel
(net.minecraft.client.resources.model.ModelManager manager) Get this model from the provided model manager.static ModelLocation
ofModel
(net.minecraft.client.resources.model.ModelResourceLocation location) Create aModelLocation
from model in the model manager.static ModelLocation
ofResource
(net.minecraft.resources.ResourceLocation location) Create aModelLocation
from a resource.
-
Method Details
-
ofModel
public static ModelLocation ofModel(net.minecraft.client.resources.model.ModelResourceLocation location) Create aModelLocation
from model in the model manager.- Parameters:
location
- The name of the model to load.- Returns:
- The new
ModelLocation
instance.
-
ofResource
Create aModelLocation
from a resource.- Parameters:
location
- The location of the model resource, such asminecraft: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
Get the models this model location depends on.- Returns:
- A list of models that this model location depends on.
- See Also:
-