Package net.minecraftforge.client.model
Class BlockModelConfiguration
java.lang.Object
net.minecraftforge.client.model.BlockModelConfiguration
- All Implemented Interfaces:
IModelConfiguration
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbake(ModelBakery bakery, Function<Material, TextureAtlasSprite> bakedTextureGetter, ModelState modelTransform, ItemOverrides overrides, ResourceLocation modelLocation) voidcopyFrom(BlockModelConfiguration other) Gets the vanilla camera transforms data.If available, gets the owning model (usually BlockModel) of this configurationbooleangetPartVisibility(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) booleanbooleanbooleanbooleanisTexturePresent(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.voidsetCustomGeometry(IModelGeometry<?> geometry) voidsetCustomModelState(ModelState modelState) booleanMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:IModelConfigurationIf available, gets the owning model (usually BlockModel) of this configuration- Specified by:
getOwnerModelin interfaceIModelConfiguration
-
getModelName
- Specified by:
getModelNamein 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:IModelConfigurationQueries the visibility information for the model parts.- Specified by:
getPartVisibilityin 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:IModelConfigurationChecks if a texture is present in the model.- Specified by:
isTexturePresentin interfaceIModelConfiguration- Parameters:
name- The name of a texture channel.
-
resolveTexture
Description copied from interface:IModelConfigurationResolves the final texture name, taking into account texture aliases and replacements.- Specified by:
resolveTexturein 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:
isShadedInGuiin 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:
isSideLitin interfaceIModelConfiguration- Returns:
- True if the item is lit from the side
-
useSmoothLighting
public boolean useSmoothLighting()- Specified by:
useSmoothLightingin interfaceIModelConfiguration- Returns:
- True if the item requires per-vertex lighting.
-
getCameraTransforms
Description copied from interface:IModelConfigurationGets the vanilla camera transforms data. Do not use for non-vanilla code. For general usage, prefer getCombinedState.- Specified by:
getCameraTransformsin interfaceIModelConfiguration
-
getCombinedTransform
- Specified by:
getCombinedTransformin 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)
-