Class AbstractDisplayRenderer<T extends Display,O extends RenderOptions>
java.lang.Object
net.darkhax.botanypots.common.api.data.display.render.DisplayRenderer<T>
net.darkhax.botanypots.common.api.data.display.render.AbstractDisplayRenderer<T,O>
- Type Parameters:
T- The display type to render.O- The configurable render options.
- Direct Known Subclasses:
SimpleDisplayStateRenderer,TexturedCubeStateRenderer
public abstract class AbstractDisplayRenderer<T extends Display,O extends RenderOptions>
extends DisplayRenderer<T>
A helpful base to build a display renderer. It handles stuff like scale, rotation, and offset.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloatgetHeight(T display, O renderOptions, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, float tickDelta, BotanyPotBlockEntity pot) Calculates the height of the render.abstract OgetRenderOptions(T display) Gets the render options to apply from the display.floatrender(net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider.Context context, T display, com.mojang.blaze3d.vertex.PoseStack pose, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, float tickDelta, net.minecraft.client.renderer.MultiBufferSource bufferSource, int light, int overlay, BotanyPotBlockEntity pot, float progress, float growthScale, float heightOffset) Renders the display in the world.abstract voidrender(net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider.Context context, T display, O renderOptions, com.mojang.blaze3d.vertex.PoseStack pose, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, float tickDelta, net.minecraft.client.renderer.MultiBufferSource bufferSource, int light, int overlay, BotanyPotBlockEntity pot, float progress, float growthScale, float heightOffset) Renders the display in the world.Methods inherited from class net.darkhax.botanypots.common.api.data.display.render.DisplayRenderer
bind, getRenderer, renderState
-
Constructor Details
-
AbstractDisplayRenderer
public AbstractDisplayRenderer()
-
-
Method Details
-
render
public float render(net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider.Context context, T display, com.mojang.blaze3d.vertex.PoseStack pose, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, float tickDelta, net.minecraft.client.renderer.MultiBufferSource bufferSource, int light, int overlay, BotanyPotBlockEntity pot, float progress, float growthScale, float heightOffset) Description copied from class:DisplayRendererRenders the display in the world.- Specified by:
renderin classDisplayRenderer<T extends Display>- Parameters:
context- Context provided when rendering a block entity.display- The display to render.pose- The pose stack for the renderer.level- The current level, will always be a client level.pos- The position of te block being rendered.tickDelta- The delta between frames.bufferSource- Buffer source for rendering.light- Packed light of the block.overlay- Packed overlay of the block.pot- The pot block entity.progress- The growth progress of the crop.growthScale- The scale based on current growth progress.heightOffset- A height offset used to make displays stack perfectly on top of each other.- Returns:
- The new height offset for the next display.
-
getRenderOptions
Gets the render options to apply from the display.- Parameters:
display- The display to render.- Returns:
- The options to use when rendering.
-
getHeight
public float getHeight(T display, O renderOptions, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, float tickDelta, BotanyPotBlockEntity pot) Calculates the height of the render. This is used to apply an offset to future renders, making sure they render directly on top of the previous render.- Parameters:
display- The display being rendered.renderOptions- User defined rendering options used to configure the renderer.level- The current level, will always be a client level.pos- The position of the pot being rendered.tickDelta- The delta between frames.pot- The pot block entity.- Returns:
- The height of the render.
-
render
public abstract void render(net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider.Context context, T display, O renderOptions, com.mojang.blaze3d.vertex.PoseStack pose, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, float tickDelta, net.minecraft.client.renderer.MultiBufferSource bufferSource, int light, int overlay, BotanyPotBlockEntity pot, float progress, float growthScale, float heightOffset) Renders the display in the world.- Parameters:
context- Context provided when rendering a block entity.display- The display to render.renderOptions- User defined rendering options used to configure the renderer.pose- The pose stack for the renderer.level- The current level, will always be a client level.pos- The position of te block being rendered.tickDelta- The delta between frames.bufferSource- Buffer source for rendering.light- Packed light of the block.overlay- Packed overlay of the block.pot- The pot block entity.progress- The growth progress of the crop.growthScale- The scale based on current growth progress.heightOffset- A height offset used to make displays stack perfectly on top of each other.
-