Class BakedModelWrapper<T extends BakedModel>
java.lang.Object
net.neoforged.neoforge.client.model.BakedModelWrapper<T>
- All Implemented Interfaces:
BakedModel
,IBakedModelExtension
- Direct Known Subclasses:
FullPotsAccessorDemo.ClientHandler.DioritePotModel
,MegaModelTest.TransformingModelWrapper
Wrapper for
BakedModel
which delegates all operations to its parent.
Useful for creating wrapper baked models which only override certain properties.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionapplyTransform
(ItemDisplayContext cameraTransformType, PoseStack poseStack, boolean applyLeftHandTransform) Applies a transform for the giveninvalid reference
ItemTransforms.TransformType
applyLeftHandTransform
, and returns the model to be rendered.getModelData
(BlockAndTintGetter level, BlockPos pos, BlockState state, ModelData modelData) getParticleIcon
(ModelData data) getQuads
(@Nullable BlockState state, @Nullable Direction side, RandomSource rand) getQuads
(@Nullable BlockState state, @Nullable Direction side, RandomSource rand, ModelData extraData, @Nullable RenderType renderType) A nullRenderType
is used for the breaking overlay as well as non-standard rendering, so models should return all their quads.getRenderPasses
(ItemStack itemStack, boolean fabulous) Gets an ordered list of baked models used to render this model as an item.getRenderTypes
(ItemStack itemStack, boolean fabulous) Gets an ordered list ofrender types
to use when drawing this item.getRenderTypes
(BlockState state, RandomSource rand, ModelData data) Gets the set ofrender types
to use when drawing this block in the level.boolean
boolean
isGui3d()
boolean
useAmbientOcclusion
(BlockState state, ModelData data, RenderType renderType) Controls the AO behavior for all quads of this model.boolean
-
Field Details
-
originalModel
-
-
Constructor Details
-
BakedModelWrapper
-
-
Method Details
-
getQuads
public List<BakedQuad> getQuads(@Nullable @Nullable BlockState state, @Nullable @Nullable Direction side, RandomSource rand) - Specified by:
getQuads
in interfaceBakedModel
-
useAmbientOcclusion
public boolean useAmbientOcclusion()- Specified by:
useAmbientOcclusion
in interfaceBakedModel
-
useAmbientOcclusion
Description copied from interface:IBakedModelExtension
Controls the AO behavior for all quads of this model. The default behavior is to use AO unless the block emits light,TriState.TRUE
andTriState.FALSE
force AO to be enabled and disabled respectively, regardless of the block emitting light or not.BakedQuad.hasAmbientOcclusion()
can be used to disable AO for a specific quad even if this method says otherwise.This method cannot force AO if the global smooth lighting video setting is disabled.
- Specified by:
useAmbientOcclusion
in interfaceIBakedModelExtension
- Parameters:
state
- the block state this model is being rendered fordata
- the model data used to render this modelrenderType
- the render type the model is being rendered with- Returns:
TriState.TRUE
to force-enable AO,TriState.FALSE
to force-disable AO orTriState.DEFAULT
to use vanilla AO behavior
-
isGui3d
public boolean isGui3d()- Specified by:
isGui3d
in interfaceBakedModel
-
usesBlockLight
public boolean usesBlockLight()- Specified by:
usesBlockLight
in interfaceBakedModel
-
isCustomRenderer
public boolean isCustomRenderer()- Specified by:
isCustomRenderer
in interfaceBakedModel
-
getParticleIcon
- Specified by:
getParticleIcon
in interfaceBakedModel
-
getTransforms
- Specified by:
getTransforms
in interfaceBakedModel
-
getOverrides
- Specified by:
getOverrides
in interfaceBakedModel
-
applyTransform
public BakedModel applyTransform(ItemDisplayContext cameraTransformType, PoseStack poseStack, boolean applyLeftHandTransform) Description copied from interface:IBakedModelExtension
Applies a transform for the giveninvalid reference
ItemTransforms.TransformType
applyLeftHandTransform
, and returns the model to be rendered.- Specified by:
applyTransform
in interfaceIBakedModelExtension
-
getParticleIcon
- Specified by:
getParticleIcon
in interfaceIBakedModelExtension
-
getQuads
public List<BakedQuad> getQuads(@Nullable @Nullable BlockState state, @Nullable @Nullable Direction side, RandomSource rand, ModelData extraData, @Nullable @Nullable RenderType renderType) Description copied from interface:IBakedModelExtension
A nullRenderType
is used for the breaking overlay as well as non-standard rendering, so models should return all their quads.- Specified by:
getQuads
in interfaceIBakedModelExtension
-
getModelData
public ModelData getModelData(BlockAndTintGetter level, BlockPos pos, BlockState state, ModelData modelData) - Specified by:
getModelData
in interfaceIBakedModelExtension
-
getRenderTypes
Description copied from interface:IBakedModelExtension
Gets the set ofrender types
to use when drawing this block in the level. Supported types are those returned byRenderType.chunkBufferLayers()
.By default, defers query to
ItemBlockRenderTypes
.- Specified by:
getRenderTypes
in interfaceIBakedModelExtension
-
getRenderTypes
Description copied from interface:IBakedModelExtension
Gets an ordered list ofrender types
to use when drawing this item. All render types using theDefaultVertexFormat.NEW_ENTITY
format are supported.This method will only be called on the models returned by
IBakedModelExtension.getRenderPasses(ItemStack, boolean)
.By default, defers query to
ItemBlockRenderTypes
.- Specified by:
getRenderTypes
in interfaceIBakedModelExtension
- See Also:
-
getRenderPasses
Description copied from interface:IBakedModelExtension
Gets an ordered list of baked models used to render this model as an item. Each of those models' render types will be queried viaIBakedModelExtension.getRenderTypes(ItemStack, boolean)
.By default, returns the model itself.
- Specified by:
getRenderPasses
in interfaceIBakedModelExtension
- See Also:
-