Class BakedRenderable
java.lang.Object
net.minecraftforge.client.model.renderable.BakedRenderable
- All Implemented Interfaces:
IRenderable<IModelData>
Wrapper to make it easier to draw baked models in renderers.
-
Field Summary
Modifier and TypeFieldDescriptionprivate final BakedModel
private static final Direction[]
private final Random
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic BakedRenderable
of
(BakedModel model) Constructs a BakedRenderable from the given model.static BakedRenderable
of
(ResourceLocation model) Constructs a BakedRenderable from the given model location.void
render
(PoseStack poseStack, MultiBufferSource bufferSource, Function<ResourceLocation, RenderType> renderTypeFunction, int lightmapCoord, int overlayCoord, float partialTicks, IModelData renderValues) Draws the renderable by adding the geometry to the providedMultiBufferSource
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.renderable.IRenderable
withValues
-
Field Details
-
MODEL_FACINGS
-
rand
-
model
-
-
Constructor Details
-
BakedRenderable
-
-
Method Details
-
of
Constructs a BakedRenderable from the given model location. The model is expected to have been baked ahead of time. You can ensure the model is baked by callingForgeModelBakery.addSpecialModel(ResourceLocation)
from withinModelRegistryEvent
. -
of
Constructs a BakedRenderable from the given model. -
render
public void render(PoseStack poseStack, MultiBufferSource bufferSource, Function<ResourceLocation, RenderType> renderTypeFunction, int lightmapCoord, int overlayCoord, float partialTicks, IModelData renderValues) Description copied from interface:IRenderable
Draws the renderable by adding the geometry to the providedMultiBufferSource
- Specified by:
render
in interfaceIRenderable<IModelData>
- Parameters:
poseStack
- the pose stackbufferSource
- the target buffer source to dump the data intorenderTypeFunction
- a function that provides a RenderType for the given texturelightmapCoord
- the lightmap coordinates representing the current lighting conditions. SeeLightTexture
overlayCoord
- the overlay coordinates representing the current overlay status. SeeOverlayTexture
partialTicks
- the current time expressed in the fraction of a tick elapsed since the last client tick.renderValues
- the context data used for rendering
-