Class TransformingBlockRenderer<T extends net.minecraft.world.level.block.entity.BlockEntity>

java.lang.Object
org.moddingx.libx.render.block.TransformingBlockRenderer<T>
Type Parameters:
T -
All Implemented Interfaces:
net.minecraft.client.renderer.blockentity.BlockEntityRenderer<T>
Direct Known Subclasses:
DirectionalBlockRenderer, RotatedBlockRenderer

public abstract class TransformingBlockRenderer<T extends net.minecraft.world.level.block.entity.BlockEntity> extends Object implements net.minecraft.client.renderer.blockentity.BlockEntityRenderer<T>
A BlockEntityRenderer that transforms the pose stack in some way before the actual render code. The render methode takes care of the pose stack being pushed and popped.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
    doRender(T blockEntity, float partialTicks, com.mojang.blaze3d.vertex.PoseStack poseStack, net.minecraft.client.renderer.MultiBufferSource buffer, int light, int overlay)
    Renders the block entity.
    final void
    render(T blockEntity, float partialTicks, com.mojang.blaze3d.vertex.PoseStack poseStack, net.minecraft.client.renderer.MultiBufferSource buffer, int light, int overlay)
     
    protected abstract void
    transform(T blockEntity, float partialTicks, com.mojang.blaze3d.vertex.PoseStack poseStack)
    Applies the pre-redner transformation to the pose stack.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraft.client.renderer.blockentity.BlockEntityRenderer

    getViewDistance, shouldRender, shouldRenderOffScreen
  • Constructor Details

    • TransformingBlockRenderer

      public TransformingBlockRenderer()
  • Method Details

    • render

      public final void render(@Nonnull T blockEntity, float partialTicks, @Nonnull com.mojang.blaze3d.vertex.PoseStack poseStack, @Nonnull net.minecraft.client.renderer.MultiBufferSource buffer, int light, int overlay)
      Specified by:
      render in interface net.minecraft.client.renderer.blockentity.BlockEntityRenderer<T extends net.minecraft.world.level.block.entity.BlockEntity>
    • transform

      protected abstract void transform(@Nonnull T blockEntity, float partialTicks, @Nonnull com.mojang.blaze3d.vertex.PoseStack poseStack)
      Applies the pre-redner transformation to the pose stack.
    • doRender

      protected abstract void doRender(@Nonnull T blockEntity, float partialTicks, @Nonnull com.mojang.blaze3d.vertex.PoseStack poseStack, @Nonnull net.minecraft.client.renderer.MultiBufferSource buffer, int light, int overlay)
      Renders the block entity.