Package net.minecraftforge.client.model
Class BlockModelConfiguration
java.lang.Object
net.minecraftforge.client.model.BlockModelConfiguration
- All Implemented Interfaces:
IModelConfiguration
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbake(ModelBakery bakery, Function<Material,TextureAtlasSprite> bakedTextureGetter, ModelState modelTransform, ItemOverrides overrides, ResourceLocation modelLocation)
void
copyFrom(BlockModelConfiguration other)
Gets the vanilla camera transforms data.If available, gets the owning model (usually BlockModel) of this configurationboolean
getPartVisibility(IModelGeometryPart part, boolean fallback)
Queries the visibility information for the model parts.getTextureDependencies(Function<ResourceLocation,UnbakedModel> modelGetter, Set<com.mojang.datafixers.util.Pair<String,String>> missingTextureErrors)
boolean
boolean
boolean
boolean
isTexturePresent(String name)
Checks if a texture is present in the model.resolveTexture(String name)
Resolves the final texture name, taking into account texture aliases and replacements.void
setCustomGeometry(IModelGeometry<?> geometry)
void
setCustomModelState(ModelState modelState)
boolean
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraftforge.client.model.IModelConfiguration
getPartVisibility
-
Field Details
-
owner
-
visibilityData
-
customGeometry
-
customModelState
-
-
Constructor Details
-
BlockModelConfiguration
-
-
Method Details
-
getOwnerModel
Description copied from interface:IModelConfiguration
If available, gets the owning model (usually BlockModel) of this configuration- Specified by:
getOwnerModel
in interfaceIModelConfiguration
-
getModelName
- Specified by:
getModelName
in interfaceIModelConfiguration
- Returns:
- The name of the model being baked, for logging and cache purposes.
-
hasCustomGeometry
public boolean hasCustomGeometry() -
getCustomGeometry
-
setCustomGeometry
-
getCustomModelState
-
setCustomModelState
-
getPartVisibility
Description copied from interface:IModelConfiguration
Queries the visibility information for the model parts.- Specified by:
getPartVisibility
in interfaceIModelConfiguration
- Parameters:
part
- A part for which to query visibility.fallback
- A boolean specifying the default visibility if an override isn't found in the model data.- Returns:
- The final computed visibility.
-
isTexturePresent
Description copied from interface:IModelConfiguration
Checks if a texture is present in the model.- Specified by:
isTexturePresent
in interfaceIModelConfiguration
- Parameters:
name
- The name of a texture channel.
-
resolveTexture
Description copied from interface:IModelConfiguration
Resolves the final texture name, taking into account texture aliases and replacements.- Specified by:
resolveTexture
in interfaceIModelConfiguration
- Parameters:
name
- The name of a texture channel.- Returns:
- The location of the texture, or the missing texture if not found.
-
isShadedInGui
public boolean isShadedInGui()- Specified by:
isShadedInGui
in interfaceIModelConfiguration
- Returns:
- True if the item is a 3D model, false if it's a generated item model. TODO: Rename. This value has nothing to do with shading anymore, and this name is misleading. It's actual purpose seems to be relegated to translating the model during rendering, so that it's centered.
-
isSideLit
public boolean isSideLit()- Specified by:
isSideLit
in interfaceIModelConfiguration
- Returns:
- True if the item is lit from the side
-
useSmoothLighting
public boolean useSmoothLighting()- Specified by:
useSmoothLighting
in interfaceIModelConfiguration
- Returns:
- True if the item requires per-vertex lighting.
-
getCameraTransforms
Description copied from interface:IModelConfiguration
Gets the vanilla camera transforms data. Do not use for non-vanilla code. For general usage, prefer getCombinedState.- Specified by:
getCameraTransforms
in interfaceIModelConfiguration
-
getCombinedTransform
- Specified by:
getCombinedTransform
in interfaceIModelConfiguration
- Returns:
- The combined transformation state including vanilla and forge transforms data.
-
copyFrom
-
getTextureDependencies
public Collection<Material> getTextureDependencies(Function<ResourceLocation,UnbakedModel> modelGetter, Set<com.mojang.datafixers.util.Pair<String,String>> missingTextureErrors) -
bake
public BakedModel bake(ModelBakery bakery, Function<Material,TextureAtlasSprite> bakedTextureGetter, ModelState modelTransform, ItemOverrides overrides, ResourceLocation modelLocation)
-