Package net.minecraftforge.client.model
Class ModelLoader
java.lang.Object
net.minecraft.client.renderer.model.ModelBakery
net.minecraftforge.client.model.ModelLoader
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
16x16 pure white sprite.static final class
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final Function<ResourceLocation,
IUnbakedModel> Helper method for registering all itemstacks for given item to map to universal bucket model.private static ModelLoader
private boolean
private final Map<ResourceLocation,
Exception> private static final org.apache.logging.log4j.Logger
private IUnbakedModel
private static Set<ResourceLocation>
Fields inherited from class net.minecraft.client.renderer.model.ModelBakery
BANNER_BASE, BLOCK_ENTITY_MARKER, BREAKING_LOCATIONS, DESTROY_STAGES, DESTROY_TYPES, FIRE_0, FIRE_1, GENERATION_MARKER, LAVA_FLOW, MISSING_MODEL_LOCATION, MISSING_MODEL_MESH, NO_PATTERN_SHIELD, resourceManager, SHIELD_BASE, UNREFERENCED_TEXTURES, WATER_FLOW, WATER_OVERLAY
-
Constructor Summary
ConstructorDescriptionModelLoader
(IResourceManager manager, BlockColors colours, IProfiler profiler, int maxMipmapLevel) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Indicate to vanilla that it should load and bake the given model, even if no blocks or items use it.static Function<ResourceLocation,
IUnbakedModel> static Function<RenderMaterial,
TextureAtlasSprite> Get the default texture getter the models will be baked with.static ModelResourceLocation
Hooked from ModelBakery, allows using MRLs that don't end with "inventory" for items.protected IUnbakedModel
protected ResourceLocation
getModelLocation
(ResourceLocation model) getModelOrLogError
(ResourceLocation location, String error) Use this if you want the model, but need to log the error.getModelOrMissing
(ResourceLocation location) Use this if you don't care about the exception and want some model anyway.static ModelLoader
instance()
boolean
void
onPostBakeEvent
(Map<ResourceLocation, IBakedModel> modelRegistry) Internal, do not use.Methods inherited from class net.minecraft.client.renderer.model.ModelBakery
bake, getBakedModel, getBakedTopLevelModels, getModel, getModelGroups, getSpriteMap, loadBlockModel, processLoading, uploadTextures
-
Field Details
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
loadingExceptions
-
missingModel
-
isLoading
private boolean isLoading -
instance
-
specialModels
-
DEFAULT_MODEL_GETTER
Helper method for registering all itemstacks for given item to map to universal bucket model.
-
-
Constructor Details
-
ModelLoader
public ModelLoader(IResourceManager manager, BlockColors colours, IProfiler profiler, int maxMipmapLevel)
-
-
Method Details
-
instance
-
isLoading
public boolean isLoading() -
addSpecialModel
Indicate to vanilla that it should load and bake the given model, even if no blocks or items use it. This is useful if e.g. you have baked models only for entity renderers. Call duringModelRegistryEvent
- Parameters:
rl
- The model, eitherModelResourceLocation
to point to a blockstate variant, or plainResourceLocation
to point directly to a json in the models folder.
-
getSpecialModels
- Overrides:
getSpecialModels
in classModelBakery
-
getInventoryVariant
Hooked from ModelBakery, allows using MRLs that don't end with "inventory" for items. -
getModelLocation
-
getMissingModel
-
getModelOrMissing
Use this if you don't care about the exception and want some model anyway. -
getModelOrLogError
Use this if you want the model, but need to log the error. -
onPostBakeEvent
Internal, do not use. -
defaultTextureGetter
Get the default texture getter the models will be baked with. -
defaultModelGetter
-