Interface PartBakedModelRenderer<T extends ModelRenderPart>
- All Superinterfaces:
PartRenderer<T>
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault List<net.minecraft.client.renderer.block.model.BakedQuad> getQuads(T part, @Nullable net.minecraft.core.Direction side, net.minecraft.util.RandomSource rand, net.neoforged.neoforge.client.model.data.ModelData data, @Nullable net.minecraft.client.renderer.RenderType renderType) Get the static quads for this part, this is synonymous toIBakedModelExtension.getQuads(BlockState, Direction, RandomSource, ModelData, RenderType)default voidrenderStatic(T part, @Nullable net.minecraft.client.renderer.RenderType layer, codechicken.lib.render.CCRenderState ccrs) Render the static, unmoving faces of this part into the world renderer.static <T extends ModelRenderPart>
PartBakedModelRenderer<T> simple()Returns a newPartBakedModelRenderer.Methods inherited from interface codechicken.multipart.api.part.render.PartRenderer
drawHighlight, renderBreaking, renderDynamic
-
Method Details
-
simple
Returns a newPartBakedModelRenderer. Use this when you don't require overriding any of the other methods provided byPartRenderer.- Returns:
- The
PartBakedModelRendererinstance.
-
getQuads
default List<net.minecraft.client.renderer.block.model.BakedQuad> getQuads(T part, @Nullable @Nullable net.minecraft.core.Direction side, net.minecraft.util.RandomSource rand, net.neoforged.neoforge.client.model.data.ModelData data, @Nullable @Nullable net.minecraft.client.renderer.RenderType renderType) Description copied from interface:PartRendererGet the static quads for this part, this is synonymous toIBakedModelExtension.getQuads(BlockState, Direction, RandomSource, ModelData, RenderType)This is method may be called on the chunk batching thread. World/state access should be performed in a thread-safe manner.
It is highly recommended that parts do some form of caching for the data returned here.
The current default implementation of this method delegates to
PartRenderer.renderStatic(T, net.minecraft.client.renderer.RenderType, codechicken.lib.render.CCRenderState)andPartRenderer.renderBreaking(T, codechicken.lib.render.CCRenderState). When these methods are removed, this method will turn into a no-op.- Specified by:
getQuadsin interfacePartRenderer<T extends ModelRenderPart>- Parameters:
part- The part quads are required for.side- The side of the model requesting quads. Non-null sides will be culled if they are occluded.nullfor un-culled.rand- TheRandomSourcefor this block position.data- AnyModelDatathis part has provided viaMultiPart.getModelData().renderType- TheRenderTypepass.nullis used for breaking overlay and other special rendering (enderman, etc). Whennull, if the player is currently looking at a part, only that part will be queried for quads.- Returns:
- The quads, or an empty list.
-
renderStatic
default void renderStatic(T part, @Nullable @Nullable net.minecraft.client.renderer.RenderType layer, codechicken.lib.render.CCRenderState ccrs) Description copied from interface:PartRendererRender the static, unmoving faces of this part into the world renderer.The given CCRenderState is set up as follows should you wish to use it:
-
CCRenderState.reset()has been called. - The current buffer is bound toCCRenderState. - TheLightMatrixis setup and ready to use.Should you wish to not use
CCRenderStateand associated utilities. You can obtain the rawVertexConsumerfromCCRenderState.getConsumer()and theVertexFormatfromCCRenderState.getVertexFormat().If you wish to render your part as a standard
BakedModelplease seePartBakedModelRenderer.This method may be called on chunk batching threads, all operations performed here must be thread aware.
It is illegal to perform raw GL calls within this method. You will not have a valid GL context, or, a context from another thread.
- Specified by:
renderStaticin interfacePartRenderer<T extends ModelRenderPart>- Parameters:
part- TheMultiPartbeing rendered.layer- The blockRenderTypelayer being rendered.nullforPartRenderer.renderBreaking(T, codechicken.lib.render.CCRenderState)ccrs- TheCCRenderStateinstance to render with.
-