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 class
BlockModelConfiguration.VisibilityData
-
Field Summary
Fields Modifier and Type Field Description private IModelGeometry<?>
customGeometry
private IModelTransform
customModelState
BlockModel
owner
BlockModelConfiguration.VisibilityData
visibilityData
-
Constructor Summary
Constructors Constructor Description BlockModelConfiguration(BlockModel owner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IBakedModel
bake(ModelBakery bakery, java.util.function.Function<RenderMaterial,TextureAtlasSprite> bakedTextureGetter, IModelTransform modelTransform, ItemOverrideList overrides, ResourceLocation modelLocation)
void
copyFrom(BlockModelConfiguration other)
ItemCameraTransforms
getCameraTransforms()
Gets the vanilla camera transforms data.IModelTransform
getCombinedTransform()
IModelGeometry<?>
getCustomGeometry()
IModelTransform
getCustomModelState()
java.lang.String
getModelName()
IUnbakedModel
getOwnerModel()
If available, gets the owning model (usually BlockModel) of this configurationboolean
getPartVisibility(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)
boolean
hasCustomGeometry()
boolean
isShadedInGui()
boolean
isSideLit()
boolean
isTexturePresent(java.lang.String name)
Checks if a texture is present in the model.RenderMaterial
resolveTexture(java.lang.String name)
Resolves the final texture name, taking into account texture aliases and replacements.void
setCustomGeometry(IModelGeometry<?> geometry)
void
setCustomModelState(IModelTransform modelState)
boolean
useSmoothLighting()
-
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:IModelConfiguration
If available, gets the owning model (usually BlockModel) of this configuration- Specified by:
getOwnerModel
in interfaceIModelConfiguration
-
getModelName
public java.lang.String getModelName()
- Specified by:
getModelName
in 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: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
public boolean isTexturePresent(java.lang.String name)
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
public RenderMaterial resolveTexture(java.lang.String name)
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
public ItemCameraTransforms 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
public IModelTransform getCombinedTransform()
- Specified by:
getCombinedTransform
in 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)
-
-