Package net.minecraftforge.client.model
Class BlockModelConfiguration
- java.lang.Object
-
- net.minecraftforge.client.model.BlockModelConfiguration
-
- All Implemented Interfaces:
IModelConfiguration
public class BlockModelConfiguration extends java.lang.Object implements IModelConfiguration
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBlockModelConfiguration.VisibilityData
-
Field Summary
Fields Modifier and Type Field Description private IModelGeometry<?>customGeometryprivate IModelTransformcustomModelStateBlockModelownerBlockModelConfiguration.VisibilityDatavisibilityData
-
Constructor Summary
Constructors Constructor Description BlockModelConfiguration(BlockModel owner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IBakedModelbake(ModelBakery bakery, java.util.function.Function<RenderMaterial,TextureAtlasSprite> bakedTextureGetter, IModelTransform modelTransform, ItemOverrideList overrides, ResourceLocation modelLocation)voidcopyFrom(BlockModelConfiguration other)ItemCameraTransformsgetCameraTransforms()Gets the vanilla camera transforms data.IModelTransformgetCombinedTransform()IModelGeometry<?>getCustomGeometry()IModelTransformgetCustomModelState()java.lang.StringgetModelName()IUnbakedModelgetOwnerModel()If available, gets the owning model (usually BlockModel) of this configurationbooleangetPartVisibility(IModelGeometryPart part, boolean fallback)Queries the visibility information for the model parts.java.util.Collection<RenderMaterial>getTextureDependencies(java.util.function.Function<ResourceLocation,IUnbakedModel> modelGetter, java.util.Set<com.mojang.datafixers.util.Pair<java.lang.String,java.lang.String>> missingTextureErrors)booleanhasCustomGeometry()booleanisShadedInGui()booleanisSideLit()booleanisTexturePresent(java.lang.String name)Checks if a texture is present in the model.RenderMaterialresolveTexture(java.lang.String name)Resolves the final texture name, taking into account texture aliases and replacements.voidsetCustomGeometry(IModelGeometry<?> geometry)voidsetCustomModelState(IModelTransform modelState)booleanuseSmoothLighting()-
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 Detail
-
owner
public final BlockModel owner
-
visibilityData
public final BlockModelConfiguration.VisibilityData visibilityData
-
customGeometry
@Nullable private IModelGeometry<?> customGeometry
-
customModelState
@Nullable private IModelTransform customModelState
-
-
Constructor Detail
-
BlockModelConfiguration
public BlockModelConfiguration(BlockModel owner)
-
-
Method Detail
-
getOwnerModel
@Nullable public IUnbakedModel getOwnerModel()
Description copied from interface:IModelConfigurationIf available, gets the owning model (usually BlockModel) of this configuration- Specified by:
getOwnerModelin interfaceIModelConfiguration
-
getModelName
public java.lang.String getModelName()
- Specified by:
getModelNamein interfaceIModelConfiguration- Returns:
- The name of the model being baked, for logging and cache purposes.
-
hasCustomGeometry
public boolean hasCustomGeometry()
-
getCustomGeometry
@Nullable public IModelGeometry<?> getCustomGeometry()
-
setCustomGeometry
public void setCustomGeometry(IModelGeometry<?> geometry)
-
getCustomModelState
@Nullable public IModelTransform getCustomModelState()
-
setCustomModelState
public void setCustomModelState(IModelTransform modelState)
-
getPartVisibility
public boolean getPartVisibility(IModelGeometryPart part, boolean fallback)
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
public boolean isTexturePresent(java.lang.String name)
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
public RenderMaterial resolveTexture(java.lang.String name)
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
public ItemCameraTransforms 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
public IModelTransform getCombinedTransform()
- Specified by:
getCombinedTransformin interfaceIModelConfiguration- Returns:
- The combined transformation state including vanilla and forge transforms data.
-
copyFrom
public void copyFrom(BlockModelConfiguration other)
-
getTextureDependencies
public java.util.Collection<RenderMaterial> getTextureDependencies(java.util.function.Function<ResourceLocation,IUnbakedModel> modelGetter, java.util.Set<com.mojang.datafixers.util.Pair<java.lang.String,java.lang.String>> missingTextureErrors)
-
bake
public IBakedModel bake(ModelBakery bakery, java.util.function.Function<RenderMaterial,TextureAtlasSprite> bakedTextureGetter, IModelTransform modelTransform, ItemOverrideList overrides, ResourceLocation modelLocation)
-
-