public final class ModelLoader extends ModelBakery
Modifier and Type | Class and Description |
---|---|
protected class |
ModelLoader.BakedModelCacheKey |
private static class |
ModelLoader.DefaultTextureGetter |
private static class |
ModelLoader.ItemLoadingException |
private static class |
ModelLoader.MultipartModel |
protected static class |
ModelLoader.VanillaLoader |
private class |
ModelLoader.VanillaModelWrapper |
protected static class |
ModelLoader.VariantLoader |
private static class |
ModelLoader.WeightedRandomModel |
static class |
ModelLoader.White
16x16 pure white sprite.
|
Modifier and Type | Field and Description |
---|---|
private static java.util.Map<IRegistryDelegate<Item>,ItemMeshDefinition> |
customMeshDefinitions |
private static java.util.Map<org.apache.commons.lang3.tuple.Pair<IRegistryDelegate<Item>,java.lang.Integer>,ModelResourceLocation> |
customModels |
private static java.util.Map<IRegistryDelegate<Block>,IStateMapper> |
customStateMappers |
private boolean |
enableVerboseMissingInfo |
private boolean |
isLoading |
private java.util.Map<ResourceLocation,java.lang.Exception> |
loadingExceptions |
private IModel |
missingModel |
private java.util.Set<ModelResourceLocation> |
missingVariants |
private java.util.Map<ModelResourceLocation,ModelBlockDefinition> |
multipartDefinitions |
private java.util.Map<ModelBlockDefinition,IModel> |
multipartModels |
private java.util.Map<ModelResourceLocation,IModel> |
stateModels |
private int |
verboseMissingInfoCount |
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() |
private void |
storeException(ResourceLocation location,
java.lang.Exception exception) |
bakeModel, getItemLocation, getTextureLocations, getVariantNames, hasItemModel, isCustomRenderer, loadBlock, loadModel, loadVariantItemModels, loadVariantList, makeBakedQuad, makeItemModel, registerItemVariants, registerVariantNames
private final java.util.Map<ModelResourceLocation,IModel> stateModels
private final java.util.Map<ModelResourceLocation,ModelBlockDefinition> multipartDefinitions
private final java.util.Map<ModelBlockDefinition,IModel> multipartModels
private final java.util.Set<ModelResourceLocation> missingVariants
private final java.util.Map<ResourceLocation,java.lang.Exception> loadingExceptions
private IModel missingModel
private boolean isLoading
private final boolean enableVerboseMissingInfo
private final int verboseMissingInfoCount
private static final java.util.Map<IRegistryDelegate<Block>,IStateMapper> customStateMappers
private static final java.util.Map<IRegistryDelegate<Item>,ItemMeshDefinition> customMeshDefinitions
private static final java.util.Map<org.apache.commons.lang3.tuple.Pair<IRegistryDelegate<Item>,java.lang.Integer>,ModelResourceLocation> customModels
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
private void storeException(ResourceLocation location, java.lang.Exception exception)
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()