Class ItemStackRenderer

java.lang.Object
net.minecraft.client.renderer.BlockEntityWithoutLevelRenderer
org.moddingx.libx.render.ItemStackRenderer
All Implemented Interfaces:
net.minecraft.server.packs.resources.PreparableReloadListener, net.minecraft.server.packs.resources.ResourceManagerReloadListener

public class ItemStackRenderer extends net.minecraft.client.renderer.BlockEntityWithoutLevelRenderer
This class is meant to apply a BlockEntityRenderer to items. Using it is really straightforward: The required models will generate automatically if you're using ItemModelProviderBase.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener

    net.minecraft.server.packs.resources.PreparableReloadListener.PreparationBarrier
  • Field Summary

    Fields inherited from class net.minecraft.client.renderer.BlockEntityWithoutLevelRenderer

    blockEntityRenderDispatcher
  • Constructor Summary

    Constructors
    Constructor
    Description
    ItemStackRenderer(net.minecraft.client.renderer.blockentity.BlockEntityRenderDispatcher dispatcher, net.minecraft.client.model.geom.EntityModelSet modelSet)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T extends net.minecraft.world.level.block.entity.BlockEntity>
    void
    addRenderBlock(net.minecraft.world.level.block.entity.BlockEntityType<T> beType, boolean readBlockEntityTag)
    Registers a BlockEntityType to be rendered with the ItemStackRenderer.
    static net.minecraftforge.client.extensions.common.IClientItemExtensions
    Creates some IClientItemExtensions for with use the ItemStackRenderer.
    get()
    Gets the instance of the ItemStackRenderer.
    void
    renderByItem(net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.ItemDisplayContext ctx, com.mojang.blaze3d.vertex.PoseStack poseStack, net.minecraft.client.renderer.MultiBufferSource buffer, int light, int overlay)
     

    Methods inherited from class net.minecraft.client.renderer.BlockEntityWithoutLevelRenderer

    onResourceManagerReload

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener

    getName

    Methods inherited from interface net.minecraft.server.packs.resources.ResourceManagerReloadListener

    reload
  • Constructor Details

    • ItemStackRenderer

      public ItemStackRenderer(net.minecraft.client.renderer.blockentity.BlockEntityRenderDispatcher dispatcher, net.minecraft.client.model.geom.EntityModelSet modelSet)
  • Method Details

    • addRenderBlock

      public static <T extends net.minecraft.world.level.block.entity.BlockEntity> void addRenderBlock(net.minecraft.world.level.block.entity.BlockEntityType<T> beType, boolean readBlockEntityTag)
      Registers a BlockEntityType to be rendered with the ItemStackRenderer.
      Parameters:
      beType - The Block Entity Type.
      readBlockEntityTag - If this is set to true and an item has a BlockEntityTag, the block entities load method will get called before rendering.
    • renderByItem

      public void renderByItem(net.minecraft.world.item.ItemStack stack, @Nonnull net.minecraft.world.item.ItemDisplayContext ctx, @Nonnull com.mojang.blaze3d.vertex.PoseStack poseStack, @Nonnull net.minecraft.client.renderer.MultiBufferSource buffer, int light, int overlay)
      Overrides:
      renderByItem in class net.minecraft.client.renderer.BlockEntityWithoutLevelRenderer
    • get

      public static ItemStackRenderer get()
      Gets the instance of the ItemStackRenderer.
    • createProperties

      public static net.minecraftforge.client.extensions.common.IClientItemExtensions createProperties()
      Creates some IClientItemExtensions for with use the ItemStackRenderer.