Package net.minecraftforge.client.model
Class ModelLoader
java.lang.Object
net.minecraft.client.resources.model.ModelBakery
net.minecraftforge.client.model.ModelLoader
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class16x16 pure white sprite.static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static Function<ResourceLocation,UnbakedModel>Helper method for registering all itemstacks for given item to map to universal bucket model.private static ModelLoaderprivate booleanprivate Map<ResourceLocation,Exception>private static org.apache.logging.log4j.Loggerprivate UnbakedModelprivate static Set<ResourceLocation>Fields inherited from class net.minecraft.client.resources.model.ModelBakery
BANNER_BASE, BLOCK_ENTITY_MARKER, BREAKING_LOCATIONS, DESTROY_STAGE_COUNT, 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
ConstructorsConstructorDescriptionModelLoader(ResourceManager manager, BlockColors colours, ProfilerFiller profiler, int maxMipmapLevel) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidIndicate to vanilla that it should load and bake the given model, even if no blocks or items use it.static Function<ResourceLocation,UnbakedModel>static Function<Material,TextureAtlasSprite>Get the default texture getter the models will be baked with.static ModelResourceLocationHooked from ModelBakery, allows using MRLs that don't end with "inventory" for items.protected UnbakedModelprotected ResourceLocationgetModelLocation(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 ModelLoaderinstance()booleanvoidonPostBakeEvent(Map<ResourceLocation,BakedModel> modelRegistry)Internal, do not use.Methods inherited from class net.minecraft.client.resources.model.ModelBakery
bake, bake, 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(ResourceManager manager, BlockColors colours, ProfilerFiller 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, eitherModelResourceLocationto point to a blockstate variant, or plainResourceLocationto point directly to a json in the models folder.
-
getSpecialModels
- Overrides:
getSpecialModelsin 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
-