@Environment(value=CLIENT) public class ItemRenderer extends Object implements SynchronousResourceReloadListener
ResourceReloadListener.Synchronizer
Modifier and Type | Field and Description |
---|---|
private ItemColors |
colorMap |
static Identifier |
ENCHANTED_ITEM_GLINT |
private ItemModels |
models |
private TextureManager |
textureManager |
private static Set<Item> |
WITHOUT_MODELS |
float |
zOffset |
Constructor and Description |
---|
ItemRenderer(TextureManager manager,
BakedModelManager bakery,
ItemColors colorMap) |
Modifier and Type | Method and 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(ItemStack stack,
int x,
int y)
Renders an item in a GUI with the player as the attached entity
for calculating model overrides.
|
void |
renderInGuiWithOverrides(LivingEntity entity,
ItemStack stack,
int x,
int y)
Renders an item in a GUI with an attached entity.
|
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) |
void |
renderItem(LivingEntity entity,
ItemStack item,
ModelTransformation.Mode renderMode,
boolean leftHanded,
MatrixStack matrices,
VertexConsumerProvider vertexConsumers,
World world,
int light,
int overlay) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
reload
getName
public static final Identifier ENCHANTED_ITEM_GLINT
public float zOffset
private final ItemModels models
private final TextureManager textureManager
private final ItemColors colorMap
public ItemRenderer(TextureManager manager, BakedModelManager bakery, ItemColors colorMap)
public ItemModels getModels()
private void renderBakedItemModel(BakedModel model, ItemStack stack, int light, int overlay, MatrixStack matrices, VertexConsumer vertices)
public void renderItem(ItemStack stack, ModelTransformation.Mode renderMode, boolean leftHanded, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay, BakedModel model)
public static VertexConsumer getArmorGlintConsumer(VertexConsumerProvider provider, RenderLayer layer, boolean solid, boolean glint)
public static VertexConsumer getCompassGlintConsumer(VertexConsumerProvider provider, RenderLayer layer, MatrixStack.Entry entry)
public static VertexConsumer getDirectCompassGlintConsumer(VertexConsumerProvider provider, RenderLayer layer, MatrixStack.Entry entry)
public static VertexConsumer getItemGlintConsumer(VertexConsumerProvider vertexConsumers, RenderLayer layer, boolean solid, boolean glint)
public static VertexConsumer getDirectItemGlintConsumer(VertexConsumerProvider provider, RenderLayer layer, boolean solid, boolean glint)
private void renderBakedItemQuads(MatrixStack matrices, VertexConsumer vertices, List<BakedQuad> quads, ItemStack stack, int light, int overlay)
public BakedModel getHeldItemModel(ItemStack stack, @Nullable World world, @Nullable LivingEntity entity)
public void renderItem(ItemStack stack, ModelTransformation.Mode transformationType, int light, int overlay, MatrixStack matrices, VertexConsumerProvider vertexConsumers)
public void renderItem(@Nullable LivingEntity entity, ItemStack item, ModelTransformation.Mode renderMode, boolean leftHanded, MatrixStack matrices, VertexConsumerProvider vertexConsumers, @Nullable World world, int light, int overlay)
public void renderGuiItemIcon(ItemStack stack, int x, int y)
protected void renderGuiItemModel(ItemStack stack, int x, int y, BakedModel model)
public void renderInGuiWithOverrides(ItemStack stack, int x, int y)
public void renderInGui(ItemStack stack, int x, int y)
public void renderInGuiWithOverrides(LivingEntity entity, ItemStack stack, int x, int y)
The entity is used to calculate model overrides for the item.
private void innerRenderInGui(@Nullable LivingEntity entity, ItemStack itemStack, int x, int y)
public void renderGuiItemOverlay(TextRenderer renderer, ItemStack stack, int x, int y)
public void renderGuiItemOverlay(TextRenderer renderer, ItemStack stack, int x, int y, @Nullable String countLabel)
countLabel
- a label for the stack; if null, the stack count is drawn insteadprivate void renderGuiQuad(BufferBuilder buffer, int x, int y, int width, int height, int red, int green, int blue, int alpha)
public void apply(ResourceManager manager)
apply
in interface SynchronousResourceReloadListener