Class WeightedBakedModel
java.lang.Object
net.minecraft.client.resources.model.WeightedBakedModel
- All Implemented Interfaces:
BakedModel
,IBakedModelExtension
,IDynamicBakedModel
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate final List
<WeightedEntry.Wrapper<BakedModel>> private final int
private final BakedModel
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionapplyTransform
(ItemDisplayContext transformType, PoseStack poseStack, boolean applyLeftHandTransform) Applies a transform for the giveninvalid reference
ItemTransforms.TransformType
applyLeftHandTransform
, and returns the model to be rendered.getParticleIcon
(ModelData modelData) getQuads
(BlockState p_235058_, Direction p_235059_, RandomSource p_235060_, ModelData modelData, RenderType renderType) A nullRenderType
is used for the breaking overlay as well as non-standard rendering, so models should return all their quads.getRenderTypes
(@NotNull BlockState state, @NotNull 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 modelData, RenderType renderType) Controls the AO behavior for all quads of this model.boolean
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.neoforged.neoforge.client.extensions.IBakedModelExtension
getModelData, getRenderPasses, getRenderTypes
Methods inherited from interface net.neoforged.neoforge.client.model.IDynamicBakedModel
getQuads
-
Field Details
-
totalWeight
private final int totalWeight -
list
-
wrapped
-
-
Constructor Details
-
WeightedBakedModel
-
-
Method Details
-
getQuads
public List<BakedQuad> getQuads(@Nullable BlockState p_235058_, @Nullable Direction p_235059_, RandomSource p_235060_, ModelData modelData, @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
- Specified by:
getQuads
in interfaceIDynamicBakedModel
-
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 formodelData
- 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
-
getParticleIcon
- Specified by:
getParticleIcon
in interfaceIBakedModelExtension
-
getTransforms
- Specified by:
getTransforms
in interfaceBakedModel
-
applyTransform
public BakedModel applyTransform(ItemDisplayContext transformType, 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
-
getRenderTypes
public ChunkRenderTypeSet getRenderTypes(@NotNull @NotNull BlockState state, @NotNull @NotNull RandomSource rand, @NotNull ModelData data) 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
-
getOverrides
- Specified by:
getOverrides
in interfaceBakedModel
-