public class ModelBakery
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected RegistrySimple<ModelResourceLocation,IBakedModel> |
bakedRegistry |
private java.util.Map<ResourceLocation,ModelBlockDefinition> |
blockDefinitions |
protected BlockModelShapes |
blockModelShapes |
private static java.util.Map<java.lang.String,java.lang.String> |
BUILT_IN_MODELS |
private static java.util.Map<IRegistryDelegate<Item>,java.util.Set<java.lang.String>> |
customVariantNames |
private static java.lang.String |
EMPTY_MODEL_RAW |
private FaceBakery |
faceBakery |
private java.util.Map<java.lang.String,ResourceLocation> |
itemLocations |
private ItemModelGenerator |
itemModelGenerator |
private static com.google.common.base.Joiner |
JOINER |
protected static java.util.Set<ResourceLocation> |
LOCATIONS_BUILTIN_TEXTURES |
private static org.apache.logging.log4j.Logger |
LOGGER |
private static java.lang.String |
MISSING_MODEL_MESH |
protected static ModelBlock |
MODEL_ENTITY |
protected static ModelBlock |
MODEL_GENERATED |
static ModelResourceLocation |
MODEL_MISSING |
private java.util.Map<ResourceLocation,ModelBlock> |
models |
private java.util.Map<ModelBlockDefinition,java.util.Collection<ModelResourceLocation>> |
multipartVariantMap |
protected IResourceManager |
resourceManager |
protected java.util.Map<ResourceLocation,TextureAtlasSprite> |
sprites |
protected TextureMap |
textureMap |
private java.util.Map<Item,java.util.List<java.lang.String>> |
variantNames |
private java.util.Map<ModelResourceLocation,VariantList> |
variants |
Constructor and Description |
---|
ModelBakery(IResourceManager resourceManagerIn,
TextureMap textureMapIn,
BlockModelShapes blockModelShapesIn) |
protected static final java.util.Set<ResourceLocation> LOCATIONS_BUILTIN_TEXTURES
private static final org.apache.logging.log4j.Logger LOGGER
public static final ModelResourceLocation MODEL_MISSING
private static final java.lang.String MISSING_MODEL_MESH
private static final java.util.Map<java.lang.String,java.lang.String> BUILT_IN_MODELS
private static final com.google.common.base.Joiner JOINER
protected final IResourceManager resourceManager
protected final java.util.Map<ResourceLocation,TextureAtlasSprite> sprites
private final java.util.Map<ResourceLocation,ModelBlock> models
private final java.util.Map<ModelResourceLocation,VariantList> variants
private final java.util.Map<ModelBlockDefinition,java.util.Collection<ModelResourceLocation>> multipartVariantMap
protected final TextureMap textureMap
protected final BlockModelShapes blockModelShapes
private final FaceBakery faceBakery
private final ItemModelGenerator itemModelGenerator
protected final RegistrySimple<ModelResourceLocation,IBakedModel> bakedRegistry
private static final java.lang.String EMPTY_MODEL_RAW
protected static final ModelBlock MODEL_GENERATED
protected static final ModelBlock MODEL_ENTITY
private final java.util.Map<java.lang.String,ResourceLocation> itemLocations
private final java.util.Map<ResourceLocation,ModelBlockDefinition> blockDefinitions
private final java.util.Map<Item,java.util.List<java.lang.String>> variantNames
private static java.util.Map<IRegistryDelegate<Item>,java.util.Set<java.lang.String>> customVariantNames
public ModelBakery(IResourceManager resourceManagerIn, TextureMap textureMapIn, BlockModelShapes blockModelShapesIn)
public IRegistry<ModelResourceLocation,IBakedModel> setupModelRegistry()
protected void loadBlocks()
protected void loadBlock(BlockStateMapper blockstatemapper, Block block, ResourceLocation resourcelocation)
protected void loadVariantItemModels()
private void loadStaticModels()
protected void registerVariant(ModelBlockDefinition blockstateDefinition, ModelResourceLocation location)
protected ModelBlockDefinition getModelBlockDefinition(ResourceLocation location)
private ModelBlockDefinition loadMultipartMBD(ResourceLocation location, ResourceLocation fileIn)
private ModelBlockDefinition loadModelBlockDefinition(ResourceLocation location, IResource resource)
private ResourceLocation getBlockstateLocation(ResourceLocation location)
protected void loadVariantModels()
protected void loadMultipartVariantModels()
protected void loadVariantList(ModelResourceLocation p_188638_1_, VariantList p_188638_2_)
protected ModelBlock loadModel(ResourceLocation location) throws java.io.IOException
java.io.IOException
protected ResourceLocation getModelLocation(ResourceLocation location)
protected void loadItemModels()
private void loadItemModel(java.lang.String variantName, ResourceLocation location, ResourceLocation itemName)
protected void registerVariantNames()
protected java.util.List<java.lang.String> getVariantNames(Item stack)
protected ResourceLocation getItemLocation(java.lang.String location)
private void bakeBlockModels()
@Nullable private IBakedModel createRandomModelForVariantList(VariantList variantsIn, java.lang.String modelLocation)
private void bakeItemModels()
private java.util.Set<ResourceLocation> getVariantsTextureLocations()
@Nullable private IBakedModel bakeModel(ModelBlock modelBlockIn, ModelRotation modelRotationIn, boolean uvLocked)
protected IBakedModel bakeModel(ModelBlock modelBlockIn, ITransformation modelRotationIn, boolean uvLocked)
private BakedQuad makeBakedQuad(BlockPart p_177589_1_, BlockPartFace p_177589_2_, TextureAtlasSprite p_177589_3_, EnumFacing p_177589_4_, ModelRotation p_177589_5_, boolean p_177589_6_)
protected BakedQuad makeBakedQuad(BlockPart p_177589_1_, BlockPartFace p_177589_2_, TextureAtlasSprite p_177589_3_, EnumFacing p_177589_4_, ITransformation p_177589_5_, boolean p_177589_6_)
private void loadModelsCheck()
private void loadModels()
private void addModelParentLocation(java.util.Deque<ResourceLocation> p_188633_1_, java.util.Set<ResourceLocation> p_188633_2_, ModelBlock p_188633_3_)
private java.util.List<ResourceLocation> getParentPath(ResourceLocation p_177573_1_)
@Nullable private ResourceLocation getParentLocation(ResourceLocation p_177576_1_)
protected java.util.Set<ResourceLocation> getTextureLocations(ModelBlock p_177585_1_)
private void loadSprites()
private java.util.Set<ResourceLocation> getItemsTextureLocations()
protected boolean hasItemModel(@Nullable ModelBlock p_177581_1_)
protected boolean isCustomRenderer(@Nullable ModelBlock p_177587_1_)
private void makeItemModels()
protected ModelBlock makeItemModel(ModelBlock p_177582_1_)
protected void registerMultipartVariant(ModelBlockDefinition definition, java.util.Collection<ModelResourceLocation> locations)
public static void registerItemVariants(Item item, ResourceLocation... names)