Package net.minecraft.client.render.item
Class ItemRenderer
java.lang.Object
net.minecraft.client.render.item.ItemRenderer
- All Implemented Interfaces:
ResourceReloadListener
,SynchronousResourceReloadListener
@Environment(CLIENT) public class ItemRenderer extends Object implements SynchronousResourceReloadListener
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.resource.ResourceReloadListener
ResourceReloadListener.Synchronizer
-
Field Summary
Fields Modifier and Type Field Description private ItemColors
colorMap
static Identifier
ENCHANTED_ITEM_GLINT
private ItemModels
models
private TextureManager
textureManager
private static Set<Item>
WITHOUT_MODELS
float
zOffset
-
Constructor Summary
Constructors Constructor Description ItemRenderer(TextureManager manager, BakedModelManager bakery, ItemColors colorMap)
-
Method Summary
Modifier and Type Method Description void
apply(ResourceManager manager)
static VertexConsumer
getArmorGlintConsumer(VertexConsumerProvider provider, RenderLayer layer, boolean solid, boolean glint)
static VertexConsumer
getCompassGlintConsumer(VertexConsumerProvider provider, RenderLayer layer, MatrixStack.Entry entry)
static VertexConsumer
getDirectCompassGlintConsumer(VertexConsumerProvider provider, RenderLayer layer, MatrixStack.Entry entry)
static VertexConsumer
getDirectItemGlintConsumer(VertexConsumerProvider provider, RenderLayer layer, boolean solid, boolean glint)
BakedModel
getHeldItemModel(ItemStack stack, World world, LivingEntity entity)
static VertexConsumer
getItemGlintConsumer(VertexConsumerProvider vertexConsumers, RenderLayer layer, boolean solid, boolean glint)
ItemModels
getModels()
private void
innerRenderInGui(LivingEntity entity, ItemStack itemStack, int x, int y)
private void
renderBakedItemModel(BakedModel model, ItemStack stack, int light, int overlay, MatrixStack matrices, VertexConsumer vertices)
private void
renderBakedItemQuads(MatrixStack matrices, VertexConsumer vertices, List<BakedQuad> quads, ItemStack stack, int light, int overlay)
void
renderGuiItemIcon(ItemStack stack, int x, int y)
protected void
renderGuiItemModel(ItemStack stack, int x, int y, BakedModel model)
void
renderGuiItemOverlay(TextRenderer renderer, ItemStack stack, int x, int y)
Renders the overlay for items in GUIs, including the damage bar and the item count.void
renderGuiItemOverlay(TextRenderer renderer, ItemStack stack, int x, int y, String countLabel)
Renders the overlay for items in GUIs, including the damage bar and the item count.private void
renderGuiQuad(BufferBuilder buffer, int x, int y, int width, int height, int red, int green, int blue, int alpha)
void
renderInGui(ItemStack stack, int x, int y)
Renders an item in a GUI without an attached entity.void
renderInGuiWithOverrides(LivingEntity entity, ItemStack stack, int x, int y)
Renders an item in a GUI with an attached entity.void
renderInGuiWithOverrides(ItemStack stack, int x, int y)
Renders an item in a GUI with the player as the attached entity for calculating model overrides.void
renderItem(LivingEntity entity, ItemStack item, ModelTransformation.Mode renderMode, boolean leftHanded, MatrixStack matrices, VertexConsumerProvider vertexConsumers, World world, int light, int overlay)
void
renderItem(ItemStack stack, ModelTransformation.Mode renderMode, boolean leftHanded, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay, BakedModel model)
void
renderItem(ItemStack stack, ModelTransformation.Mode transformationType, int light, int overlay, MatrixStack matrices, VertexConsumerProvider vertexConsumers)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.resource.ResourceReloadListener
getName
Methods inherited from interface net.minecraft.resource.SynchronousResourceReloadListener
reload
-
Field Details
-
ENCHANTED_ITEM_GLINT
-
WITHOUT_MODELS
-
zOffset
public float zOffset -
models
-
textureManager
-
colorMap
-
-
Constructor Details
-
ItemRenderer
-
-
Method Details
-
getModels
-
renderBakedItemModel
private void renderBakedItemModel(BakedModel model, ItemStack stack, int light, int overlay, MatrixStack matrices, VertexConsumer vertices) -
renderItem
public void renderItem(ItemStack stack, ModelTransformation.Mode renderMode, boolean leftHanded, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay, BakedModel model) -
getArmorGlintConsumer
public static VertexConsumer getArmorGlintConsumer(VertexConsumerProvider provider, RenderLayer layer, boolean solid, boolean glint) -
getCompassGlintConsumer
public static VertexConsumer getCompassGlintConsumer(VertexConsumerProvider provider, RenderLayer layer, MatrixStack.Entry entry) -
getDirectCompassGlintConsumer
public static VertexConsumer getDirectCompassGlintConsumer(VertexConsumerProvider provider, RenderLayer layer, MatrixStack.Entry entry) -
getItemGlintConsumer
public static VertexConsumer getItemGlintConsumer(VertexConsumerProvider vertexConsumers, RenderLayer layer, boolean solid, boolean glint) -
getDirectItemGlintConsumer
public static VertexConsumer getDirectItemGlintConsumer(VertexConsumerProvider provider, RenderLayer layer, boolean solid, boolean glint) -
renderBakedItemQuads
private void renderBakedItemQuads(MatrixStack matrices, VertexConsumer vertices, List<BakedQuad> quads, ItemStack stack, int light, int overlay) -
getHeldItemModel
public BakedModel getHeldItemModel(ItemStack stack, @Nullable World world, @Nullable LivingEntity entity) -
renderItem
public void renderItem(ItemStack stack, ModelTransformation.Mode transformationType, int light, int overlay, MatrixStack matrices, VertexConsumerProvider vertexConsumers) -
renderItem
public void renderItem(@Nullable LivingEntity entity, ItemStack item, ModelTransformation.Mode renderMode, boolean leftHanded, MatrixStack matrices, VertexConsumerProvider vertexConsumers, @Nullable World world, int light, int overlay) -
renderGuiItemIcon
-
renderGuiItemModel
-
renderInGuiWithOverrides
Renders an item in a GUI with the player as the attached entity for calculating model overrides. -
renderInGui
Renders an item in a GUI without an attached entity. -
renderInGuiWithOverrides
Renders an item in a GUI with an attached entity.The entity is used to calculate model overrides for the item.
-
innerRenderInGui
-
renderGuiItemOverlay
Renders the overlay for items in GUIs, including the damage bar and the item count. -
renderGuiItemOverlay
public void renderGuiItemOverlay(TextRenderer renderer, ItemStack stack, int x, int y, @Nullable String countLabel)Renders the overlay for items in GUIs, including the damage bar and the item count.- Parameters:
countLabel
- a label for the stack; if null, the stack count is drawn instead
-
renderGuiQuad
private void renderGuiQuad(BufferBuilder buffer, int x, int y, int width, int height, int red, int green, int blue, int alpha) -
apply
- Specified by:
apply
in interfaceSynchronousResourceReloadListener
-