Class BlockGeometryBakingContext
java.lang.Object
net.minecraftforge.client.model.geometry.BlockGeometryBakingContext
- All Implemented Interfaces:
IGeometryBakingContext
A geometry baking context that is bound to a
BlockModel
.
Users should not be instantiating this themselves.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate @Nullable IUnbakedGeometry<?>
private boolean
final BlockModel
private @Nullable ResourceLocation
private @Nullable Transformation
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbake
(ModelBakery bakery, Function<Material, TextureAtlasSprite> bakedTextureGetter, ModelState modelTransform, ItemOverrides overrides, ResourceLocation modelLocation) void
@Nullable IUnbakedGeometry<?>
getMaterial
(String name) Resolves the final texture name, taking into account texture aliases and replacements.Returns the name of the model being baked for logging and caching purposes..@Nullable ResourceLocation
Returns a hint of the render type this model should use. Custom loaders may ignore this..Returns the root transformation to be applied to all variants of this model, regardless of item transforms..getTextureDependencies
(Function<ResourceLocation, UnbakedModel> modelGetter, Set<com.mojang.datafixers.util.Pair<String, String>> missingTextureErrors) Returns the transforms for display in item form..boolean
boolean
hasMaterial
(String name) Checks if a material is present in the model.boolean
isComponentVisible
(String part, boolean fallback) Queries the visibility of a component of this model.boolean
isGui3d()
Returns true if this model should render in 3D in a GUI, false otherwise.void
setCustomGeometry
(IUnbakedGeometry<?> geometry) void
setGui3d
(boolean gui3d) void
setRenderTypeHint
(ResourceLocation renderTypeHint) void
setRootTransform
(Transformation rootTransform) boolean
Returns true if per-vertex ambient occlusion should be used for this model, false otherwise.boolean
Returns true if block lighting should be used for this model, false otherwise.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.geometry.IGeometryBakingContext
getRenderType
-
Field Details
-
owner
-
visibilityData
-
customGeometry
-
rootTransform
-
renderTypeHint
-
gui3d
private boolean gui3d
-
-
Constructor Details
-
BlockGeometryBakingContext
-
-
Method Details
-
getModelName
Description copied from interface:IGeometryBakingContext
Returns the name of the model being baked for logging and caching purposes..- Specified by:
getModelName
in interfaceIGeometryBakingContext
- Returns:
- the name of the model being baked for logging and caching purposes.
-
hasCustomGeometry
public boolean hasCustomGeometry() -
getCustomGeometry
-
setCustomGeometry
-
isComponentVisible
Description copied from interface:IGeometryBakingContext
Queries the visibility of a component of this model.- Specified by:
isComponentVisible
in interfaceIGeometryBakingContext
- Parameters:
part
- The component for which to query visibilityfallback
- The default visibility if an override isn't found- Returns:
- The visibility of the component
-
hasMaterial
Description copied from interface:IGeometryBakingContext
Checks if a material is present in the model.- Specified by:
hasMaterial
in interfaceIGeometryBakingContext
- Parameters:
name
- The name of the material- Returns:
- true if the material is present, false otherwise
-
getMaterial
Description copied from interface:IGeometryBakingContext
Resolves the final texture name, taking into account texture aliases and replacements.- Specified by:
getMaterial
in interfaceIGeometryBakingContext
- Parameters:
name
- The name of the material- Returns:
- The material, or the missing texture if not found
-
isGui3d
public boolean isGui3d()Description copied from interface:IGeometryBakingContext
Returns true if this model should render in 3D in a GUI, false otherwise.- Specified by:
isGui3d
in interfaceIGeometryBakingContext
- Returns:
- true if this model should render in 3D in a GUI, false otherwise
-
useBlockLight
public boolean useBlockLight()Description copied from interface:IGeometryBakingContext
Returns true if block lighting should be used for this model, false otherwise.- Specified by:
useBlockLight
in interfaceIGeometryBakingContext
- Returns:
- true if block lighting should be used for this model, false otherwise
-
useAmbientOcclusion
public boolean useAmbientOcclusion()Description copied from interface:IGeometryBakingContext
Returns true if per-vertex ambient occlusion should be used for this model, false otherwise.- Specified by:
useAmbientOcclusion
in interfaceIGeometryBakingContext
- Returns:
- true if per-vertex ambient occlusion should be used for this model, false otherwise
-
getTransforms
Description copied from interface:IGeometryBakingContext
Returns the transforms for display in item form..- Specified by:
getTransforms
in interfaceIGeometryBakingContext
- Returns:
- the transforms for display in item form.
-
getRootTransform
Description copied from interface:IGeometryBakingContext
Returns the root transformation to be applied to all variants of this model, regardless of item transforms..- Specified by:
getRootTransform
in interfaceIGeometryBakingContext
- Returns:
- the root transformation to be applied to all variants of this model, regardless of item transforms.
-
setRootTransform
-
getRenderTypeHint
Description copied from interface:IGeometryBakingContext
Returns a hint of the render type this model should use. Custom loaders may ignore this..- Specified by:
getRenderTypeHint
in interfaceIGeometryBakingContext
- Returns:
- a hint of the render type this model should use. Custom loaders may ignore this.
-
setRenderTypeHint
-
setGui3d
public void setGui3d(boolean gui3d) -
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)
-