public final class ModelLoader extends ModelBakery
Modifier and Type | Class and Description |
---|---|
protected class |
ModelLoader.BakedModelCacheKey |
protected static class |
ModelLoader.VanillaLoader |
protected static class |
ModelLoader.VariantLoader |
static class |
ModelLoader.White
16x16 pure white sprite.
|
bakedRegistry, blockModelShapes, LOCATIONS_BUILTIN_TEXTURES, MODEL_ENTITY, MODEL_GENERATED, MODEL_MISSING, resourceManager, sprites, textureMap
Constructor and Description |
---|
ModelLoader(IResourceManager manager,
TextureMap map,
BlockModelShapes shapes) |
Modifier and Type | Method and Description |
---|---|
static java.util.function.Function<ResourceLocation,TextureAtlasSprite> |
defaultTextureGetter()
Get the default texture getter the models will be baked with.
|
static ModelResourceLocation |
getInventoryVariant(java.lang.String s)
Hooked from ModelBakery, allows using MRLs that don't end with "inventory" for items.
|
protected IModel |
getMissingModel() |
protected ModelBlockDefinition |
getModelBlockDefinition(ResourceLocation location) |
protected ResourceLocation |
getModelLocation(ResourceLocation model) |
boolean |
isLoading() |
protected void |
loadBlocks() |
protected void |
loadItemModels() |
protected void |
loadMultipartVariantModels() |
protected void |
loadVariantModels() |
void |
onPostBakeEvent(IRegistry<ModelResourceLocation,IBakedModel> modelRegistry)
Internal, do not use.
|
static void |
onRegisterAllBlocks(BlockModelShapes shapes)
Internal, do not use.
|
static void |
onRegisterItems(ItemModelMesher mesher)
Internal, do not use.
|
protected void |
registerMultipartVariant(ModelBlockDefinition definition,
java.util.Collection<ModelResourceLocation> locations) |
protected void |
registerVariant(ModelBlockDefinition definition,
ModelResourceLocation location) |
static void |
setBucketModelDefinition(Item item)
Helper method for registering all itemstacks for given item to map to universal bucket model.
|
static void |
setCustomMeshDefinition(Item item,
ItemMeshDefinition meshDefinition)
Adds generic ItemStack -> model variant logic.
|
static void |
setCustomModelResourceLocation(Item item,
int metadata,
ModelResourceLocation model)
Adds a simple mapping from Item + metadata to the model variant.
|
static void |
setCustomStateMapper(Block block,
IStateMapper mapper)
Adds a custom IBlockState -> model variant logic.
|
IRegistry<ModelResourceLocation,IBakedModel> |
setupModelRegistry() |
bakeModel, getItemLocation, getTextureLocations, getVariantNames, hasItemModel, isCustomRenderer, loadBlock, loadModel, loadVariantItemModels, loadVariantList, makeBakedQuad, makeItemModel, registerItemVariants, registerVariantNames
public ModelLoader(IResourceManager manager, TextureMap map, BlockModelShapes shapes)
public boolean isLoading()
@Nonnull public IRegistry<ModelResourceLocation,IBakedModel> setupModelRegistry()
setupModelRegistry
in class ModelBakery
protected void loadVariantModels()
loadVariantModels
in class ModelBakery
protected void loadMultipartVariantModels()
loadMultipartVariantModels
in class ModelBakery
protected void loadBlocks()
loadBlocks
in class ModelBakery
protected void registerVariant(@Nullable ModelBlockDefinition definition, ModelResourceLocation location)
registerVariant
in class ModelBakery
protected void registerMultipartVariant(ModelBlockDefinition definition, java.util.Collection<ModelResourceLocation> locations)
registerMultipartVariant
in class ModelBakery
protected ModelBlockDefinition getModelBlockDefinition(ResourceLocation location)
getModelBlockDefinition
in class ModelBakery
protected void loadItemModels()
loadItemModels
in class ModelBakery
public static ModelResourceLocation getInventoryVariant(java.lang.String s)
protected ResourceLocation getModelLocation(ResourceLocation model)
getModelLocation
in class ModelBakery
protected IModel getMissingModel()
public void onPostBakeEvent(IRegistry<ModelResourceLocation,IBakedModel> modelRegistry)
public static void setCustomStateMapper(Block block, IStateMapper mapper)
public static void onRegisterAllBlocks(BlockModelShapes shapes)
public static void setCustomModelResourceLocation(Item item, int metadata, ModelResourceLocation model)
public static void setCustomMeshDefinition(Item item, ItemMeshDefinition meshDefinition)
public static void setBucketModelDefinition(Item item)
public static void onRegisterItems(ItemModelMesher mesher)
public static java.util.function.Function<ResourceLocation,TextureAtlasSprite> defaultTextureGetter()